diff --git a/.gitignore b/.gitignore index 4febfff1c..748a1cad0 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,5 @@ test/helpers/request.json .idea/ git_push.sh +/module/ +/lib/ diff --git a/.mocharc.json b/.mocharc.json new file mode 100644 index 000000000..0bdb2216a --- /dev/null +++ b/.mocharc.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/mocharc", + "loader": "ts-node/esm", + "spec": [ + "test/**/*.ts", + "lib/*/tests/**/*.ts" + ] +} diff --git a/generate-code.py b/generate-code.py index 96619bb8f..1e265afab 100644 --- a/generate-code.py +++ b/generate-code.py @@ -76,7 +76,7 @@ def generate_webhook(): run_command(f'rm -rf lib/webhook/tests/') with open('lib/webhook/api.ts', 'w') as wfp: - wfp.write("""export * from './model/models';""") + wfp.write("""export * from './model/models.js';""") def main(): diff --git a/generator/src/main/resources/line-bot-sdk-nodejs-generator/api-all.pebble b/generator/src/main/resources/line-bot-sdk-nodejs-generator/api-all.pebble index ed67d7c50..5dcf88e18 100644 --- a/generator/src/main/resources/line-bot-sdk-nodejs-generator/api-all.pebble +++ b/generator/src/main/resources/line-bot-sdk-nodejs-generator/api-all.pebble @@ -1,4 +1,4 @@ {# @pebvariable name="apiInfo" type="org.openapitools.codegen.model.ApiInfoMap" #} {% for api in apiInfo.apis -%} -export { {{ api.operations.classname }} } from './{{ api.get("classFilename") }}'; +export { {{ api.operations.classname }} } from './{{ api.get("classFilename") }}.js'; {% endfor %} diff --git a/generator/src/main/resources/line-bot-sdk-nodejs-generator/api-single.pebble b/generator/src/main/resources/line-bot-sdk-nodejs-generator/api-single.pebble index 51208af67..e238221fb 100644 --- a/generator/src/main/resources/line-bot-sdk-nodejs-generator/api-single.pebble +++ b/generator/src/main/resources/line-bot-sdk-nodejs-generator/api-single.pebble @@ -5,13 +5,13 @@ /* tslint:disable:no-unused-locals */ {% for import in imports -%} -import { {{import.classname}} } from '{{import.filename}}'; +import { {{import.classname}} } from '{{import.filename}}.js'; {% endfor %} -import * as Types from "../../types"; -import {ensureJSON} from "../../utils"; +import * as Types from "../../types.js"; +import {ensureJSON} from "../../utils.js"; import {Readable} from "node:stream"; -import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch"; +import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch.js"; // =============================================== // This file is autogenerated - Please do not edit diff --git a/generator/src/main/resources/line-bot-sdk-nodejs-generator/api.pebble b/generator/src/main/resources/line-bot-sdk-nodejs-generator/api.pebble index b1119f15c..048a59bd5 100644 --- a/generator/src/main/resources/line-bot-sdk-nodejs-generator/api.pebble +++ b/generator/src/main/resources/line-bot-sdk-nodejs-generator/api.pebble @@ -1,3 +1,3 @@ // This is the entrypoint for the package -export * from './api/apis'; -export * from './model/models'; +export * from './api/apis.js'; +export * from './model/models.js'; diff --git a/generator/src/main/resources/line-bot-sdk-nodejs-generator/api_test.pebble b/generator/src/main/resources/line-bot-sdk-nodejs-generator/api_test.pebble index 0b0ba2498..cecc0b549 100644 --- a/generator/src/main/resources/line-bot-sdk-nodejs-generator/api_test.pebble +++ b/generator/src/main/resources/line-bot-sdk-nodejs-generator/api_test.pebble @@ -1,16 +1,18 @@ {# @pebvariable name="imports" type="java.util.List>" #} {# @pebvariable name="operations" type="org.openapitools.codegen.model.OperationMap" #} {# @pebvariable name="authMethods" type="java.util.ArrayList" -#} -import { {{operations.classname}} } from "../../api"; +import { {{operations.classname}} } from "../../api.js"; {% for import in imports -%} -import { {{import.classname}} } from '../{{import.filename}}'; +import { {{import.classname}} } from '../{{import.filename}}.js'; {% endfor %} import { createServer } from "node:http"; import { deepEqual, equal, ok } from "node:assert"; -const pkg = require("../../../../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../../../../package.json"); const channel_access_token = "test_channel_access_token"; diff --git a/generator/src/main/resources/line-bot-sdk-nodejs-generator/model.pebble b/generator/src/main/resources/line-bot-sdk-nodejs-generator/model.pebble index b044274a2..39b9e3b39 100644 --- a/generator/src/main/resources/line-bot-sdk-nodejs-generator/model.pebble +++ b/generator/src/main/resources/line-bot-sdk-nodejs-generator/model.pebble @@ -3,12 +3,12 @@ {% for model in models %} {% for tsi in model.get('tsImports') -%} -import { {{ tsi.classname }} } from '{{ tsi.filename }}'; +import { {{ tsi.classname }} } from '{{ tsi.filename }}.js'; {%- endfor %} {% if model.model.discriminator != null %} {% for model in model.model.discriminator.mappedModels -%} -import { {{model.modelName}} } from './models'; +import { {{model.modelName}} } from './models.js'; {% endfor %} export type {{classname}} = @@ -30,7 +30,7 @@ export type Unknown{{classname}} = {{classname}}Base & { {%- endif -%} {% if not model.model.isEnum -%} {% if model.model.parent != null %} -import { {{ model.model.parent }}Base } from './models'; +import { {{ model.model.parent }}Base } from './models.js'; {% endif %} export type {{classname}}{% if model.model.discriminator != null %}Base{% endif %} = {% if model.model.parent != null %}{{ model.model.parent }}Base & {% endif %} { {% if model.model.vendorExtensions.get("x-selector") != null %} diff --git a/generator/src/main/resources/line-bot-sdk-nodejs-generator/models.pebble b/generator/src/main/resources/line-bot-sdk-nodejs-generator/models.pebble index ad3f9f570..72661371a 100644 --- a/generator/src/main/resources/line-bot-sdk-nodejs-generator/models.pebble +++ b/generator/src/main/resources/line-bot-sdk-nodejs-generator/models.pebble @@ -1,4 +1,4 @@ {# @pebvariable name="models" type="java.util.ArrayList" #} {% for model in models -%} -export * from '{{ model.model.classFilename }}'; +export * from '{{ model.model.classFilename }}.js'; {%- endfor %} diff --git a/lib/channel-access-token/api.ts b/lib/channel-access-token/api.ts index eeedcdab6..048a59bd5 100644 --- a/lib/channel-access-token/api.ts +++ b/lib/channel-access-token/api.ts @@ -1,3 +1,3 @@ // This is the entrypoint for the package -export * from "./api/apis"; -export * from "./model/models"; +export * from './api/apis.js'; +export * from './model/models.js'; diff --git a/lib/channel-access-token/api/apis.ts b/lib/channel-access-token/api/apis.ts index aa7db257a..96953602f 100644 --- a/lib/channel-access-token/api/apis.ts +++ b/lib/channel-access-token/api/apis.ts @@ -1 +1,3 @@ -export { ChannelAccessTokenClient } from "./channelAccessTokenClient"; + +export { ChannelAccessTokenClient } from './channelAccessTokenClient.js'; + diff --git a/lib/channel-access-token/api/channelAccessTokenClient.ts b/lib/channel-access-token/api/channelAccessTokenClient.ts index eaf05d43c..c551dc2b4 100644 --- a/lib/channel-access-token/api/channelAccessTokenClient.ts +++ b/lib/channel-access-token/api/channelAccessTokenClient.ts @@ -1,3 +1,5 @@ + + /** * Channel Access Token API * This document describes Channel Access Token API. @@ -10,423 +12,463 @@ * Do not edit the class manually. */ + /* tslint:disable:no-unused-locals */ -import { ChannelAccessTokenKeyIdsResponse } from "../model/channelAccessTokenKeyIdsResponse"; -import { ErrorResponse } from "../model/errorResponse"; -import { IssueChannelAccessTokenResponse } from "../model/issueChannelAccessTokenResponse"; -import { IssueShortLivedChannelAccessTokenResponse } from "../model/issueShortLivedChannelAccessTokenResponse"; -import { IssueStatelessChannelAccessTokenResponse } from "../model/issueStatelessChannelAccessTokenResponse"; -import { VerifyChannelAccessTokenResponse } from "../model/verifyChannelAccessTokenResponse"; +import { ChannelAccessTokenKeyIdsResponse } from '../model/channelAccessTokenKeyIdsResponse.js'; +import { ErrorResponse } from '../model/errorResponse.js'; +import { IssueChannelAccessTokenResponse } from '../model/issueChannelAccessTokenResponse.js'; +import { IssueShortLivedChannelAccessTokenResponse } from '../model/issueShortLivedChannelAccessTokenResponse.js'; +import { IssueStatelessChannelAccessTokenResponse } from '../model/issueStatelessChannelAccessTokenResponse.js'; +import { VerifyChannelAccessTokenResponse } from '../model/verifyChannelAccessTokenResponse.js'; -import * as Types from "../../types"; -import { ensureJSON } from "../../utils"; -import { Readable } from "node:stream"; +import * as Types from "../../types.js"; +import {ensureJSON} from "../../utils.js"; +import {Readable} from "node:stream"; -import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch"; +import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch.js"; // =============================================== // This file is autogenerated - Please do not edit // =============================================== interface httpClientConfig { - baseURL?: string; - // TODO support defaultHeaders? + baseURL?: string; + // TODO support defaultHeaders? } + export class ChannelAccessTokenClient { - private httpClient: HTTPFetchClient; + private httpClient: HTTPFetchClient; - constructor(config: httpClientConfig) { - if (!config.baseURL) { - config.baseURL = "https://api.line.me"; + constructor(config: httpClientConfig) { + if (!config.baseURL) { + config.baseURL = 'https://api.line.me'; + } + this.httpClient = new HTTPFetchClient({ + defaultHeaders: { + }, + baseURL: config.baseURL, + }); } - this.httpClient = new HTTPFetchClient({ - defaultHeaders: {}, - baseURL: config.baseURL, - }); - } - - private async parseHTTPResponse(response: Response) { - const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; - let resBody: Record = { - ...(await response.json()), - }; - if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { - resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = response.headers.get( - LINE_REQUEST_ID_HTTP_HEADER_NAME, - ); + + private async parseHTTPResponse(response: Response) { + const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; + let resBody: Record = { + ...await response.json(), + }; + if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { + resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = + response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME); + } + return resBody; } - return resBody; - } - - /** - * Gets all valid channel access token key IDs. - * @param clientAssertionType `urn:ietf:params:oauth:client-assertion-type:jwt-bearer` - * @param clientAssertion A JSON Web Token (JWT) (opens new window)the client needs to create and sign with the private key. - * - * @see Documentation - */ - public async getsAllValidChannelAccessTokenKeyIds( - clientAssertionType: string, - clientAssertion: string, - ): Promise { - return ( - await this.getsAllValidChannelAccessTokenKeyIdsWithHttpInfo( - clientAssertionType, - clientAssertion, - ) - ).body; - } - - /** - * Gets all valid channel access token key IDs.. - * This method includes HttpInfo object to return additional information. - * @param clientAssertionType `urn:ietf:params:oauth:client-assertion-type:jwt-bearer` - * @param clientAssertion A JSON Web Token (JWT) (opens new window)the client needs to create and sign with the private key. - * - * @see Documentation - */ - public async getsAllValidChannelAccessTokenKeyIdsWithHttpInfo( - clientAssertionType: string, - clientAssertion: string, - ): Promise> { + +/** + * Gets all valid channel access token key IDs. + * @param clientAssertionType `urn:ietf:params:oauth:client-assertion-type:jwt-bearer` + * @param clientAssertion A JSON Web Token (JWT) (opens new window)the client needs to create and sign with the private key. + * + * @see Documentation + */ + public async getsAllValidChannelAccessTokenKeyIds(clientAssertionType: string, clientAssertion: string, ) : Promise { + return (await this.getsAllValidChannelAccessTokenKeyIdsWithHttpInfo(clientAssertionType, clientAssertion, )).body; + } + + /** + * Gets all valid channel access token key IDs.. + * This method includes HttpInfo object to return additional information. + * @param clientAssertionType `urn:ietf:params:oauth:client-assertion-type:jwt-bearer` + * @param clientAssertion A JSON Web Token (JWT) (opens new window)the client needs to create and sign with the private key. + * + * @see Documentation + */ + public async getsAllValidChannelAccessTokenKeyIdsWithHttpInfo(clientAssertionType: string, clientAssertion: string, ) : Promise> { + + + + const queryParams = { - clientAssertionType: clientAssertionType, - clientAssertion: clientAssertion, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/oauth2/v2.1/tokens/kid", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Issue short-lived channel access token - * @param grantType `client_credentials` - * @param clientId Channel ID. - * @param clientSecret Channel secret. - * - * @see Documentation - */ - public async issueChannelToken( - grantType?: string, - clientId?: string, - clientSecret?: string, - ): Promise { - return ( - await this.issueChannelTokenWithHttpInfo( - grantType, - clientId, - clientSecret, - ) - ).body; - } - - /** - * Issue short-lived channel access token. - * This method includes HttpInfo object to return additional information. - * @param grantType `client_credentials` - * @param clientId Channel ID. - * @param clientSecret Channel secret. - * - * @see Documentation - */ - public async issueChannelTokenWithHttpInfo( - grantType?: string, - clientId?: string, - clientSecret?: string, - ): Promise> { + "clientAssertionType": clientAssertionType, + "clientAssertion": clientAssertion, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/oauth2/v2.1/tokens/kid" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Issue short-lived channel access token + * @param grantType `client_credentials` + * @param clientId Channel ID. + * @param clientSecret Channel secret. + * + * @see Documentation + */ + public async issueChannelToken(grantType?: string, clientId?: string, clientSecret?: string, ) : Promise { + return (await this.issueChannelTokenWithHttpInfo(grantType, clientId, clientSecret, )).body; + } + + /** + * Issue short-lived channel access token. + * This method includes HttpInfo object to return additional information. + * @param grantType `client_credentials` + * @param clientId Channel ID. + * @param clientSecret Channel secret. + * + * @see Documentation + */ + public async issueChannelTokenWithHttpInfo(grantType?: string, clientId?: string, clientSecret?: string, ) : Promise> { + + + + const formParams = { - grant_type: grantType, - client_id: clientId, - client_secret: clientSecret, - }; - Object.keys(formParams).forEach((key: keyof typeof formParams) => { - if (formParams[key] === undefined) { - delete formParams[key]; - } - }); - - const res = await this.httpClient.postForm( - "/v2/oauth/accessToken", - formParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication. - * @param grantType client_credentials - * @param clientAssertionType urn:ietf:params:oauth:client-assertion-type:jwt-bearer - * @param clientAssertion A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. - * - * @see Documentation - */ - public async issueChannelTokenByJWT( - grantType?: string, - clientAssertionType?: string, - clientAssertion?: string, - ): Promise { - return ( - await this.issueChannelTokenByJWTWithHttpInfo( - grantType, - clientAssertionType, - clientAssertion, - ) - ).body; - } - - /** - * Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication.. - * This method includes HttpInfo object to return additional information. - * @param grantType client_credentials - * @param clientAssertionType urn:ietf:params:oauth:client-assertion-type:jwt-bearer - * @param clientAssertion A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. - * - * @see Documentation - */ - public async issueChannelTokenByJWTWithHttpInfo( - grantType?: string, - clientAssertionType?: string, - clientAssertion?: string, - ): Promise> { + "grant_type": grantType, + "client_id": clientId, + "client_secret": clientSecret, + + }; + Object.keys(formParams).forEach((key: keyof typeof formParams) => { + if (formParams[key] === undefined) { + delete formParams[key]; + } + }); + + + + const res = await this.httpClient.postForm( + "/v2/oauth/accessToken" + , + + formParams, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication. + * @param grantType client_credentials + * @param clientAssertionType urn:ietf:params:oauth:client-assertion-type:jwt-bearer + * @param clientAssertion A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. + * + * @see Documentation + */ + public async issueChannelTokenByJWT(grantType?: string, clientAssertionType?: string, clientAssertion?: string, ) : Promise { + return (await this.issueChannelTokenByJWTWithHttpInfo(grantType, clientAssertionType, clientAssertion, )).body; + } + + /** + * Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication.. + * This method includes HttpInfo object to return additional information. + * @param grantType client_credentials + * @param clientAssertionType urn:ietf:params:oauth:client-assertion-type:jwt-bearer + * @param clientAssertion A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. + * + * @see Documentation + */ + public async issueChannelTokenByJWTWithHttpInfo(grantType?: string, clientAssertionType?: string, clientAssertion?: string, ) : Promise> { + + + + const formParams = { - grant_type: grantType, - client_assertion_type: clientAssertionType, - client_assertion: clientAssertion, - }; - Object.keys(formParams).forEach((key: keyof typeof formParams) => { - if (formParams[key] === undefined) { - delete formParams[key]; - } - }); - - const res = await this.httpClient.postForm( - "/oauth2/v2.1/token", - formParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Issues a new stateless channel access token, which doesn\'t have max active token limit unlike the other token types. The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires. - * @param grantType `client_credentials` - * @param clientAssertionType URL-encoded value of `urn:ietf:params:oauth:client-assertion-type:jwt-bearer` - * @param clientAssertion A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. - * @param clientId Channel ID. - * @param clientSecret Channel secret. - * - * @see Documentation - */ - public async issueStatelessChannelToken( - grantType?: string, - clientAssertionType?: string, - clientAssertion?: string, - clientId?: string, - clientSecret?: string, - ): Promise { - return ( - await this.issueStatelessChannelTokenWithHttpInfo( - grantType, - clientAssertionType, - clientAssertion, - clientId, - clientSecret, - ) - ).body; - } - - /** - * Issues a new stateless channel access token, which doesn\'t have max active token limit unlike the other token types. The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires. . - * This method includes HttpInfo object to return additional information. - * @param grantType `client_credentials` - * @param clientAssertionType URL-encoded value of `urn:ietf:params:oauth:client-assertion-type:jwt-bearer` - * @param clientAssertion A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. - * @param clientId Channel ID. - * @param clientSecret Channel secret. - * - * @see Documentation - */ - public async issueStatelessChannelTokenWithHttpInfo( - grantType?: string, - clientAssertionType?: string, - clientAssertion?: string, - clientId?: string, - clientSecret?: string, - ): Promise> { + "grant_type": grantType, + "client_assertion_type": clientAssertionType, + "client_assertion": clientAssertion, + + }; + Object.keys(formParams).forEach((key: keyof typeof formParams) => { + if (formParams[key] === undefined) { + delete formParams[key]; + } + }); + + + + const res = await this.httpClient.postForm( + "/oauth2/v2.1/token" + , + + formParams, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Issues a new stateless channel access token, which doesn\'t have max active token limit unlike the other token types. The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires. + * @param grantType `client_credentials` + * @param clientAssertionType URL-encoded value of `urn:ietf:params:oauth:client-assertion-type:jwt-bearer` + * @param clientAssertion A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. + * @param clientId Channel ID. + * @param clientSecret Channel secret. + * + * @see Documentation + */ + public async issueStatelessChannelToken(grantType?: string, clientAssertionType?: string, clientAssertion?: string, clientId?: string, clientSecret?: string, ) : Promise { + return (await this.issueStatelessChannelTokenWithHttpInfo(grantType, clientAssertionType, clientAssertion, clientId, clientSecret, )).body; + } + + /** + * Issues a new stateless channel access token, which doesn\'t have max active token limit unlike the other token types. The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires. . + * This method includes HttpInfo object to return additional information. + * @param grantType `client_credentials` + * @param clientAssertionType URL-encoded value of `urn:ietf:params:oauth:client-assertion-type:jwt-bearer` + * @param clientAssertion A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. + * @param clientId Channel ID. + * @param clientSecret Channel secret. + * + * @see Documentation + */ + public async issueStatelessChannelTokenWithHttpInfo(grantType?: string, clientAssertionType?: string, clientAssertion?: string, clientId?: string, clientSecret?: string, ) : Promise> { + + + + const formParams = { - grant_type: grantType, - client_assertion_type: clientAssertionType, - client_assertion: clientAssertion, - client_id: clientId, - client_secret: clientSecret, - }; - Object.keys(formParams).forEach((key: keyof typeof formParams) => { - if (formParams[key] === undefined) { - delete formParams[key]; - } - }); - - const res = await this.httpClient.postForm("/oauth2/v3/token", formParams); - return { httpResponse: res, body: await res.json() }; - } - /** - * Revoke short-lived or long-lived channel access token - * @param accessToken Channel access token - * - * @see Documentation - */ - public async revokeChannelToken( - accessToken?: string, - ): Promise { - return (await this.revokeChannelTokenWithHttpInfo(accessToken)).body; - } - - /** - * Revoke short-lived or long-lived channel access token. - * This method includes HttpInfo object to return additional information. - * @param accessToken Channel access token - * - * @see Documentation - */ - public async revokeChannelTokenWithHttpInfo( - accessToken?: string, - ): Promise> { + "grant_type": grantType, + "client_assertion_type": clientAssertionType, + "client_assertion": clientAssertion, + "client_id": clientId, + "client_secret": clientSecret, + + }; + Object.keys(formParams).forEach((key: keyof typeof formParams) => { + if (formParams[key] === undefined) { + delete formParams[key]; + } + }); + + + + const res = await this.httpClient.postForm( + "/oauth2/v3/token" + , + + formParams, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Revoke short-lived or long-lived channel access token + * @param accessToken Channel access token + * + * @see Documentation + */ + public async revokeChannelToken(accessToken?: string, ) : Promise { + return (await this.revokeChannelTokenWithHttpInfo(accessToken, )).body; + } + + /** + * Revoke short-lived or long-lived channel access token. + * This method includes HttpInfo object to return additional information. + * @param accessToken Channel access token + * + * @see Documentation + */ + public async revokeChannelTokenWithHttpInfo(accessToken?: string, ) : Promise> { + + + + const formParams = { - access_token: accessToken, - }; - Object.keys(formParams).forEach((key: keyof typeof formParams) => { - if (formParams[key] === undefined) { - delete formParams[key]; - } - }); - - const res = await this.httpClient.postForm("/v2/oauth/revoke", formParams); - return { httpResponse: res, body: await res.json() }; - } - /** - * Revoke channel access token v2.1 - * @param clientId Channel ID - * @param clientSecret Channel Secret - * @param accessToken Channel access token - * - * @see Documentation - */ - public async revokeChannelTokenByJWT( - clientId?: string, - clientSecret?: string, - accessToken?: string, - ): Promise { - return ( - await this.revokeChannelTokenByJWTWithHttpInfo( - clientId, - clientSecret, - accessToken, - ) - ).body; - } - - /** - * Revoke channel access token v2.1. - * This method includes HttpInfo object to return additional information. - * @param clientId Channel ID - * @param clientSecret Channel Secret - * @param accessToken Channel access token - * - * @see Documentation - */ - public async revokeChannelTokenByJWTWithHttpInfo( - clientId?: string, - clientSecret?: string, - accessToken?: string, - ): Promise> { + "access_token": accessToken, + + }; + Object.keys(formParams).forEach((key: keyof typeof formParams) => { + if (formParams[key] === undefined) { + delete formParams[key]; + } + }); + + + + const res = await this.httpClient.postForm( + "/v2/oauth/revoke" + , + + formParams, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Revoke channel access token v2.1 + * @param clientId Channel ID + * @param clientSecret Channel Secret + * @param accessToken Channel access token + * + * @see Documentation + */ + public async revokeChannelTokenByJWT(clientId?: string, clientSecret?: string, accessToken?: string, ) : Promise { + return (await this.revokeChannelTokenByJWTWithHttpInfo(clientId, clientSecret, accessToken, )).body; + } + + /** + * Revoke channel access token v2.1. + * This method includes HttpInfo object to return additional information. + * @param clientId Channel ID + * @param clientSecret Channel Secret + * @param accessToken Channel access token + * + * @see Documentation + */ + public async revokeChannelTokenByJWTWithHttpInfo(clientId?: string, clientSecret?: string, accessToken?: string, ) : Promise> { + + + + const formParams = { - client_id: clientId, - client_secret: clientSecret, - access_token: accessToken, - }; - Object.keys(formParams).forEach((key: keyof typeof formParams) => { - if (formParams[key] === undefined) { - delete formParams[key]; - } - }); - - const res = await this.httpClient.postForm( - "/oauth2/v2.1/revoke", - formParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Verify the validity of short-lived and long-lived channel access tokens - * @param accessToken A short-lived or long-lived channel access token. - * - * @see Documentation - */ - public async verifyChannelToken( - accessToken?: string, - ): Promise { - return (await this.verifyChannelTokenWithHttpInfo(accessToken)).body; - } - - /** - * Verify the validity of short-lived and long-lived channel access tokens. - * This method includes HttpInfo object to return additional information. - * @param accessToken A short-lived or long-lived channel access token. - * - * @see Documentation - */ - public async verifyChannelTokenWithHttpInfo( - accessToken?: string, - ): Promise> { + "client_id": clientId, + "client_secret": clientSecret, + "access_token": accessToken, + + }; + Object.keys(formParams).forEach((key: keyof typeof formParams) => { + if (formParams[key] === undefined) { + delete formParams[key]; + } + }); + + + + const res = await this.httpClient.postForm( + "/oauth2/v2.1/revoke" + , + + formParams, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Verify the validity of short-lived and long-lived channel access tokens + * @param accessToken A short-lived or long-lived channel access token. + * + * @see Documentation + */ + public async verifyChannelToken(accessToken?: string, ) : Promise { + return (await this.verifyChannelTokenWithHttpInfo(accessToken, )).body; + } + + /** + * Verify the validity of short-lived and long-lived channel access tokens. + * This method includes HttpInfo object to return additional information. + * @param accessToken A short-lived or long-lived channel access token. + * + * @see Documentation + */ + public async verifyChannelTokenWithHttpInfo(accessToken?: string, ) : Promise> { + + + + const formParams = { - access_token: accessToken, - }; - Object.keys(formParams).forEach((key: keyof typeof formParams) => { - if (formParams[key] === undefined) { - delete formParams[key]; - } - }); - - const res = await this.httpClient.postForm("/v2/oauth/verify", formParams); - return { httpResponse: res, body: await res.json() }; - } - /** - * You can verify whether a Channel access token with a user-specified expiration (Channel Access Token v2.1) is valid. - * @param accessToken Channel access token with a user-specified expiration (Channel Access Token v2.1). - * - * @see Documentation - */ - public async verifyChannelTokenByJWT( - accessToken: string, - ): Promise { - return (await this.verifyChannelTokenByJWTWithHttpInfo(accessToken)).body; - } - - /** - * You can verify whether a Channel access token with a user-specified expiration (Channel Access Token v2.1) is valid.. - * This method includes HttpInfo object to return additional information. - * @param accessToken Channel access token with a user-specified expiration (Channel Access Token v2.1). - * - * @see Documentation - */ - public async verifyChannelTokenByJWTWithHttpInfo( - accessToken: string, - ): Promise> { + "access_token": accessToken, + + }; + Object.keys(formParams).forEach((key: keyof typeof formParams) => { + if (formParams[key] === undefined) { + delete formParams[key]; + } + }); + + + + const res = await this.httpClient.postForm( + "/v2/oauth/verify" + , + + formParams, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * You can verify whether a Channel access token with a user-specified expiration (Channel Access Token v2.1) is valid. + * @param accessToken Channel access token with a user-specified expiration (Channel Access Token v2.1). + * + * @see Documentation + */ + public async verifyChannelTokenByJWT(accessToken: string, ) : Promise { + return (await this.verifyChannelTokenByJWTWithHttpInfo(accessToken, )).body; + } + + /** + * You can verify whether a Channel access token with a user-specified expiration (Channel Access Token v2.1) is valid.. + * This method includes HttpInfo object to return additional information. + * @param accessToken Channel access token with a user-specified expiration (Channel Access Token v2.1). + * + * @see Documentation + */ + public async verifyChannelTokenByJWTWithHttpInfo(accessToken: string, ) : Promise> { + + + + const queryParams = { - accessToken: accessToken, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get("/oauth2/v2.1/verify", queryParams); - return { httpResponse: res, body: await res.json() }; - } + "accessToken": accessToken, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/oauth2/v2.1/verify" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } + } diff --git a/lib/channel-access-token/model/channelAccessTokenKeyIdsResponse.ts b/lib/channel-access-token/model/channelAccessTokenKeyIdsResponse.ts index 4de19e82a..d368149d3 100644 --- a/lib/channel-access-token/model/channelAccessTokenKeyIdsResponse.ts +++ b/lib/channel-access-token/model/channelAccessTokenKeyIdsResponse.ts @@ -10,14 +10,27 @@ * Do not edit the class manually. */ + + + + + /** * Channel access token key IDs */ -export type ChannelAccessTokenKeyIdsResponse = { - /** - * Array of channel access token key IDs. - * - * @see kids Documentation - */ - kids: Array /**/; -}; +export type ChannelAccessTokenKeyIdsResponse = { + /** + * Array of channel access token key IDs. + * + * @see kids Documentation + */ + 'kids': Array/**/; + +} + + + + + + + diff --git a/lib/channel-access-token/model/errorResponse.ts b/lib/channel-access-token/model/errorResponse.ts index 4f608f9ff..c1ac39e2f 100644 --- a/lib/channel-access-token/model/errorResponse.ts +++ b/lib/channel-access-token/model/errorResponse.ts @@ -10,16 +10,29 @@ * Do not edit the class manually. */ + + + + + /** * Error response of the Channel access token */ -export type ErrorResponse = { - /** - * Error summary - */ - error?: string /**/; - /** - * Details of the error. Not returned in certain situations. - */ - errorDescription?: string /**/; -}; +export type ErrorResponse = { + /** + * Error summary + */ + 'error'?: string/**/; + /** + * Details of the error. Not returned in certain situations. + */ + 'errorDescription'?: string/**/; + +} + + + + + + + diff --git a/lib/channel-access-token/model/issueChannelAccessTokenResponse.ts b/lib/channel-access-token/model/issueChannelAccessTokenResponse.ts index fba4717a3..2b02daf37 100644 --- a/lib/channel-access-token/model/issueChannelAccessTokenResponse.ts +++ b/lib/channel-access-token/model/issueChannelAccessTokenResponse.ts @@ -10,32 +10,45 @@ * Do not edit the class manually. */ + + + + + /** * Issued channel access token */ -export type IssueChannelAccessTokenResponse = { - /** - * Channel access token. - * - * @see accessToken Documentation - */ - accessToken: string /**/; - /** - * Amount of time in seconds from issue to expiration of the channel access token - * - * @see expiresIn Documentation - */ - expiresIn: number /**/; - /** - * A token type. - * - * @see tokenType Documentation - */ - tokenType: string /* = 'Bearer'*/; - /** - * Unique key ID for identifying the channel access token. - * - * @see keyId Documentation - */ - keyId: string /**/; -}; +export type IssueChannelAccessTokenResponse = { + /** + * Channel access token. + * + * @see accessToken Documentation + */ + 'accessToken': string/**/; + /** + * Amount of time in seconds from issue to expiration of the channel access token + * + * @see expiresIn Documentation + */ + 'expiresIn': number/**/; + /** + * A token type. + * + * @see tokenType Documentation + */ + 'tokenType': string/* = 'Bearer'*/; + /** + * Unique key ID for identifying the channel access token. + * + * @see keyId Documentation + */ + 'keyId': string/**/; + +} + + + + + + + diff --git a/lib/channel-access-token/model/issueShortLivedChannelAccessTokenResponse.ts b/lib/channel-access-token/model/issueShortLivedChannelAccessTokenResponse.ts index 86017ee8a..15ce93e10 100644 --- a/lib/channel-access-token/model/issueShortLivedChannelAccessTokenResponse.ts +++ b/lib/channel-access-token/model/issueShortLivedChannelAccessTokenResponse.ts @@ -10,26 +10,39 @@ * Do not edit the class manually. */ + + + + + /** * Issued short-lived channel access token */ -export type IssueShortLivedChannelAccessTokenResponse = { - /** - * A short-lived channel access token. Valid for 30 days. Note: Channel access tokens cannot be refreshed. - * - * @see accessToken Documentation - */ - accessToken: string /**/; - /** - * Time until channel access token expires in seconds from time the token is issued. - * - * @see expiresIn Documentation - */ - expiresIn: number /**/; - /** - * Token type. The value is always `Bearer`. - * - * @see tokenType Documentation - */ - tokenType: string /* = 'Bearer'*/; -}; +export type IssueShortLivedChannelAccessTokenResponse = { + /** + * A short-lived channel access token. Valid for 30 days. Note: Channel access tokens cannot be refreshed. + * + * @see accessToken Documentation + */ + 'accessToken': string/**/; + /** + * Time until channel access token expires in seconds from time the token is issued. + * + * @see expiresIn Documentation + */ + 'expiresIn': number/**/; + /** + * Token type. The value is always `Bearer`. + * + * @see tokenType Documentation + */ + 'tokenType': string/* = 'Bearer'*/; + +} + + + + + + + diff --git a/lib/channel-access-token/model/issueStatelessChannelAccessTokenResponse.ts b/lib/channel-access-token/model/issueStatelessChannelAccessTokenResponse.ts index 3a5e1430d..5278db9ad 100644 --- a/lib/channel-access-token/model/issueStatelessChannelAccessTokenResponse.ts +++ b/lib/channel-access-token/model/issueStatelessChannelAccessTokenResponse.ts @@ -10,26 +10,39 @@ * Do not edit the class manually. */ + + + + + /** * Issued stateless channel access token */ -export type IssueStatelessChannelAccessTokenResponse = { - /** - * A stateless channel access token. The token is an opaque string which means its format is an implementation detail and the consumer of this token should never try to use the data parsed from the token. - * - * @see accessToken Documentation - */ - accessToken: string /**/; - /** - * Duration in seconds after which the issued access token expires - * - * @see expiresIn Documentation - */ - expiresIn: number /**/; - /** - * Token type. The value is always `Bearer`. - * - * @see tokenType Documentation - */ - tokenType: string /* = 'Bearer'*/; -}; +export type IssueStatelessChannelAccessTokenResponse = { + /** + * A stateless channel access token. The token is an opaque string which means its format is an implementation detail and the consumer of this token should never try to use the data parsed from the token. + * + * @see accessToken Documentation + */ + 'accessToken': string/**/; + /** + * Duration in seconds after which the issued access token expires + * + * @see expiresIn Documentation + */ + 'expiresIn': number/**/; + /** + * Token type. The value is always `Bearer`. + * + * @see tokenType Documentation + */ + 'tokenType': string/* = 'Bearer'*/; + +} + + + + + + + diff --git a/lib/channel-access-token/model/models.ts b/lib/channel-access-token/model/models.ts index 5307ff1da..7a29150e2 100644 --- a/lib/channel-access-token/model/models.ts +++ b/lib/channel-access-token/model/models.ts @@ -1,6 +1,2 @@ -export * from "./channelAccessTokenKeyIdsResponse"; -export * from "./errorResponse"; -export * from "./issueChannelAccessTokenResponse"; -export * from "./issueShortLivedChannelAccessTokenResponse"; -export * from "./issueStatelessChannelAccessTokenResponse"; -export * from "./verifyChannelAccessTokenResponse"; + +export * from './channelAccessTokenKeyIdsResponse.js';export * from './errorResponse.js';export * from './issueChannelAccessTokenResponse.js';export * from './issueShortLivedChannelAccessTokenResponse.js';export * from './issueStatelessChannelAccessTokenResponse.js';export * from './verifyChannelAccessTokenResponse.js'; diff --git a/lib/channel-access-token/model/verifyChannelAccessTokenResponse.ts b/lib/channel-access-token/model/verifyChannelAccessTokenResponse.ts index 13ce3d571..ca47896d1 100644 --- a/lib/channel-access-token/model/verifyChannelAccessTokenResponse.ts +++ b/lib/channel-access-token/model/verifyChannelAccessTokenResponse.ts @@ -10,20 +10,33 @@ * Do not edit the class manually. */ + + + + + /** * Verification result */ -export type VerifyChannelAccessTokenResponse = { - /** - * The channel ID for which the channel access token was issued. - */ - clientId: string /**/; - /** - * Number of seconds before the channel access token expires. - */ - expiresIn: number /**/; - /** - * Permissions granted to the channel access token. - */ - scope?: string /**/; -}; +export type VerifyChannelAccessTokenResponse = { + /** + * The channel ID for which the channel access token was issued. + */ + 'clientId': string/**/; + /** + * Number of seconds before the channel access token expires. + */ + 'expiresIn': number/**/; + /** + * Permissions granted to the channel access token. + */ + 'scope'?: string/**/; + +} + + + + + + + diff --git a/lib/channel-access-token/tests/api/ChannelAccessTokenClientTest.spec.ts b/lib/channel-access-token/tests/api/ChannelAccessTokenClientTest.spec.ts index 60e555bac..96bfb7d44 100644 --- a/lib/channel-access-token/tests/api/ChannelAccessTokenClientTest.spec.ts +++ b/lib/channel-access-token/tests/api/ChannelAccessTokenClientTest.spec.ts @@ -1,20 +1,33 @@ -import { ChannelAccessTokenClient } from "../../api"; -import { ChannelAccessTokenKeyIdsResponse } from "../../model/channelAccessTokenKeyIdsResponse"; -import { ErrorResponse } from "../../model/errorResponse"; -import { IssueChannelAccessTokenResponse } from "../../model/issueChannelAccessTokenResponse"; -import { IssueShortLivedChannelAccessTokenResponse } from "../../model/issueShortLivedChannelAccessTokenResponse"; -import { IssueStatelessChannelAccessTokenResponse } from "../../model/issueStatelessChannelAccessTokenResponse"; -import { VerifyChannelAccessTokenResponse } from "../../model/verifyChannelAccessTokenResponse"; + +import { ChannelAccessTokenClient } from "../../api.js"; + +import { ChannelAccessTokenKeyIdsResponse } from '../../model/channelAccessTokenKeyIdsResponse.js'; +import { ErrorResponse } from '../../model/errorResponse.js'; +import { IssueChannelAccessTokenResponse } from '../../model/issueChannelAccessTokenResponse.js'; +import { IssueShortLivedChannelAccessTokenResponse } from '../../model/issueShortLivedChannelAccessTokenResponse.js'; +import { IssueStatelessChannelAccessTokenResponse } from '../../model/issueStatelessChannelAccessTokenResponse.js'; +import { VerifyChannelAccessTokenResponse } from '../../model/verifyChannelAccessTokenResponse.js'; + import { createServer } from "node:http"; import { deepEqual, equal, ok } from "node:assert"; -const pkg = require("../../../../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../../../../package.json"); const channel_access_token = "test_channel_access_token"; + + + + describe("ChannelAccessTokenClient", () => { + + + + it("getsAllValidChannelAccessTokenKeyIdsWithHttpInfo", async () => { let requestCount = 0; @@ -23,61 +36,73 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/oauth2/v2.1/tokens/kid" - .replace("{clientAssertionType}", "DUMMY") // string - .replace("{clientAssertion}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/oauth2/v2.1/tokens/kid" + .replace("{clientAssertionType}", "DUMMY") // string + .replace("{clientAssertion}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("clientAssertionType"), - String( - // clientAssertionType: string - "DUMMY" as unknown as string, // paramName=clientAssertionType(enum) - ), - ); - equal( - queryParams.get("clientAssertion"), - String( - // clientAssertion: string - "DUMMY" as unknown as string, // paramName=clientAssertion(enum) - ), - ); + equal(queryParams.get("clientAssertionType"), String( + + // clientAssertionType: string + "DUMMY" as unknown as string, // paramName=clientAssertionType(enum) + )); + equal(queryParams.get("clientAssertion"), String( - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // clientAssertion: string + "DUMMY" as unknown as string, // paramName=clientAssertion(enum) + )); + + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getsAllValidChannelAccessTokenKeyIdsWithHttpInfo( - // clientAssertionType: string - "DUMMY" as unknown as string, // paramName=clientAssertionType(enum) - // clientAssertion: string - "DUMMY" as unknown as string, // paramName=clientAssertion(enum) + + // clientAssertionType: string + "DUMMY" as unknown as string, // paramName=clientAssertionType(enum) + + + + // clientAssertion: string + "DUMMY" as unknown as string, // paramName=clientAssertion(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getsAllValidChannelAccessTokenKeyIds", async () => { let requestCount = 0; @@ -86,61 +111,74 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/oauth2/v2.1/tokens/kid" - .replace("{clientAssertionType}", "DUMMY") // string - .replace("{clientAssertion}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/oauth2/v2.1/tokens/kid" + .replace("{clientAssertionType}", "DUMMY") // string + .replace("{clientAssertion}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("clientAssertionType"), - String( - // clientAssertionType: string - "DUMMY" as unknown as string, // paramName=clientAssertionType(enum) - ), - ); - equal( - queryParams.get("clientAssertion"), - String( - // clientAssertion: string - "DUMMY" as unknown as string, // paramName=clientAssertion(enum) - ), - ); + equal(queryParams.get("clientAssertionType"), String( + + // clientAssertionType: string + "DUMMY" as unknown as string, // paramName=clientAssertionType(enum) + )); + equal(queryParams.get("clientAssertion"), String( - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // clientAssertion: string + "DUMMY" as unknown as string, // paramName=clientAssertion(enum) + )); + + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getsAllValidChannelAccessTokenKeyIds( - // clientAssertionType: string - "DUMMY" as unknown as string, // paramName=clientAssertionType(enum) - // clientAssertion: string - "DUMMY" as unknown as string, // paramName=clientAssertion(enum) + + // clientAssertionType: string + "DUMMY" as unknown as string, // paramName=clientAssertionType(enum) + + + + // clientAssertion: string + "DUMMY" as unknown as string, // paramName=clientAssertion(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("issueChannelTokenWithHttpInfo", async () => { let requestCount = 0; @@ -149,48 +187,65 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/oauth/accessToken" - .replace("{grantType}", "DUMMY") // string - .replace("{clientId}", "DUMMY") // string - .replace("{clientSecret}", "DUMMY"), // string + equal(reqUrl.pathname, "/v2/oauth/accessToken" + .replace("{grantType}", "DUMMY") // string + .replace("{clientId}", "DUMMY") // string + .replace("{clientSecret}", "DUMMY") // string + + ); + + + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.issueChannelTokenWithHttpInfo( - // grantType: string - "DUMMY", // grantType(string) - // clientId: string - "DUMMY", // clientId(string) - // clientSecret: string - "DUMMY", // clientSecret(string) + // grantType: string + "DUMMY", // grantType(string) + + + + // clientId: string + "DUMMY", // clientId(string) + + + + // clientSecret: string + "DUMMY", // clientSecret(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("issueChannelToken", async () => { let requestCount = 0; @@ -199,48 +254,66 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/oauth/accessToken" - .replace("{grantType}", "DUMMY") // string - .replace("{clientId}", "DUMMY") // string - .replace("{clientSecret}", "DUMMY"), // string + equal(reqUrl.pathname, "/v2/oauth/accessToken" + .replace("{grantType}", "DUMMY") // string + .replace("{clientId}", "DUMMY") // string + .replace("{clientSecret}", "DUMMY") // string + + ); + + + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.issueChannelToken( - // grantType: string - "DUMMY", // grantType(string) - // clientId: string - "DUMMY", // clientId(string) - // clientSecret: string - "DUMMY", // clientSecret(string) + // grantType: string + "DUMMY", // grantType(string) + + + + // clientId: string + "DUMMY", // clientId(string) + + + + // clientSecret: string + "DUMMY", // clientSecret(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("issueChannelTokenByJWTWithHttpInfo", async () => { let requestCount = 0; @@ -249,48 +322,65 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/oauth2/v2.1/token" - .replace("{grantType}", "DUMMY") // string - .replace("{clientAssertionType}", "DUMMY") // string - .replace("{clientAssertion}", "DUMMY"), // string + equal(reqUrl.pathname, "/oauth2/v2.1/token" + .replace("{grantType}", "DUMMY") // string + .replace("{clientAssertionType}", "DUMMY") // string + .replace("{clientAssertion}", "DUMMY") // string + + ); + + + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.issueChannelTokenByJWTWithHttpInfo( - // grantType: string - "DUMMY", // grantType(string) - // clientAssertionType: string - "DUMMY", // clientAssertionType(string) - // clientAssertion: string - "DUMMY", // clientAssertion(string) + // grantType: string + "DUMMY", // grantType(string) + + + + // clientAssertionType: string + "DUMMY", // clientAssertionType(string) + + + + // clientAssertion: string + "DUMMY", // clientAssertion(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("issueChannelTokenByJWT", async () => { let requestCount = 0; @@ -299,48 +389,66 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/oauth2/v2.1/token" - .replace("{grantType}", "DUMMY") // string - .replace("{clientAssertionType}", "DUMMY") // string - .replace("{clientAssertion}", "DUMMY"), // string + equal(reqUrl.pathname, "/oauth2/v2.1/token" + .replace("{grantType}", "DUMMY") // string + .replace("{clientAssertionType}", "DUMMY") // string + .replace("{clientAssertion}", "DUMMY") // string + + ); + + + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.issueChannelTokenByJWT( - // grantType: string - "DUMMY", // grantType(string) - // clientAssertionType: string - "DUMMY", // clientAssertionType(string) - // clientAssertion: string - "DUMMY", // clientAssertion(string) + // grantType: string + "DUMMY", // grantType(string) + + + + // clientAssertionType: string + "DUMMY", // clientAssertionType(string) + + + + // clientAssertion: string + "DUMMY", // clientAssertion(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("issueStatelessChannelTokenWithHttpInfo", async () => { let requestCount = 0; @@ -349,56 +457,77 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/oauth2/v3/token" - .replace("{grantType}", "DUMMY") // string - .replace("{clientAssertionType}", "DUMMY") // string - .replace("{clientAssertion}", "DUMMY") // string - .replace("{clientId}", "DUMMY") // string - .replace("{clientSecret}", "DUMMY"), // string + equal(reqUrl.pathname, "/oauth2/v3/token" + .replace("{grantType}", "DUMMY") // string + .replace("{clientAssertionType}", "DUMMY") // string + .replace("{clientAssertion}", "DUMMY") // string + .replace("{clientId}", "DUMMY") // string + .replace("{clientSecret}", "DUMMY") // string + + ); + + + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.issueStatelessChannelTokenWithHttpInfo( - // grantType: string - "DUMMY" as unknown as string, // paramName=grantType(enum) - // clientAssertionType: string - "DUMMY" as unknown as string, // paramName=clientAssertionType(enum) - // clientAssertion: string - "DUMMY", // clientAssertion(string) + // grantType: string + "DUMMY" as unknown as string, // paramName=grantType(enum) + + - // clientId: string - "DUMMY", // clientId(string) + // clientAssertionType: string + "DUMMY" as unknown as string, // paramName=clientAssertionType(enum) + + + + // clientAssertion: string + "DUMMY", // clientAssertion(string) + + + + // clientId: string + "DUMMY", // clientId(string) + + + + // clientSecret: string + "DUMMY", // clientSecret(string) + - // clientSecret: string - "DUMMY", // clientSecret(string) ); equal(requestCount, 1); server.close(); }); + + + + it("issueStatelessChannelToken", async () => { let requestCount = 0; @@ -407,56 +536,78 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/oauth2/v3/token" - .replace("{grantType}", "DUMMY") // string - .replace("{clientAssertionType}", "DUMMY") // string - .replace("{clientAssertion}", "DUMMY") // string - .replace("{clientId}", "DUMMY") // string - .replace("{clientSecret}", "DUMMY"), // string + equal(reqUrl.pathname, "/oauth2/v3/token" + .replace("{grantType}", "DUMMY") // string + .replace("{clientAssertionType}", "DUMMY") // string + .replace("{clientAssertion}", "DUMMY") // string + .replace("{clientId}", "DUMMY") // string + .replace("{clientSecret}", "DUMMY") // string + + ); + + + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.issueStatelessChannelToken( - // grantType: string - "DUMMY" as unknown as string, // paramName=grantType(enum) - // clientAssertionType: string - "DUMMY" as unknown as string, // paramName=clientAssertionType(enum) - // clientAssertion: string - "DUMMY", // clientAssertion(string) + // grantType: string + "DUMMY" as unknown as string, // paramName=grantType(enum) + + - // clientId: string - "DUMMY", // clientId(string) + // clientAssertionType: string + "DUMMY" as unknown as string, // paramName=clientAssertionType(enum) + + + + // clientAssertion: string + "DUMMY", // clientAssertion(string) + + + + // clientId: string + "DUMMY", // clientId(string) + + + + // clientSecret: string + "DUMMY", // clientSecret(string) + - // clientSecret: string - "DUMMY", // clientSecret(string) ); equal(requestCount, 1); server.close(); }); + + + + + it("revokeChannelTokenWithHttpInfo", async () => { let requestCount = 0; @@ -465,39 +616,53 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/oauth/revoke".replace("{accessToken}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/oauth/revoke" + .replace("{accessToken}", "DUMMY") // string + + ); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.revokeChannelTokenWithHttpInfo( - // accessToken: string - "DUMMY", // accessToken(string) + + + // accessToken: string + "DUMMY", // accessToken(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("revokeChannelToken", async () => { let requestCount = 0; @@ -506,39 +671,54 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/oauth/revoke".replace("{accessToken}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/oauth/revoke" + .replace("{accessToken}", "DUMMY") // string + + ); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.revokeChannelToken( - // accessToken: string - "DUMMY", // accessToken(string) + + + // accessToken: string + "DUMMY", // accessToken(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("revokeChannelTokenByJWTWithHttpInfo", async () => { let requestCount = 0; @@ -547,48 +727,65 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/oauth2/v2.1/revoke" - .replace("{clientId}", "DUMMY") // string - .replace("{clientSecret}", "DUMMY") // string - .replace("{accessToken}", "DUMMY"), // string + equal(reqUrl.pathname, "/oauth2/v2.1/revoke" + .replace("{clientId}", "DUMMY") // string + .replace("{clientSecret}", "DUMMY") // string + .replace("{accessToken}", "DUMMY") // string + + ); + + + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.revokeChannelTokenByJWTWithHttpInfo( - // clientId: string - "DUMMY", // clientId(string) - // clientSecret: string - "DUMMY", // clientSecret(string) - // accessToken: string - "DUMMY", // accessToken(string) + // clientId: string + "DUMMY", // clientId(string) + + + + // clientSecret: string + "DUMMY", // clientSecret(string) + + + + // accessToken: string + "DUMMY", // accessToken(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("revokeChannelTokenByJWT", async () => { let requestCount = 0; @@ -597,48 +794,66 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/oauth2/v2.1/revoke" - .replace("{clientId}", "DUMMY") // string - .replace("{clientSecret}", "DUMMY") // string - .replace("{accessToken}", "DUMMY"), // string + equal(reqUrl.pathname, "/oauth2/v2.1/revoke" + .replace("{clientId}", "DUMMY") // string + .replace("{clientSecret}", "DUMMY") // string + .replace("{accessToken}", "DUMMY") // string + + ); + + + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.revokeChannelTokenByJWT( - // clientId: string - "DUMMY", // clientId(string) - // clientSecret: string - "DUMMY", // clientSecret(string) - // accessToken: string - "DUMMY", // accessToken(string) + // clientId: string + "DUMMY", // clientId(string) + + + + // clientSecret: string + "DUMMY", // clientSecret(string) + + + + // accessToken: string + "DUMMY", // accessToken(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("verifyChannelTokenWithHttpInfo", async () => { let requestCount = 0; @@ -647,39 +862,53 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/oauth/verify".replace("{accessToken}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/oauth/verify" + .replace("{accessToken}", "DUMMY") // string + + ); + - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.verifyChannelTokenWithHttpInfo( - // accessToken: string - "DUMMY", // accessToken(string) + + + // accessToken: string + "DUMMY", // accessToken(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("verifyChannelToken", async () => { let requestCount = 0; @@ -688,39 +917,54 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/oauth/verify".replace("{accessToken}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/oauth/verify" + .replace("{accessToken}", "DUMMY") // string + + ); + - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.verifyChannelToken( - // accessToken: string - "DUMMY", // accessToken(string) + + + // accessToken: string + "DUMMY", // accessToken(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("verifyChannelTokenByJWTWithHttpInfo", async () => { let requestCount = 0; @@ -729,49 +973,62 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/oauth2/v2.1/verify".replace("{accessToken}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/oauth2/v2.1/verify" + .replace("{accessToken}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("accessToken"), - String( - // accessToken: string - "DUMMY" as unknown as string, // paramName=accessToken(enum) - ), - ); + equal(queryParams.get("accessToken"), String( - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // accessToken: string + "DUMMY" as unknown as string, // paramName=accessToken(enum) + )); + + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.verifyChannelTokenByJWTWithHttpInfo( - // accessToken: string - "DUMMY" as unknown as string, // paramName=accessToken(enum) + + + // accessToken: string + "DUMMY" as unknown as string, // paramName=accessToken(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("verifyChannelTokenByJWT", async () => { let requestCount = 0; @@ -780,46 +1037,58 @@ describe("ChannelAccessTokenClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/oauth2/v2.1/verify".replace("{accessToken}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/oauth2/v2.1/verify" + .replace("{accessToken}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("accessToken"), - String( - // accessToken: string - "DUMMY" as unknown as string, // paramName=accessToken(enum) - ), - ); + equal(queryParams.get("accessToken"), String( - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // accessToken: string + "DUMMY" as unknown as string, // paramName=accessToken(enum) + )); + + + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ChannelAccessTokenClient({ - baseURL: `http://localhost:${String(serverAddress.port)}/`, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.verifyChannelTokenByJWT( - // accessToken: string - "DUMMY" as unknown as string, // paramName=accessToken(enum) + + + // accessToken: string + "DUMMY" as unknown as string, // paramName=accessToken(enum) + + ); equal(requestCount, 1); server.close(); }); + + + }); diff --git a/lib/client.ts b/lib/client.ts index 549112858..7638f2631 100644 --- a/lib/client.ts +++ b/lib/client.ts @@ -1,14 +1,14 @@ import { Readable } from "node:stream"; -import HTTPClient from "./http-axios"; -import * as Types from "./types"; +import HTTPClient from "./http-axios.js"; +import * as Types from "./types.js"; import { AxiosRequestConfig, AxiosResponse } from "axios"; -import { createMultipartFormData, ensureJSON, toArray } from "./utils"; +import { createMultipartFormData, ensureJSON, toArray } from "./utils.js"; import { DATA_API_PREFIX, MESSAGING_API_PREFIX, OAUTH_BASE_PREFIX, OAUTH_BASE_PREFIX_V2_1, -} from "./endpoints"; +} from "./endpoints.js"; type ChatType = "group" | "room"; type RequestOption = { diff --git a/lib/http-axios.ts b/lib/http-axios.ts index 9a3f8a5d7..b2d7c12ef 100644 --- a/lib/http-axios.ts +++ b/lib/http-axios.ts @@ -5,9 +5,11 @@ import axios, { AxiosRequestConfig, } from "axios"; import { Readable } from "node:stream"; -import { HTTPError, ReadError, RequestError } from "./exceptions"; +import { HTTPError, ReadError, RequestError } from "./exceptions.js"; -const pkg = require("../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../package.json"); interface httpClientConfig extends Partial { baseURL?: string; diff --git a/lib/http-fetch.ts b/lib/http-fetch.ts index ab290800e..8eb382c8b 100644 --- a/lib/http-fetch.ts +++ b/lib/http-fetch.ts @@ -1,7 +1,10 @@ import { Readable } from "node:stream"; -import { HTTPFetchError } from "./exceptions"; +import { HTTPFetchError } from "./exceptions.js"; + +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../package.json"); -const pkg = require("../package.json"); export interface FetchRequestConfig { headers?: Record; } diff --git a/lib/index.ts b/lib/index.ts index b4b58ebba..d0afe5476 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,29 +1,29 @@ -import Client, { OAuth } from "./client"; -import middleware from "./middleware"; -import validateSignature from "./validate-signature"; +import Client, { OAuth } from "./client.js"; +import middleware from "./middleware.js"; +import validateSignature from "./validate-signature.js"; export { Client, middleware, validateSignature, OAuth }; // re-export exceptions and types -export * from "./exceptions"; -export * from "./types"; +export * from "./exceptions.js"; +export * from "./types.js"; -import * as channelAccessToken from "./channel-access-token/api"; +import * as channelAccessToken from "./channel-access-token/api.js"; export { channelAccessToken }; -import * as insight from "./insight/api"; +import * as insight from "./insight/api.js"; export { insight }; -import * as liff from "./liff/api"; +import * as liff from "./liff/api.js"; export { liff }; -import * as manageAudience from "./manage-audience/api"; +import * as manageAudience from "./manage-audience/api.js"; export { manageAudience }; -import * as messagingApi from "./messaging-api/api"; +import * as messagingApi from "./messaging-api/api.js"; export { messagingApi }; // Note: `module` is reserved word in Javascript. -import * as moduleOperation from "./module/api"; +import * as moduleOperation from "./module/api.js"; export { moduleOperation }; -import * as moduleAttach from "./module-attach/api"; +import * as moduleAttach from "./module-attach/api.js"; export { moduleAttach }; -import * as shop from "./shop/api"; +import * as shop from "./shop/api.js"; export { shop }; -import * as webhook from "./webhook/api"; +import * as webhook from "./webhook/api.js"; export { webhook }; diff --git a/lib/insight/api.ts b/lib/insight/api.ts index eeedcdab6..048a59bd5 100644 --- a/lib/insight/api.ts +++ b/lib/insight/api.ts @@ -1,3 +1,3 @@ // This is the entrypoint for the package -export * from "./api/apis"; -export * from "./model/models"; +export * from './api/apis.js'; +export * from './model/models.js'; diff --git a/lib/insight/api/apis.ts b/lib/insight/api/apis.ts index 7dcb8689e..221057f5b 100644 --- a/lib/insight/api/apis.ts +++ b/lib/insight/api/apis.ts @@ -1 +1,3 @@ -export { InsightClient } from "./insightClient"; + +export { InsightClient } from './insightClient.js'; + diff --git a/lib/insight/api/insightClient.ts b/lib/insight/api/insightClient.ts index 4fa804762..2ac2de7b3 100644 --- a/lib/insight/api/insightClient.ts +++ b/lib/insight/api/insightClient.ts @@ -1,3 +1,5 @@ + + /** * LINE Messaging API(Insight) * This document describes LINE Messaging API(Insight). @@ -10,246 +12,288 @@ * Do not edit the class manually. */ + /* tslint:disable:no-unused-locals */ -import { GetFriendsDemographicsResponse } from "../model/getFriendsDemographicsResponse"; -import { GetMessageEventResponse } from "../model/getMessageEventResponse"; -import { GetNumberOfFollowersResponse } from "../model/getNumberOfFollowersResponse"; -import { GetNumberOfMessageDeliveriesResponse } from "../model/getNumberOfMessageDeliveriesResponse"; -import { GetStatisticsPerUnitResponse } from "../model/getStatisticsPerUnitResponse"; +import { GetFriendsDemographicsResponse } from '../model/getFriendsDemographicsResponse.js'; +import { GetMessageEventResponse } from '../model/getMessageEventResponse.js'; +import { GetNumberOfFollowersResponse } from '../model/getNumberOfFollowersResponse.js'; +import { GetNumberOfMessageDeliveriesResponse } from '../model/getNumberOfMessageDeliveriesResponse.js'; +import { GetStatisticsPerUnitResponse } from '../model/getStatisticsPerUnitResponse.js'; -import * as Types from "../../types"; -import { ensureJSON } from "../../utils"; -import { Readable } from "node:stream"; +import * as Types from "../../types.js"; +import {ensureJSON} from "../../utils.js"; +import {Readable} from "node:stream"; -import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch"; +import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch.js"; // =============================================== // This file is autogenerated - Please do not edit // =============================================== interface httpClientConfig { - baseURL?: string; - channelAccessToken: string; - // TODO support defaultHeaders? + baseURL?: string; + channelAccessToken: string; + // TODO support defaultHeaders? } + export class InsightClient { - private httpClient: HTTPFetchClient; + private httpClient: HTTPFetchClient; - constructor(config: httpClientConfig) { - if (!config.baseURL) { - config.baseURL = "https://api.line.me"; + constructor(config: httpClientConfig) { + if (!config.baseURL) { + config.baseURL = 'https://api.line.me'; + } + this.httpClient = new HTTPFetchClient({ + defaultHeaders: { + Authorization: "Bearer " + config.channelAccessToken, + }, + baseURL: config.baseURL, + }); } - this.httpClient = new HTTPFetchClient({ - defaultHeaders: { - Authorization: "Bearer " + config.channelAccessToken, - }, - baseURL: config.baseURL, - }); - } - - private async parseHTTPResponse(response: Response) { - const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; - let resBody: Record = { - ...(await response.json()), - }; - if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { - resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = response.headers.get( - LINE_REQUEST_ID_HTTP_HEADER_NAME, - ); + + private async parseHTTPResponse(response: Response) { + const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; + let resBody: Record = { + ...await response.json(), + }; + if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { + resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = + response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME); + } + return resBody; + } + +/** + * Retrieves the demographic attributes for a LINE Official Account\'s friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID). + * + * @see Documentation + */ + public async getFriendsDemographics() : Promise { + return (await this.getFriendsDemographicsWithHttpInfo()).body; } - return resBody; - } - - /** - * Retrieves the demographic attributes for a LINE Official Account\'s friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID). - * - * @see Documentation - */ - public async getFriendsDemographics(): Promise { - return (await this.getFriendsDemographicsWithHttpInfo()).body; - } - - /** - * Retrieves the demographic attributes for a LINE Official Account\'s friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID). . - * This method includes HttpInfo object to return additional information. - * - * @see Documentation - */ - public async getFriendsDemographicsWithHttpInfo(): Promise< - Types.ApiResponseType - > { - const res = await this.httpClient.get("/v2/bot/insight/demographic"); - return { httpResponse: res, body: await res.json() }; - } - /** - * Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. - * @summary Get user interaction statistics - * @param requestId Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. - * - * @see Get user interaction statistics Documentation - */ - public async getMessageEvent( - requestId: string, - ): Promise { - return (await this.getMessageEventWithHttpInfo(requestId)).body; - } - - /** - * Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. . - * This method includes HttpInfo object to return additional information. - * @summary Get user interaction statistics - * @param requestId Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. - * - * @see Get user interaction statistics Documentation - */ - public async getMessageEventWithHttpInfo( - requestId: string, - ): Promise> { + + /** + * Retrieves the demographic attributes for a LINE Official Account\'s friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID). . + * This method includes HttpInfo object to return additional information. + * + * @see Documentation + */ + public async getFriendsDemographicsWithHttpInfo() : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/insight/demographic" + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. + * @summary Get user interaction statistics + * @param requestId Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. + * + * @see Get user interaction statistics Documentation + */ + public async getMessageEvent(requestId: string, ) : Promise { + return (await this.getMessageEventWithHttpInfo(requestId, )).body; + } + + /** + * Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. . + * This method includes HttpInfo object to return additional information. + * @summary Get user interaction statistics + * @param requestId Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. + * + * @see Get user interaction statistics Documentation + */ + public async getMessageEventWithHttpInfo(requestId: string, ) : Promise> { + + + + const queryParams = { - requestId: requestId, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/insight/message/event", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Returns the number of users who have added the LINE Official Account on or before a specified date. - * @summary Get number of followers - * @param date Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 - * - * @see Get number of followers Documentation - */ - public async getNumberOfFollowers( - date?: string, - ): Promise { - return (await this.getNumberOfFollowersWithHttpInfo(date)).body; - } - - /** - * Returns the number of users who have added the LINE Official Account on or before a specified date. . - * This method includes HttpInfo object to return additional information. - * @summary Get number of followers - * @param date Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 - * - * @see Get number of followers Documentation - */ - public async getNumberOfFollowersWithHttpInfo( - date?: string, - ): Promise> { + "requestId": requestId, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/insight/message/event" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Returns the number of users who have added the LINE Official Account on or before a specified date. + * @summary Get number of followers + * @param date Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + * + * @see Get number of followers Documentation + */ + public async getNumberOfFollowers(date?: string, ) : Promise { + return (await this.getNumberOfFollowersWithHttpInfo(date, )).body; + } + + /** + * Returns the number of users who have added the LINE Official Account on or before a specified date. . + * This method includes HttpInfo object to return additional information. + * @summary Get number of followers + * @param date Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + * + * @see Get number of followers Documentation + */ + public async getNumberOfFollowersWithHttpInfo(date?: string, ) : Promise> { + + + + const queryParams = { - date: date, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/insight/followers", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Returns the number of messages sent from LINE Official Account on a specified day. - * @summary Get number of message deliveries - * @param date Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 - * - * @see Get number of message deliveries Documentation - */ - public async getNumberOfMessageDeliveries( - date: string, - ): Promise { - return (await this.getNumberOfMessageDeliveriesWithHttpInfo(date)).body; - } - - /** - * Returns the number of messages sent from LINE Official Account on a specified day. . - * This method includes HttpInfo object to return additional information. - * @summary Get number of message deliveries - * @param date Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 - * - * @see Get number of message deliveries Documentation - */ - public async getNumberOfMessageDeliveriesWithHttpInfo( - date: string, - ): Promise> { + "date": date, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/insight/followers" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Returns the number of messages sent from LINE Official Account on a specified day. + * @summary Get number of message deliveries + * @param date Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 + * + * @see Get number of message deliveries Documentation + */ + public async getNumberOfMessageDeliveries(date: string, ) : Promise { + return (await this.getNumberOfMessageDeliveriesWithHttpInfo(date, )).body; + } + + /** + * Returns the number of messages sent from LINE Official Account on a specified day. . + * This method includes HttpInfo object to return additional information. + * @summary Get number of message deliveries + * @param date Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 + * + * @see Get number of message deliveries Documentation + */ + public async getNumberOfMessageDeliveriesWithHttpInfo(date: string, ) : Promise> { + + + + const queryParams = { - date: date, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/insight/message/delivery", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. - * @param customAggregationUnit Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. - * @param from Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 - * @param to End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 - * - * @see Documentation - */ - public async getStatisticsPerUnit( - customAggregationUnit: string, - from: string, - to: string, - ): Promise { - return ( - await this.getStatisticsPerUnitWithHttpInfo( - customAggregationUnit, - from, - to, - ) - ).body; - } - - /** - * You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. . - * This method includes HttpInfo object to return additional information. - * @param customAggregationUnit Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. - * @param from Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 - * @param to End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 - * - * @see Documentation - */ - public async getStatisticsPerUnitWithHttpInfo( - customAggregationUnit: string, - from: string, - to: string, - ): Promise> { + "date": date, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/insight/message/delivery" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. + * @param customAggregationUnit Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. + * @param from Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 + * @param to End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 + * + * @see Documentation + */ + public async getStatisticsPerUnit(customAggregationUnit: string, from: string, to: string, ) : Promise { + return (await this.getStatisticsPerUnitWithHttpInfo(customAggregationUnit, from, to, )).body; + } + + /** + * You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. . + * This method includes HttpInfo object to return additional information. + * @param customAggregationUnit Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. + * @param from Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 + * @param to End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 + * + * @see Documentation + */ + public async getStatisticsPerUnitWithHttpInfo(customAggregationUnit: string, from: string, to: string, ) : Promise> { + + + + const queryParams = { - customAggregationUnit: customAggregationUnit, - from: from, - to: to, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/insight/message/event/aggregation", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } + "customAggregationUnit": customAggregationUnit, + "from": from, + "to": to, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/insight/message/event/aggregation" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } + } diff --git a/lib/insight/model/ageTile.ts b/lib/insight/model/ageTile.ts index f0407309f..73d2dde07 100644 --- a/lib/insight/model/ageTile.ts +++ b/lib/insight/model/ageTile.ts @@ -10,27 +10,46 @@ * Do not edit the class manually. */ -export type AgeTile = { - /** - * users\' age - */ - age?: AgeTile.AgeEnum /**/; - /** - * Percentage - */ - percentage?: number /**/; -}; + + + + +export type AgeTile = { + /** + * users\' age + */ + 'age'?: AgeTile.AgeEnum/**/; + /** + * Percentage + */ + 'percentage'?: number/**/; + +} + + + export namespace AgeTile { - export type AgeEnum = - | "from0to14" - | "from15to19" - | "from20to24" - | "from25to29" - | "from30to34" - | "from35to39" - | "from40to44" - | "from45to49" - | "from50" - | "unknown"; + export type AgeEnum = + 'from0to14' + | 'from15to19' + | 'from20to24' + | 'from25to29' + | 'from30to34' + | 'from35to39' + | 'from40to44' + | 'from45to49' + | 'from50' + | 'unknown' + + + ; + + + } + + + + + diff --git a/lib/insight/model/appTypeTile.ts b/lib/insight/model/appTypeTile.ts index 53de46d94..9f783d4cc 100644 --- a/lib/insight/model/appTypeTile.ts +++ b/lib/insight/model/appTypeTile.ts @@ -10,17 +10,39 @@ * Do not edit the class manually. */ -export type AppTypeTile = { - /** - * users\' OS - */ - appType?: AppTypeTile.AppTypeEnum /**/; - /** - * Percentage - */ - percentage?: number /**/; -}; + + + + +export type AppTypeTile = { + /** + * users\' OS + */ + 'appType'?: AppTypeTile.AppTypeEnum/**/; + /** + * Percentage + */ + 'percentage'?: number/**/; + +} + + + export namespace AppTypeTile { - export type AppTypeEnum = "ios" | "android" | "others"; + export type AppTypeEnum = + 'ios' + | 'android' + | 'others' + + + ; + + + } + + + + + diff --git a/lib/insight/model/areaTile.ts b/lib/insight/model/areaTile.ts index 8ae3ea5d6..02e64704d 100644 --- a/lib/insight/model/areaTile.ts +++ b/lib/insight/model/areaTile.ts @@ -10,13 +10,26 @@ * Do not edit the class manually. */ -export type AreaTile = { - /** - * users\' country and region - */ - area?: string /**/; - /** - * Percentage - */ - percentage?: number /**/; -}; + + + + + +export type AreaTile = { + /** + * users\' country and region + */ + 'area'?: string/**/; + /** + * Percentage + */ + 'percentage'?: number/**/; + +} + + + + + + + diff --git a/lib/insight/model/errorDetail.ts b/lib/insight/model/errorDetail.ts index a0929d4b0..fded5c6f6 100644 --- a/lib/insight/model/errorDetail.ts +++ b/lib/insight/model/errorDetail.ts @@ -10,13 +10,26 @@ * Do not edit the class manually. */ -export type ErrorDetail = { - /** - * Details of the error. Not included in the response under certain situations. - */ - message?: string /**/; - /** - * Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations. - */ - property?: string /**/; -}; + + + + + +export type ErrorDetail = { + /** + * Details of the error. Not included in the response under certain situations. + */ + 'message'?: string/**/; + /** + * Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations. + */ + 'property'?: string/**/; + +} + + + + + + + diff --git a/lib/insight/model/errorResponse.ts b/lib/insight/model/errorResponse.ts index 8f8c2546e..b51e184da 100644 --- a/lib/insight/model/errorResponse.ts +++ b/lib/insight/model/errorResponse.ts @@ -10,19 +10,30 @@ * Do not edit the class manually. */ -import { ErrorDetail } from "./errorDetail"; - -export type ErrorResponse = { - /** - * Message containing information about the error. - * - * @see message Documentation - */ - message: string /**/; - /** - * An array of error details. If the array is empty, this property will not be included in the response. - * - * @see details Documentation - */ - details?: Array /**/; -}; + + + import { ErrorDetail } from './errorDetail.js'; + + +export type ErrorResponse = { + /** + * Message containing information about the error. + * + * @see message Documentation + */ + 'message': string/**/; + /** + * An array of error details. If the array is empty, this property will not be included in the response. + * + * @see details Documentation + */ + 'details'?: Array/**/; + +} + + + + + + + diff --git a/lib/insight/model/genderTile.ts b/lib/insight/model/genderTile.ts index bc2790d92..8484a7fe2 100644 --- a/lib/insight/model/genderTile.ts +++ b/lib/insight/model/genderTile.ts @@ -10,17 +10,39 @@ * Do not edit the class manually. */ -export type GenderTile = { - /** - * users\' gender - */ - gender?: GenderTile.GenderEnum /**/; - /** - * Percentage - */ - percentage?: number /**/; -}; + + + + +export type GenderTile = { + /** + * users\' gender + */ + 'gender'?: GenderTile.GenderEnum/**/; + /** + * Percentage + */ + 'percentage'?: number/**/; + +} + + + export namespace GenderTile { - export type GenderEnum = "male" | "female" | "unknown"; + export type GenderEnum = + 'male' + | 'female' + | 'unknown' + + + ; + + + } + + + + + diff --git a/lib/insight/model/getFriendsDemographicsResponse.ts b/lib/insight/model/getFriendsDemographicsResponse.ts index 184a64518..a7c5d485b 100644 --- a/lib/insight/model/getFriendsDemographicsResponse.ts +++ b/lib/insight/model/getFriendsDemographicsResponse.ts @@ -10,50 +10,57 @@ * Do not edit the class manually. */ -import { AgeTile } from "./ageTile"; -import { AppTypeTile } from "./appTypeTile"; -import { AreaTile } from "./areaTile"; -import { GenderTile } from "./genderTile"; -import { SubscriptionPeriodTile } from "./subscriptionPeriodTile"; + + import { AgeTile } from './ageTile.js';import { AppTypeTile } from './appTypeTile.js';import { AreaTile } from './areaTile.js';import { GenderTile } from './genderTile.js';import { SubscriptionPeriodTile } from './subscriptionPeriodTile.js'; + + /** * Get friend demographics */ -export type GetFriendsDemographicsResponse = { - /** - * true if friend demographic information is available. - * - * @see available Documentation - */ - available?: boolean /**/; - /** - * Percentage per gender. - * - * @see genders Documentation - */ - genders?: Array /**/; - /** - * Percentage per age group. - * - * @see ages Documentation - */ - ages?: Array /**/; - /** - * Percentage per area. - * - * @see areas Documentation - */ - areas?: Array /**/; - /** - * Percentage by OS. - * - * @see appTypes Documentation - */ - appTypes?: Array /**/; - /** - * Percentage per friendship duration. - * - * @see subscriptionPeriods Documentation - */ - subscriptionPeriods?: Array /**/; -}; +export type GetFriendsDemographicsResponse = { + /** + * true if friend demographic information is available. + * + * @see available Documentation + */ + 'available'?: boolean/**/; + /** + * Percentage per gender. + * + * @see genders Documentation + */ + 'genders'?: Array/**/; + /** + * Percentage per age group. + * + * @see ages Documentation + */ + 'ages'?: Array/**/; + /** + * Percentage per area. + * + * @see areas Documentation + */ + 'areas'?: Array/**/; + /** + * Percentage by OS. + * + * @see appTypes Documentation + */ + 'appTypes'?: Array/**/; + /** + * Percentage per friendship duration. + * + * @see subscriptionPeriods Documentation + */ + 'subscriptionPeriods'?: Array/**/; + +} + + + + + + + diff --git a/lib/insight/model/getMessageEventResponse.ts b/lib/insight/model/getMessageEventResponse.ts index 6cad5465e..e6431d450 100644 --- a/lib/insight/model/getMessageEventResponse.ts +++ b/lib/insight/model/getMessageEventResponse.ts @@ -10,29 +10,38 @@ * Do not edit the class manually. */ -import { GetMessageEventResponseClick } from "./getMessageEventResponseClick"; -import { GetMessageEventResponseMessage } from "./getMessageEventResponseMessage"; -import { GetMessageEventResponseOverview } from "./getMessageEventResponseOverview"; + + import { GetMessageEventResponseClick } from './getMessageEventResponseClick.js';import { GetMessageEventResponseMessage } from './getMessageEventResponseMessage.js';import { GetMessageEventResponseOverview } from './getMessageEventResponseOverview.js'; + + /** * Statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. */ -export type GetMessageEventResponse = { - /** - * - * @see overview Documentation - */ - overview?: GetMessageEventResponseOverview /**/; - /** - * Array of information about individual message bubbles. - * - * @see messages Documentation - */ - messages?: Array /**/; - /** - * Array of information about opened URLs in the message. - * - * @see clicks Documentation - */ - clicks?: Array /**/; -}; +export type GetMessageEventResponse = { + /** + * + * @see overview Documentation + */ + 'overview'?: GetMessageEventResponseOverview/**/; + /** + * Array of information about individual message bubbles. + * + * @see messages Documentation + */ + 'messages'?: Array/**/; + /** + * Array of information about opened URLs in the message. + * + * @see clicks Documentation + */ + 'clicks'?: Array/**/; + +} + + + + + + + diff --git a/lib/insight/model/getMessageEventResponseClick.ts b/lib/insight/model/getMessageEventResponseClick.ts index 6b88508a2..069f60324 100644 --- a/lib/insight/model/getMessageEventResponseClick.ts +++ b/lib/insight/model/getMessageEventResponseClick.ts @@ -10,25 +10,38 @@ * Do not edit the class manually. */ -export type GetMessageEventResponseClick = { - /** - * The URL\'s serial number. - */ - seq?: number /**/; - /** - * URL. - */ - url?: string /**/; - /** - * Number of times the URL was opened. - */ - click?: number | null /**/; - /** - * Number of users that opened the URL. - */ - uniqueClick?: number | null /**/; - /** - * Number of users who opened this url through any link in the message. If a message contains two links to the same URL and a user opens both links, they\'re counted only once. - */ - uniqueClickOfRequest?: number | null /**/; -}; + + + + + +export type GetMessageEventResponseClick = { + /** + * The URL\'s serial number. + */ + 'seq'?: number/**/; + /** + * URL. + */ + 'url'?: string/**/; + /** + * Number of times the URL was opened. + */ + 'click'?: number | null/**/; + /** + * Number of users that opened the URL. + */ + 'uniqueClick'?: number | null/**/; + /** + * Number of users who opened this url through any link in the message. If a message contains two links to the same URL and a user opens both links, they\'re counted only once. + */ + 'uniqueClickOfRequest'?: number | null/**/; + +} + + + + + + + diff --git a/lib/insight/model/getMessageEventResponseMessage.ts b/lib/insight/model/getMessageEventResponseMessage.ts index 7696b28dc..8f012bf78 100644 --- a/lib/insight/model/getMessageEventResponseMessage.ts +++ b/lib/insight/model/getMessageEventResponseMessage.ts @@ -10,53 +10,66 @@ * Do not edit the class manually. */ -export type GetMessageEventResponseMessage = { - /** - * Bubble\'s serial number. - */ - seq?: number /**/; - /** - * Number of times the bubble was displayed. - */ - impression?: number | null /**/; - /** - * Number of times audio or video in the bubble started playing. - */ - mediaPlayed?: number | null /**/; - /** - * Number of times audio or video in the bubble started playing and was played 25% of the total time. - */ - mediaPlayed25Percent?: number | null /**/; - /** - * Number of times audio or video in the bubble started playing and was played 50% of the total time. - */ - mediaPlayed50Percent?: number | null /**/; - /** - * Number of times audio or video in the bubble started playing and was played 75% of the total time. - */ - mediaPlayed75Percent?: number | null /**/; - /** - * Number of times audio or video in the bubble started playing and was played 100% of the total time. - */ - mediaPlayed100Percent?: number | null /**/; - /** - * Number of users that started playing audio or video in the bubble. - */ - uniqueMediaPlayed?: number | null /**/; - /** - * Number of users that started playing audio or video in the bubble and played 25% of the total time. - */ - uniqueMediaPlayed25Percent?: number | null /**/; - /** - * Number of users that started playing audio or video in the bubble and played 50% of the total time. - */ - uniqueMediaPlayed50Percent?: number | null /**/; - /** - * Number of users that started playing audio or video in the bubble and played 75% of the total time. - */ - uniqueMediaPlayed75Percent?: number | null /**/; - /** - * Number of users that started playing audio or video in the bubble and played 100% of the total time. - */ - uniqueMediaPlayed100Percent?: number | null /**/; -}; + + + + + +export type GetMessageEventResponseMessage = { + /** + * Bubble\'s serial number. + */ + 'seq'?: number/**/; + /** + * Number of times the bubble was displayed. + */ + 'impression'?: number | null/**/; + /** + * Number of times audio or video in the bubble started playing. + */ + 'mediaPlayed'?: number | null/**/; + /** + * Number of times audio or video in the bubble started playing and was played 25% of the total time. + */ + 'mediaPlayed25Percent'?: number | null/**/; + /** + * Number of times audio or video in the bubble started playing and was played 50% of the total time. + */ + 'mediaPlayed50Percent'?: number | null/**/; + /** + * Number of times audio or video in the bubble started playing and was played 75% of the total time. + */ + 'mediaPlayed75Percent'?: number | null/**/; + /** + * Number of times audio or video in the bubble started playing and was played 100% of the total time. + */ + 'mediaPlayed100Percent'?: number | null/**/; + /** + * Number of users that started playing audio or video in the bubble. + */ + 'uniqueMediaPlayed'?: number | null/**/; + /** + * Number of users that started playing audio or video in the bubble and played 25% of the total time. + */ + 'uniqueMediaPlayed25Percent'?: number | null/**/; + /** + * Number of users that started playing audio or video in the bubble and played 50% of the total time. + */ + 'uniqueMediaPlayed50Percent'?: number | null/**/; + /** + * Number of users that started playing audio or video in the bubble and played 75% of the total time. + */ + 'uniqueMediaPlayed75Percent'?: number | null/**/; + /** + * Number of users that started playing audio or video in the bubble and played 100% of the total time. + */ + 'uniqueMediaPlayed100Percent'?: number | null/**/; + +} + + + + + + + diff --git a/lib/insight/model/getMessageEventResponseOverview.ts b/lib/insight/model/getMessageEventResponseOverview.ts index b1579fdc9..91c9f97ba 100644 --- a/lib/insight/model/getMessageEventResponseOverview.ts +++ b/lib/insight/model/getMessageEventResponseOverview.ts @@ -10,36 +10,49 @@ * Do not edit the class manually. */ + + + + + /** * Summary of message statistics. */ -export type GetMessageEventResponseOverview = { - /** - * Request ID. - */ - requestId?: string /**/; - /** - * UNIX timestamp for message delivery time in seconds. - */ - timestamp?: number /**/; - /** - * Number of messages delivered. This property shows values of less than 20. However, if all messages have not been sent, it will be null. - */ - delivered?: number /**/; - /** - * Number of users who opened the message, meaning they displayed at least 1 bubble. - */ - uniqueImpression?: number | null /**/; - /** - * Number of users who opened any URL in the message. - */ - uniqueClick?: number | null /**/; - /** - * Number of users who started playing any video or audio in the message. - */ - uniqueMediaPlayed?: number | null /**/; - /** - * Number of users who played the entirety of any video or audio in the message. - */ - uniqueMediaPlayed100Percent?: number | null /**/; -}; +export type GetMessageEventResponseOverview = { + /** + * Request ID. + */ + 'requestId'?: string/**/; + /** + * UNIX timestamp for message delivery time in seconds. + */ + 'timestamp'?: number/**/; + /** + * Number of messages delivered. This property shows values of less than 20. However, if all messages have not been sent, it will be null. + */ + 'delivered'?: number/**/; + /** + * Number of users who opened the message, meaning they displayed at least 1 bubble. + */ + 'uniqueImpression'?: number | null/**/; + /** + * Number of users who opened any URL in the message. + */ + 'uniqueClick'?: number | null/**/; + /** + * Number of users who started playing any video or audio in the message. + */ + 'uniqueMediaPlayed'?: number | null/**/; + /** + * Number of users who played the entirety of any video or audio in the message. + */ + 'uniqueMediaPlayed100Percent'?: number | null/**/; + +} + + + + + + + diff --git a/lib/insight/model/getNumberOfFollowersResponse.ts b/lib/insight/model/getNumberOfFollowersResponse.ts index 03fcc7c28..e52695ac3 100644 --- a/lib/insight/model/getNumberOfFollowersResponse.ts +++ b/lib/insight/model/getNumberOfFollowersResponse.ts @@ -10,36 +10,60 @@ * Do not edit the class manually. */ + + + + + /** * Get number of followers */ -export type GetNumberOfFollowersResponse = { - /** - * Calculation status. - * - * @see status Documentation - */ - status?: GetNumberOfFollowersResponse.StatusEnum /**/; - /** - * The number of times, as of the specified date, that a user added this LINE Official Account as a friend for the first time. The number doesn\'t decrease even if a user later blocks the account or when they delete their LINE account. - * - * @see followers Documentation - */ - followers?: number /**/; - /** - * The number of users, as of the specified date, that the LINE Official Account can reach through targeted messages based on gender, age, and/or region. This number only includes users who are active on LINE or LINE services and whose demographics have a high level of certainty. - * - * @see targetedReaches Documentation - */ - targetedReaches?: number /**/; - /** - * The number of users blocking the account as of the specified date. The number decreases when a user unblocks the account. - * - * @see blocks Documentation - */ - blocks?: number /**/; -}; +export type GetNumberOfFollowersResponse = { + /** + * Calculation status. + * + * @see status Documentation + */ + 'status'?: GetNumberOfFollowersResponse.StatusEnum/**/; + /** + * The number of times, as of the specified date, that a user added this LINE Official Account as a friend for the first time. The number doesn\'t decrease even if a user later blocks the account or when they delete their LINE account. + * + * @see followers Documentation + */ + 'followers'?: number/**/; + /** + * The number of users, as of the specified date, that the LINE Official Account can reach through targeted messages based on gender, age, and/or region. This number only includes users who are active on LINE or LINE services and whose demographics have a high level of certainty. + * + * @see targetedReaches Documentation + */ + 'targetedReaches'?: number/**/; + /** + * The number of users blocking the account as of the specified date. The number decreases when a user unblocks the account. + * + * @see blocks Documentation + */ + 'blocks'?: number/**/; + +} + + export namespace GetNumberOfFollowersResponse { - export type StatusEnum = "ready" | "unready" | "out_of_service"; + export type StatusEnum = + 'ready' + | 'unready' + | 'out_of_service' + + + ; + + + + + } + + + + + diff --git a/lib/insight/model/getNumberOfMessageDeliveriesResponse.ts b/lib/insight/model/getNumberOfMessageDeliveriesResponse.ts index e2c08cd0a..d468eec57 100644 --- a/lib/insight/model/getNumberOfMessageDeliveriesResponse.ts +++ b/lib/insight/model/getNumberOfMessageDeliveriesResponse.ts @@ -10,78 +10,109 @@ * Do not edit the class manually. */ + + + + + /** * Get number of message deliveries */ -export type GetNumberOfMessageDeliveriesResponse = { - /** - * Status of the counting process. - * - * @see status Documentation - */ - status?: GetNumberOfMessageDeliveriesResponse.StatusEnum /**/; - /** - * Number of messages sent to all of this LINE Official Account\'s friends (broadcast messages). - * - * @see broadcast Documentation - */ - broadcast?: number /**/; - /** - * Number of messages sent to some of this LINE Official Account\'s friends, based on specific attributes (targeted messages). - * - * @see targeting Documentation - */ - targeting?: number /**/; - /** - * Number of auto-response messages sent. - * - * @see autoResponse Documentation - */ - autoResponse?: number /**/; - /** - * Number of greeting messages sent. - * - * @see welcomeResponse Documentation - */ - welcomeResponse?: number /**/; - /** - * Number of messages sent from LINE Official Account Manager [Chat screen](https://www.linebiz.com/jp/manual/OfficialAccountManager/chats/) (only available in Japanese). - * - * @see chat Documentation - */ - chat?: number /**/; - /** - * Number of broadcast messages sent with the `Send broadcast message` Messaging API operation. - * - * @see apiBroadcast Documentation - */ - apiBroadcast?: number /**/; - /** - * Number of push messages sent with the `Send push message` Messaging API operation. - * - * @see apiPush Documentation - */ - apiPush?: number /**/; - /** - * Number of multicast messages sent with the `Send multicast message` Messaging API operation. - * - * @see apiMulticast Documentation - */ - apiMulticast?: number /**/; - /** - * Number of narrowcast messages sent with the `Send narrowcast message` Messaging API operation. - * - * @see apiNarrowcast Documentation - */ - apiNarrowcast?: number /**/; - /** - * Number of replies sent with the `Send reply message` Messaging API operation. - * - * @see apiReply Documentation - */ - apiReply?: number /**/; -}; +export type GetNumberOfMessageDeliveriesResponse = { + /** + * Status of the counting process. + * + * @see status Documentation + */ + 'status'?: GetNumberOfMessageDeliveriesResponse.StatusEnum/**/; + /** + * Number of messages sent to all of this LINE Official Account\'s friends (broadcast messages). + * + * @see broadcast Documentation + */ + 'broadcast'?: number/**/; + /** + * Number of messages sent to some of this LINE Official Account\'s friends, based on specific attributes (targeted messages). + * + * @see targeting Documentation + */ + 'targeting'?: number/**/; + /** + * Number of auto-response messages sent. + * + * @see autoResponse Documentation + */ + 'autoResponse'?: number/**/; + /** + * Number of greeting messages sent. + * + * @see welcomeResponse Documentation + */ + 'welcomeResponse'?: number/**/; + /** + * Number of messages sent from LINE Official Account Manager [Chat screen](https://www.linebiz.com/jp/manual/OfficialAccountManager/chats/) (only available in Japanese). + * + * @see chat Documentation + */ + 'chat'?: number/**/; + /** + * Number of broadcast messages sent with the `Send broadcast message` Messaging API operation. + * + * @see apiBroadcast Documentation + */ + 'apiBroadcast'?: number/**/; + /** + * Number of push messages sent with the `Send push message` Messaging API operation. + * + * @see apiPush Documentation + */ + 'apiPush'?: number/**/; + /** + * Number of multicast messages sent with the `Send multicast message` Messaging API operation. + * + * @see apiMulticast Documentation + */ + 'apiMulticast'?: number/**/; + /** + * Number of narrowcast messages sent with the `Send narrowcast message` Messaging API operation. + * + * @see apiNarrowcast Documentation + */ + 'apiNarrowcast'?: number/**/; + /** + * Number of replies sent with the `Send reply message` Messaging API operation. + * + * @see apiReply Documentation + */ + 'apiReply'?: number/**/; + +} + + export namespace GetNumberOfMessageDeliveriesResponse { - export type StatusEnum = "ready" | "unready" | "out_of_service"; + export type StatusEnum = + 'ready' + | 'unready' + | 'out_of_service' + + + ; + + + + + + + + + + + + } + + + + + diff --git a/lib/insight/model/getStatisticsPerUnitResponse.ts b/lib/insight/model/getStatisticsPerUnitResponse.ts index c901bb435..b0f6fce43 100644 --- a/lib/insight/model/getStatisticsPerUnitResponse.ts +++ b/lib/insight/model/getStatisticsPerUnitResponse.ts @@ -10,29 +10,38 @@ * Do not edit the class manually. */ -import { GetStatisticsPerUnitResponseClick } from "./getStatisticsPerUnitResponseClick"; -import { GetStatisticsPerUnitResponseMessage } from "./getStatisticsPerUnitResponseMessage"; -import { GetStatisticsPerUnitResponseOverview } from "./getStatisticsPerUnitResponseOverview"; + + import { GetStatisticsPerUnitResponseClick } from './getStatisticsPerUnitResponseClick.js';import { GetStatisticsPerUnitResponseMessage } from './getStatisticsPerUnitResponseMessage.js';import { GetStatisticsPerUnitResponseOverview } from './getStatisticsPerUnitResponseOverview.js'; + + /** * Response object for `get statistics per unit` */ -export type GetStatisticsPerUnitResponse = { - /** - * - * @see overview Documentation - */ - overview: GetStatisticsPerUnitResponseOverview /**/; - /** - * Array of information about individual message bubbles. - * - * @see messages Documentation - */ - messages: Array /**/; - /** - * Array of information about opened URLs in the message. - * - * @see clicks Documentation - */ - clicks: Array /**/; -}; +export type GetStatisticsPerUnitResponse = { + /** + * + * @see overview Documentation + */ + 'overview': GetStatisticsPerUnitResponseOverview/**/; + /** + * Array of information about individual message bubbles. + * + * @see messages Documentation + */ + 'messages': Array/**/; + /** + * Array of information about opened URLs in the message. + * + * @see clicks Documentation + */ + 'clicks': Array/**/; + +} + + + + + + + diff --git a/lib/insight/model/getStatisticsPerUnitResponseClick.ts b/lib/insight/model/getStatisticsPerUnitResponseClick.ts index beb19fa22..9708a379e 100644 --- a/lib/insight/model/getStatisticsPerUnitResponseClick.ts +++ b/lib/insight/model/getStatisticsPerUnitResponseClick.ts @@ -10,35 +10,48 @@ * Do not edit the class manually. */ -export type GetStatisticsPerUnitResponseClick = { - /** - * The URL\'s serial number. - * - * @see seq Documentation - */ - seq: number /**/; - /** - * URL. - * - * @see url Documentation - */ - url: string /**/; - /** - * Number of times the URL in the bubble was opened. - * - * @see click Documentation - */ - click?: number | null /**/; - /** - * Number of users that opened the URL in the bubble. - * - * @see uniqueClick Documentation - */ - uniqueClick?: number | null /**/; - /** - * Number of users who opened this url through any link in the message. If another message bubble contains the same URL and a user opens both links, it\'s counted only once. - * - * @see uniqueClickOfRequest Documentation - */ - uniqueClickOfRequest?: number | null /**/; -}; + + + + + +export type GetStatisticsPerUnitResponseClick = { + /** + * The URL\'s serial number. + * + * @see seq Documentation + */ + 'seq': number/**/; + /** + * URL. + * + * @see url Documentation + */ + 'url': string/**/; + /** + * Number of times the URL in the bubble was opened. + * + * @see click Documentation + */ + 'click'?: number | null/**/; + /** + * Number of users that opened the URL in the bubble. + * + * @see uniqueClick Documentation + */ + 'uniqueClick'?: number | null/**/; + /** + * Number of users who opened this url through any link in the message. If another message bubble contains the same URL and a user opens both links, it\'s counted only once. + * + * @see uniqueClickOfRequest Documentation + */ + 'uniqueClickOfRequest'?: number | null/**/; + +} + + + + + + + diff --git a/lib/insight/model/getStatisticsPerUnitResponseMessage.ts b/lib/insight/model/getStatisticsPerUnitResponseMessage.ts index 7e76760c3..2c74d44cd 100644 --- a/lib/insight/model/getStatisticsPerUnitResponseMessage.ts +++ b/lib/insight/model/getStatisticsPerUnitResponseMessage.ts @@ -10,83 +10,96 @@ * Do not edit the class manually. */ -export type GetStatisticsPerUnitResponseMessage = { - /** - * Bubble\'s serial number. - * - * @see seq Documentation - */ - seq: number /**/; - /** - * Number of times the bubble was displayed. - * - * @see impression Documentation - */ - impression?: number | null /**/; - /** - * Number of times audio or video in the bubble started playing. - * - * @see mediaPlayed Documentation - */ - mediaPlayed?: number | null /**/; - /** - * Number of times audio or video in the bubble started playing and was played 25% of the total time. - * - * @see mediaPlayed25Percent Documentation - */ - mediaPlayed25Percent?: number | null /**/; - /** - * Number of times audio or video in the bubble started playing and was played 50% of the total time. - * - * @see mediaPlayed50Percent Documentation - */ - mediaPlayed50Percent?: number | null /**/; - /** - * Number of times audio or video in the bubble started playing and was played 75% of the total time. - * - * @see mediaPlayed75Percent Documentation - */ - mediaPlayed75Percent?: number | null /**/; - /** - * Number of times audio or video in the bubble started playing and was played 100% of the total time. - * - * @see mediaPlayed100Percent Documentation - */ - mediaPlayed100Percent?: number | null /**/; - /** - * Number of users the bubble was displayed. - * - * @see uniqueImpression Documentation - */ - uniqueImpression?: number | null /**/; - /** - * Number of users that started playing audio or video in the bubble. - * - * @see uniqueMediaPlayed Documentation - */ - uniqueMediaPlayed?: number | null /**/; - /** - * Number of users that started playing audio or video in the bubble and played 25% of the total time. - * - * @see uniqueMediaPlayed25Percent Documentation - */ - uniqueMediaPlayed25Percent?: number | null /**/; - /** - * Number of users that started playing audio or video in the bubble and played 50% of the total time. - * - * @see uniqueMediaPlayed50Percent Documentation - */ - uniqueMediaPlayed50Percent?: number | null /**/; - /** - * Number of users that started playing audio or video in the bubble and played 75% of the total time. - * - * @see uniqueMediaPlayed75Percent Documentation - */ - uniqueMediaPlayed75Percent?: number | null /**/; - /** - * Number of users that started playing audio or video in the bubble and played 100% of the total time. - * - * @see uniqueMediaPlayed100Percent Documentation - */ - uniqueMediaPlayed100Percent?: number | null /**/; -}; + + + + + +export type GetStatisticsPerUnitResponseMessage = { + /** + * Bubble\'s serial number. + * + * @see seq Documentation + */ + 'seq': number/**/; + /** + * Number of times the bubble was displayed. + * + * @see impression Documentation + */ + 'impression'?: number | null/**/; + /** + * Number of times audio or video in the bubble started playing. + * + * @see mediaPlayed Documentation + */ + 'mediaPlayed'?: number | null/**/; + /** + * Number of times audio or video in the bubble started playing and was played 25% of the total time. + * + * @see mediaPlayed25Percent Documentation + */ + 'mediaPlayed25Percent'?: number | null/**/; + /** + * Number of times audio or video in the bubble started playing and was played 50% of the total time. + * + * @see mediaPlayed50Percent Documentation + */ + 'mediaPlayed50Percent'?: number | null/**/; + /** + * Number of times audio or video in the bubble started playing and was played 75% of the total time. + * + * @see mediaPlayed75Percent Documentation + */ + 'mediaPlayed75Percent'?: number | null/**/; + /** + * Number of times audio or video in the bubble started playing and was played 100% of the total time. + * + * @see mediaPlayed100Percent Documentation + */ + 'mediaPlayed100Percent'?: number | null/**/; + /** + * Number of users the bubble was displayed. + * + * @see uniqueImpression Documentation + */ + 'uniqueImpression'?: number | null/**/; + /** + * Number of users that started playing audio or video in the bubble. + * + * @see uniqueMediaPlayed Documentation + */ + 'uniqueMediaPlayed'?: number | null/**/; + /** + * Number of users that started playing audio or video in the bubble and played 25% of the total time. + * + * @see uniqueMediaPlayed25Percent Documentation + */ + 'uniqueMediaPlayed25Percent'?: number | null/**/; + /** + * Number of users that started playing audio or video in the bubble and played 50% of the total time. + * + * @see uniqueMediaPlayed50Percent Documentation + */ + 'uniqueMediaPlayed50Percent'?: number | null/**/; + /** + * Number of users that started playing audio or video in the bubble and played 75% of the total time. + * + * @see uniqueMediaPlayed75Percent Documentation + */ + 'uniqueMediaPlayed75Percent'?: number | null/**/; + /** + * Number of users that started playing audio or video in the bubble and played 100% of the total time. + * + * @see uniqueMediaPlayed100Percent Documentation + */ + 'uniqueMediaPlayed100Percent'?: number | null/**/; + +} + + + + + + + diff --git a/lib/insight/model/getStatisticsPerUnitResponseOverview.ts b/lib/insight/model/getStatisticsPerUnitResponseOverview.ts index cd79d911f..97472d58b 100644 --- a/lib/insight/model/getStatisticsPerUnitResponseOverview.ts +++ b/lib/insight/model/getStatisticsPerUnitResponseOverview.ts @@ -10,32 +10,45 @@ * Do not edit the class manually. */ + + + + + /** * Statistics related to messages. */ -export type GetStatisticsPerUnitResponseOverview = { - /** - * Number of users who opened the message, meaning they displayed at least 1 bubble. - * - * @see uniqueImpression Documentation - */ - uniqueImpression?: number | null /**/; - /** - * Number of users who opened any URL in the message. - * - * @see uniqueClick Documentation - */ - uniqueClick?: number | null /**/; - /** - * Number of users who started playing any video or audio in the message. - * - * @see uniqueMediaPlayed Documentation - */ - uniqueMediaPlayed?: number | null /**/; - /** - * Number of users who played the entirety of any video or audio in the message. - * - * @see uniqueMediaPlayed100Percent Documentation - */ - uniqueMediaPlayed100Percent?: number | null /**/; -}; +export type GetStatisticsPerUnitResponseOverview = { + /** + * Number of users who opened the message, meaning they displayed at least 1 bubble. + * + * @see uniqueImpression Documentation + */ + 'uniqueImpression'?: number | null/**/; + /** + * Number of users who opened any URL in the message. + * + * @see uniqueClick Documentation + */ + 'uniqueClick'?: number | null/**/; + /** + * Number of users who started playing any video or audio in the message. + * + * @see uniqueMediaPlayed Documentation + */ + 'uniqueMediaPlayed'?: number | null/**/; + /** + * Number of users who played the entirety of any video or audio in the message. + * + * @see uniqueMediaPlayed100Percent Documentation + */ + 'uniqueMediaPlayed100Percent'?: number | null/**/; + +} + + + + + + + diff --git a/lib/insight/model/models.ts b/lib/insight/model/models.ts index 86722e0e8..6682cae45 100644 --- a/lib/insight/model/models.ts +++ b/lib/insight/model/models.ts @@ -1,18 +1,2 @@ -export * from "./ageTile"; -export * from "./appTypeTile"; -export * from "./areaTile"; -export * from "./errorDetail"; -export * from "./errorResponse"; -export * from "./genderTile"; -export * from "./getFriendsDemographicsResponse"; -export * from "./getMessageEventResponse"; -export * from "./getMessageEventResponseClick"; -export * from "./getMessageEventResponseMessage"; -export * from "./getMessageEventResponseOverview"; -export * from "./getNumberOfFollowersResponse"; -export * from "./getNumberOfMessageDeliveriesResponse"; -export * from "./getStatisticsPerUnitResponse"; -export * from "./getStatisticsPerUnitResponseClick"; -export * from "./getStatisticsPerUnitResponseMessage"; -export * from "./getStatisticsPerUnitResponseOverview"; -export * from "./subscriptionPeriodTile"; + +export * from './ageTile.js';export * from './appTypeTile.js';export * from './areaTile.js';export * from './errorDetail.js';export * from './errorResponse.js';export * from './genderTile.js';export * from './getFriendsDemographicsResponse.js';export * from './getMessageEventResponse.js';export * from './getMessageEventResponseClick.js';export * from './getMessageEventResponseMessage.js';export * from './getMessageEventResponseOverview.js';export * from './getNumberOfFollowersResponse.js';export * from './getNumberOfMessageDeliveriesResponse.js';export * from './getStatisticsPerUnitResponse.js';export * from './getStatisticsPerUnitResponseClick.js';export * from './getStatisticsPerUnitResponseMessage.js';export * from './getStatisticsPerUnitResponseOverview.js';export * from './subscriptionPeriodTile.js'; diff --git a/lib/insight/model/subscriptionPeriodTile.ts b/lib/insight/model/subscriptionPeriodTile.ts index 9d3d26906..9cd4de29f 100644 --- a/lib/insight/model/subscriptionPeriodTile.ts +++ b/lib/insight/model/subscriptionPeriodTile.ts @@ -10,24 +10,43 @@ * Do not edit the class manually. */ -export type SubscriptionPeriodTile = { - /** - * Subscription period. Possible values: `within7days`, `within90days`, `unknown` etc. - */ - subscriptionPeriod?: SubscriptionPeriodTile.SubscriptionPeriodEnum /**/; - /** - * Percentage. Possible values: [0.0,100.0] e.g. 0, 2.9, 37.6. - */ - percentage?: number /**/; -}; + + + + +export type SubscriptionPeriodTile = { + /** + * Subscription period. Possible values: `within7days`, `within90days`, `unknown` etc. + */ + 'subscriptionPeriod'?: SubscriptionPeriodTile.SubscriptionPeriodEnum/**/; + /** + * Percentage. Possible values: [0.0,100.0] e.g. 0, 2.9, 37.6. + */ + 'percentage'?: number/**/; + +} + + + export namespace SubscriptionPeriodTile { - export type SubscriptionPeriodEnum = - | "within7days" - | "within30days" - | "within90days" - | "within180days" - | "within365days" - | "over365days" - | "unknown"; + export type SubscriptionPeriodEnum = + 'within7days' + | 'within30days' + | 'within90days' + | 'within180days' + | 'within365days' + | 'over365days' + | 'unknown' + + + ; + + + } + + + + + diff --git a/lib/insight/tests/api/InsightClientTest.spec.ts b/lib/insight/tests/api/InsightClientTest.spec.ts index c4d9f00c8..49b49b2a8 100644 --- a/lib/insight/tests/api/InsightClientTest.spec.ts +++ b/lib/insight/tests/api/InsightClientTest.spec.ts @@ -1,19 +1,32 @@ -import { InsightClient } from "../../api"; -import { GetFriendsDemographicsResponse } from "../../model/getFriendsDemographicsResponse"; -import { GetMessageEventResponse } from "../../model/getMessageEventResponse"; -import { GetNumberOfFollowersResponse } from "../../model/getNumberOfFollowersResponse"; -import { GetNumberOfMessageDeliveriesResponse } from "../../model/getNumberOfMessageDeliveriesResponse"; -import { GetStatisticsPerUnitResponse } from "../../model/getStatisticsPerUnitResponse"; + +import { InsightClient } from "../../api.js"; + +import { GetFriendsDemographicsResponse } from '../../model/getFriendsDemographicsResponse.js'; +import { GetMessageEventResponse } from '../../model/getMessageEventResponse.js'; +import { GetNumberOfFollowersResponse } from '../../model/getNumberOfFollowersResponse.js'; +import { GetNumberOfMessageDeliveriesResponse } from '../../model/getNumberOfMessageDeliveriesResponse.js'; +import { GetStatisticsPerUnitResponse } from '../../model/getStatisticsPerUnitResponse.js'; + import { createServer } from "node:http"; import { deepEqual, equal, ok } from "node:assert"; -const pkg = require("../../../../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../../../../package.json"); const channel_access_token = "test_channel_access_token"; + + + + describe("InsightClient", () => { + + + + it("getFriendsDemographicsWithHttpInfo", async () => { let requestCount = 0; @@ -22,35 +35,52 @@ describe("InsightClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/insight/demographic"); + equal(reqUrl.pathname, "/v2/bot/insight/demographic" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new InsightClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getFriendsDemographicsWithHttpInfo(); + const res = await client.getFriendsDemographicsWithHttpInfo( + + ); equal(requestCount, 1); server.close(); }); + + + + it("getFriendsDemographics", async () => { let requestCount = 0; @@ -59,35 +89,53 @@ describe("InsightClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/insight/demographic"); + equal(reqUrl.pathname, "/v2/bot/insight/demographic" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new InsightClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getFriendsDemographics(); + const res = await client.getFriendsDemographics( + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getMessageEventWithHttpInfo", async () => { let requestCount = 0; @@ -96,51 +144,67 @@ describe("InsightClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/insight/message/event".replace("{requestId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/insight/message/event" + .replace("{requestId}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("requestId"), - String( - // requestId: string - "DUMMY" as unknown as string, // paramName=requestId(enum) - ), - ); + equal(queryParams.get("requestId"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // requestId: string + "DUMMY" as unknown as string, // paramName=requestId(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new InsightClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getMessageEventWithHttpInfo( - // requestId: string - "DUMMY" as unknown as string, // paramName=requestId(enum) + + + // requestId: string + "DUMMY" as unknown as string, // paramName=requestId(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getMessageEvent", async () => { let requestCount = 0; @@ -149,51 +213,68 @@ describe("InsightClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/insight/message/event".replace("{requestId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/insight/message/event" + .replace("{requestId}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("requestId"), - String( - // requestId: string - "DUMMY" as unknown as string, // paramName=requestId(enum) - ), - ); + equal(queryParams.get("requestId"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // requestId: string + "DUMMY" as unknown as string, // paramName=requestId(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new InsightClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getMessageEvent( - // requestId: string - "DUMMY" as unknown as string, // paramName=requestId(enum) + + + // requestId: string + "DUMMY" as unknown as string, // paramName=requestId(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getNumberOfFollowersWithHttpInfo", async () => { let requestCount = 0; @@ -202,51 +283,67 @@ describe("InsightClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/insight/followers".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/insight/followers" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new InsightClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getNumberOfFollowersWithHttpInfo( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getNumberOfFollowers", async () => { let requestCount = 0; @@ -255,51 +352,68 @@ describe("InsightClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/insight/followers".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/insight/followers" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new InsightClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getNumberOfFollowers( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getNumberOfMessageDeliveriesWithHttpInfo", async () => { let requestCount = 0; @@ -308,51 +422,67 @@ describe("InsightClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/insight/message/delivery".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/insight/message/delivery" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new InsightClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getNumberOfMessageDeliveriesWithHttpInfo( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getNumberOfMessageDeliveries", async () => { let requestCount = 0; @@ -361,51 +491,68 @@ describe("InsightClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/insight/message/delivery".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/insight/message/delivery" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new InsightClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getNumberOfMessageDeliveries( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getStatisticsPerUnitWithHttpInfo", async () => { let requestCount = 0; @@ -414,74 +561,89 @@ describe("InsightClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/insight/message/event/aggregation" - .replace("{customAggregationUnit}", "DUMMY") // string - .replace("{from}", "DUMMY") // string - .replace("{to}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/insight/message/event/aggregation" + .replace("{customAggregationUnit}", "DUMMY") // string + .replace("{from}", "DUMMY") // string + .replace("{to}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("customAggregationUnit"), - String( - // customAggregationUnit: string - "DUMMY" as unknown as string, // paramName=customAggregationUnit(enum) - ), - ); - equal( - queryParams.get("from"), - String( - // from: string - "DUMMY" as unknown as string, // paramName=from(enum) - ), + equal(queryParams.get("customAggregationUnit"), String( + + // customAggregationUnit: string + "DUMMY" as unknown as string, // paramName=customAggregationUnit(enum) + )); + equal(queryParams.get("from"), String( + + // from: string + "DUMMY" as unknown as string, // paramName=from(enum) + )); + equal(queryParams.get("to"), String( + + // to: string + "DUMMY" as unknown as string, // paramName=to(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, ); - equal( - queryParams.get("to"), - String( - // to: string - "DUMMY" as unknown as string, // paramName=to(enum) - ), + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new InsightClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getStatisticsPerUnitWithHttpInfo( - // customAggregationUnit: string - "DUMMY" as unknown as string, // paramName=customAggregationUnit(enum) - // from: string - "DUMMY" as unknown as string, // paramName=from(enum) - // to: string - "DUMMY" as unknown as string, // paramName=to(enum) + // customAggregationUnit: string + "DUMMY" as unknown as string, // paramName=customAggregationUnit(enum) + + + + // from: string + "DUMMY" as unknown as string, // paramName=from(enum) + + + + // to: string + "DUMMY" as unknown as string, // paramName=to(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getStatisticsPerUnit", async () => { let requestCount = 0; @@ -490,71 +652,85 @@ describe("InsightClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/insight/message/event/aggregation" - .replace("{customAggregationUnit}", "DUMMY") // string - .replace("{from}", "DUMMY") // string - .replace("{to}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/insight/message/event/aggregation" + .replace("{customAggregationUnit}", "DUMMY") // string + .replace("{from}", "DUMMY") // string + .replace("{to}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("customAggregationUnit"), - String( - // customAggregationUnit: string - "DUMMY" as unknown as string, // paramName=customAggregationUnit(enum) - ), - ); - equal( - queryParams.get("from"), - String( - // from: string - "DUMMY" as unknown as string, // paramName=from(enum) - ), + equal(queryParams.get("customAggregationUnit"), String( + + // customAggregationUnit: string + "DUMMY" as unknown as string, // paramName=customAggregationUnit(enum) + )); + equal(queryParams.get("from"), String( + + // from: string + "DUMMY" as unknown as string, // paramName=from(enum) + )); + equal(queryParams.get("to"), String( + + // to: string + "DUMMY" as unknown as string, // paramName=to(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, ); - equal( - queryParams.get("to"), - String( - // to: string - "DUMMY" as unknown as string, // paramName=to(enum) - ), + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new InsightClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getStatisticsPerUnit( - // customAggregationUnit: string - "DUMMY" as unknown as string, // paramName=customAggregationUnit(enum) - // from: string - "DUMMY" as unknown as string, // paramName=from(enum) - // to: string - "DUMMY" as unknown as string, // paramName=to(enum) + // customAggregationUnit: string + "DUMMY" as unknown as string, // paramName=customAggregationUnit(enum) + + + + // from: string + "DUMMY" as unknown as string, // paramName=from(enum) + + + + // to: string + "DUMMY" as unknown as string, // paramName=to(enum) + + ); equal(requestCount, 1); server.close(); }); + + + }); diff --git a/lib/liff/api.ts b/lib/liff/api.ts index eeedcdab6..048a59bd5 100644 --- a/lib/liff/api.ts +++ b/lib/liff/api.ts @@ -1,3 +1,3 @@ // This is the entrypoint for the package -export * from "./api/apis"; -export * from "./model/models"; +export * from './api/apis.js'; +export * from './model/models.js'; diff --git a/lib/liff/api/apis.ts b/lib/liff/api/apis.ts index 5aae2e33a..7b5923ff0 100644 --- a/lib/liff/api/apis.ts +++ b/lib/liff/api/apis.ts @@ -1 +1,3 @@ -export { LiffClient } from "./liffClient"; + +export { LiffClient } from './liffClient.js'; + diff --git a/lib/liff/api/liffClient.ts b/lib/liff/api/liffClient.ts index 810332845..d52321f54 100644 --- a/lib/liff/api/liffClient.ts +++ b/lib/liff/api/liffClient.ts @@ -1,3 +1,5 @@ + + /** * LIFF server API * LIFF Server API. @@ -10,168 +12,216 @@ * Do not edit the class manually. */ + /* tslint:disable:no-unused-locals */ -import { AddLiffAppRequest } from "../model/addLiffAppRequest"; -import { AddLiffAppResponse } from "../model/addLiffAppResponse"; -import { GetAllLiffAppsResponse } from "../model/getAllLiffAppsResponse"; -import { UpdateLiffAppRequest } from "../model/updateLiffAppRequest"; +import { AddLiffAppRequest } from '../model/addLiffAppRequest.js'; +import { AddLiffAppResponse } from '../model/addLiffAppResponse.js'; +import { GetAllLiffAppsResponse } from '../model/getAllLiffAppsResponse.js'; +import { UpdateLiffAppRequest } from '../model/updateLiffAppRequest.js'; -import * as Types from "../../types"; -import { ensureJSON } from "../../utils"; -import { Readable } from "node:stream"; +import * as Types from "../../types.js"; +import {ensureJSON} from "../../utils.js"; +import {Readable} from "node:stream"; -import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch"; +import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch.js"; // =============================================== // This file is autogenerated - Please do not edit // =============================================== interface httpClientConfig { - baseURL?: string; - channelAccessToken: string; - // TODO support defaultHeaders? + baseURL?: string; + channelAccessToken: string; + // TODO support defaultHeaders? } + export class LiffClient { - private httpClient: HTTPFetchClient; + private httpClient: HTTPFetchClient; + + constructor(config: httpClientConfig) { + if (!config.baseURL) { + config.baseURL = 'https://api.line.me'; + } + this.httpClient = new HTTPFetchClient({ + defaultHeaders: { + Authorization: "Bearer " + config.channelAccessToken, + }, + baseURL: config.baseURL, + }); + } - constructor(config: httpClientConfig) { - if (!config.baseURL) { - config.baseURL = "https://api.line.me"; + private async parseHTTPResponse(response: Response) { + const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; + let resBody: Record = { + ...await response.json(), + }; + if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { + resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = + response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME); + } + return resBody; } - this.httpClient = new HTTPFetchClient({ - defaultHeaders: { - Authorization: "Bearer " + config.channelAccessToken, - }, - baseURL: config.baseURL, - }); - } - - private async parseHTTPResponse(response: Response) { - const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; - let resBody: Record = { - ...(await response.json()), - }; - if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { - resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = response.headers.get( - LINE_REQUEST_ID_HTTP_HEADER_NAME, - ); + +/** + * Adding the LIFF app to a channel + * @param addLiffAppRequest + * + * @see Documentation + */ + public async addLIFFApp(addLiffAppRequest: AddLiffAppRequest, ) : Promise { + return (await this.addLIFFAppWithHttpInfo(addLiffAppRequest, )).body; } - return resBody; - } - - /** - * Adding the LIFF app to a channel - * @param addLiffAppRequest - * - * @see Documentation - */ - public async addLIFFApp( - addLiffAppRequest: AddLiffAppRequest, - ): Promise { - return (await this.addLIFFAppWithHttpInfo(addLiffAppRequest)).body; - } - - /** - * Adding the LIFF app to a channel. - * This method includes HttpInfo object to return additional information. - * @param addLiffAppRequest - * - * @see Documentation - */ - public async addLIFFAppWithHttpInfo( - addLiffAppRequest: AddLiffAppRequest, - ): Promise> { + + /** + * Adding the LIFF app to a channel. + * This method includes HttpInfo object to return additional information. + * @param addLiffAppRequest + * + * @see Documentation + */ + public async addLIFFAppWithHttpInfo(addLiffAppRequest: AddLiffAppRequest, ) : Promise> { + + + + const params = addLiffAppRequest; + + + + const res = await this.httpClient.post( + "/liff/v1/apps" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Deletes a LIFF app from a channel. + * @summary Delete LIFF app from a channel + * @param liffId ID of the LIFF app to be updated + * + * @see Delete LIFF app from a channel Documentation + */ + public async deleteLIFFApp(liffId: string, ) : Promise { + return (await this.deleteLIFFAppWithHttpInfo(liffId, )).body; + } + + /** + * Deletes a LIFF app from a channel. . + * This method includes HttpInfo object to return additional information. + * @summary Delete LIFF app from a channel + * @param liffId ID of the LIFF app to be updated + * + * @see Delete LIFF app from a channel Documentation + */ + public async deleteLIFFAppWithHttpInfo(liffId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.delete( + "/liff/v1/apps/{liffId}" + + .replace("{liffId}", String(liffId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Gets information on all the LIFF apps added to the channel. + * @summary Get all LIFF apps + * + * @see Get all LIFF apps Documentation + */ + public async getAllLIFFApps() : Promise { + return (await this.getAllLIFFAppsWithHttpInfo()).body; + } + + /** + * Gets information on all the LIFF apps added to the channel.. + * This method includes HttpInfo object to return additional information. + * @summary Get all LIFF apps + * + * @see Get all LIFF apps Documentation + */ + public async getAllLIFFAppsWithHttpInfo() : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/liff/v1/apps" + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Update LIFF app settings + * @param liffId ID of the LIFF app to be updated + * @param updateLiffAppRequest + * + * @see Documentation + */ + public async updateLIFFApp(liffId: string, updateLiffAppRequest: UpdateLiffAppRequest, ) : Promise { + return (await this.updateLIFFAppWithHttpInfo(liffId, updateLiffAppRequest, )).body; + } + + /** + * Update LIFF app settings. + * This method includes HttpInfo object to return additional information. + * @param liffId ID of the LIFF app to be updated + * @param updateLiffAppRequest + * + * @see Documentation + */ + public async updateLIFFAppWithHttpInfo(liffId: string, updateLiffAppRequest: UpdateLiffAppRequest, ) : Promise> { + + + - const res = await this.httpClient.post("/liff/v1/apps", params); - return { httpResponse: res, body: await res.json() }; - } - /** - * Deletes a LIFF app from a channel. - * @summary Delete LIFF app from a channel - * @param liffId ID of the LIFF app to be updated - * - * @see Delete LIFF app from a channel Documentation - */ - public async deleteLIFFApp( - liffId: string, - ): Promise { - return (await this.deleteLIFFAppWithHttpInfo(liffId)).body; - } - - /** - * Deletes a LIFF app from a channel. . - * This method includes HttpInfo object to return additional information. - * @summary Delete LIFF app from a channel - * @param liffId ID of the LIFF app to be updated - * - * @see Delete LIFF app from a channel Documentation - */ - public async deleteLIFFAppWithHttpInfo( - liffId: string, - ): Promise> { - const res = await this.httpClient.delete( - "/liff/v1/apps/{liffId}".replace("{liffId}", String(liffId)), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Gets information on all the LIFF apps added to the channel. - * @summary Get all LIFF apps - * - * @see Get all LIFF apps Documentation - */ - public async getAllLIFFApps(): Promise { - return (await this.getAllLIFFAppsWithHttpInfo()).body; - } - - /** - * Gets information on all the LIFF apps added to the channel.. - * This method includes HttpInfo object to return additional information. - * @summary Get all LIFF apps - * - * @see Get all LIFF apps Documentation - */ - public async getAllLIFFAppsWithHttpInfo(): Promise< - Types.ApiResponseType - > { - const res = await this.httpClient.get("/liff/v1/apps"); - return { httpResponse: res, body: await res.json() }; - } - /** - * Update LIFF app settings - * @param liffId ID of the LIFF app to be updated - * @param updateLiffAppRequest - * - * @see Documentation - */ - public async updateLIFFApp( - liffId: string, - updateLiffAppRequest: UpdateLiffAppRequest, - ): Promise { - return (await this.updateLIFFAppWithHttpInfo(liffId, updateLiffAppRequest)) - .body; - } - - /** - * Update LIFF app settings. - * This method includes HttpInfo object to return additional information. - * @param liffId ID of the LIFF app to be updated - * @param updateLiffAppRequest - * - * @see Documentation - */ - public async updateLIFFAppWithHttpInfo( - liffId: string, - updateLiffAppRequest: UpdateLiffAppRequest, - ): Promise> { const params = updateLiffAppRequest; + + + + const res = await this.httpClient.put( + "/liff/v1/apps/{liffId}" + + .replace("{liffId}", String(liffId)) + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } - const res = await this.httpClient.put( - "/liff/v1/apps/{liffId}".replace("{liffId}", String(liffId)), - params, - ); - return { httpResponse: res, body: await res.json() }; - } } diff --git a/lib/liff/model/addLiffAppRequest.ts b/lib/liff/model/addLiffAppRequest.ts index aae1b5d2d..90f67ec02 100644 --- a/lib/liff/model/addLiffAppRequest.ts +++ b/lib/liff/model/addLiffAppRequest.ts @@ -10,44 +10,60 @@ * Do not edit the class manually. */ -import { LiffBotPrompt } from "./liffBotPrompt"; -import { LiffFeatures } from "./liffFeatures"; -import { LiffScope } from "./liffScope"; -import { LiffView } from "./liffView"; - -export type AddLiffAppRequest = { - /** - * - * @see view Documentation - */ - view: LiffView /**/; - /** - * Name of the LIFF app. The LIFF app name can\'t include \"LINE\" or similar strings, or inappropriate strings. - * - * @see description Documentation - */ - description?: string /**/; - /** - * - * @see features Documentation - */ - features?: LiffFeatures /**/; - /** - * How additional information in LIFF URLs is handled. Specify `concat`. - * - * @see permanentLinkPattern Documentation - */ - permanentLinkPattern?: string /**/; - /** - * - * @see scope Documentation - */ - scope?: Array /**/; - /** - * - * @see botPrompt Documentation - */ - botPrompt?: LiffBotPrompt /**/; -}; - -export namespace AddLiffAppRequest {} + + + import { LiffBotPrompt } from './liffBotPrompt.js';import { LiffFeatures } from './liffFeatures.js';import { LiffScope } from './liffScope.js';import { LiffView } from './liffView.js'; + + +export type AddLiffAppRequest = { + /** + * + * @see view Documentation + */ + 'view': LiffView/**/; + /** + * Name of the LIFF app. The LIFF app name can\'t include \"LINE\" or similar strings, or inappropriate strings. + * + * @see description Documentation + */ + 'description'?: string/**/; + /** + * + * @see features Documentation + */ + 'features'?: LiffFeatures/**/; + /** + * How additional information in LIFF URLs is handled. Specify `concat`. + * + * @see permanentLinkPattern Documentation + */ + 'permanentLinkPattern'?: string/**/; + /** + * + * @see scope Documentation + */ + 'scope'?: Array/**/; + /** + * + * @see botPrompt Documentation + */ + 'botPrompt'?: LiffBotPrompt/**/; + +} + + + +export namespace AddLiffAppRequest { + + + + + + + +} + + + + + diff --git a/lib/liff/model/addLiffAppResponse.ts b/lib/liff/model/addLiffAppResponse.ts index 349e0950d..af28ae69a 100644 --- a/lib/liff/model/addLiffAppResponse.ts +++ b/lib/liff/model/addLiffAppResponse.ts @@ -10,8 +10,21 @@ * Do not edit the class manually. */ -export type AddLiffAppResponse = { - /** - */ - liffId: string /**/; -}; + + + + + +export type AddLiffAppResponse = { + /** + */ + 'liffId': string/**/; + +} + + + + + + + diff --git a/lib/liff/model/getAllLiffAppsResponse.ts b/lib/liff/model/getAllLiffAppsResponse.ts index e0cbf0c10..b02c9b5f5 100644 --- a/lib/liff/model/getAllLiffAppsResponse.ts +++ b/lib/liff/model/getAllLiffAppsResponse.ts @@ -10,10 +10,21 @@ * Do not edit the class manually. */ -import { LiffApp } from "./liffApp"; -export type GetAllLiffAppsResponse = { - /** - */ - apps?: Array /**/; -}; + + import { LiffApp } from './liffApp.js'; + + +export type GetAllLiffAppsResponse = { + /** + */ + 'apps'?: Array/**/; + +} + + + + + + + diff --git a/lib/liff/model/liffApp.ts b/lib/liff/model/liffApp.ts index 6c51d1709..5971f98f9 100644 --- a/lib/liff/model/liffApp.ts +++ b/lib/liff/model/liffApp.ts @@ -10,36 +10,53 @@ * Do not edit the class manually. */ -import { LiffBotPrompt } from "./liffBotPrompt"; -import { LiffFeatures } from "./liffFeatures"; -import { LiffScope } from "./liffScope"; -import { LiffView } from "./liffView"; - -export type LiffApp = { - /** - * LIFF app ID - */ - liffId?: string /**/; - /** - */ - view?: LiffView /**/; - /** - * Name of the LIFF app - */ - description?: string /**/; - /** - */ - features?: LiffFeatures /**/; - /** - * How additional information in LIFF URLs is handled. concat is returned. - */ - permanentLinkPattern?: string /**/; - /** - */ - scope?: Array /**/; - /** - */ - botPrompt?: LiffBotPrompt /**/; -}; - -export namespace LiffApp {} + + + import { LiffBotPrompt } from './liffBotPrompt.js';import { LiffFeatures } from './liffFeatures.js';import { LiffScope } from './liffScope.js';import { LiffView } from './liffView.js'; + + +export type LiffApp = { + /** + * LIFF app ID + */ + 'liffId'?: string/**/; + /** + */ + 'view'?: LiffView/**/; + /** + * Name of the LIFF app + */ + 'description'?: string/**/; + /** + */ + 'features'?: LiffFeatures/**/; + /** + * How additional information in LIFF URLs is handled. concat is returned. + */ + 'permanentLinkPattern'?: string/**/; + /** + */ + 'scope'?: Array/**/; + /** + */ + 'botPrompt'?: LiffBotPrompt/**/; + +} + + + +export namespace LiffApp { + + + + + + + + +} + + + + + diff --git a/lib/liff/model/liffBotPrompt.ts b/lib/liff/model/liffBotPrompt.ts index 1c2fd41c1..736848c9f 100644 --- a/lib/liff/model/liffBotPrompt.ts +++ b/lib/liff/model/liffBotPrompt.ts @@ -10,8 +10,23 @@ * Do not edit the class manually. */ + + + + + /** - * Specify the setting for bot link feature with one of the following values: `normal`: Display the option to add the LINE Official Account as a friend in the channel consent screen. `aggressive`: Display a screen with the option to add the LINE Official Account as a friend after the channel consent screen. `none`: Don\'t display the option to add the LINE Official Account as a friend. The default value is none. + * Specify the setting for bot link feature with one of the following values: `normal`: Display the option to add the LINE Official Account as a friend in the channel consent screen. `aggressive`: Display a screen with the option to add the LINE Official Account as a friend after the channel consent screen. `none`: Don\'t display the option to add the LINE Official Account as a friend. The default value is none. */ -export type LiffBotPrompt = "normal" | "aggressive" | "none"; + + + export type LiffBotPrompt = + 'normal' + | 'aggressive' + | 'none' + +; + + + diff --git a/lib/liff/model/liffFeatures.ts b/lib/liff/model/liffFeatures.ts index fa940b663..ee6499536 100644 --- a/lib/liff/model/liffFeatures.ts +++ b/lib/liff/model/liffFeatures.ts @@ -10,13 +10,26 @@ * Do not edit the class manually. */ -export type LiffFeatures = { - /** - * `true` if the LIFF app supports Bluetooth® Low Energy for LINE Things. `false` otherwise. - */ - ble?: boolean /**/; - /** - * `true` to use the 2D code reader in the LIFF app. false otherwise. The default value is `false`. - */ - qrCode?: boolean /* = false*/; -}; + + + + + +export type LiffFeatures = { + /** + * `true` if the LIFF app supports Bluetooth® Low Energy for LINE Things. `false` otherwise. + */ + 'ble'?: boolean/**/; + /** + * `true` to use the 2D code reader in the LIFF app. false otherwise. The default value is `false`. + */ + 'qrCode'?: boolean/* = false*/; + +} + + + + + + + diff --git a/lib/liff/model/liffScope.ts b/lib/liff/model/liffScope.ts index 198869266..f363a2385 100644 --- a/lib/liff/model/liffScope.ts +++ b/lib/liff/model/liffScope.ts @@ -10,8 +10,24 @@ * Do not edit the class manually. */ + + + + + /** - * Array of scopes required for some LIFF SDK methods to function. The default value is `[\"profile\", \"chat_message.write\"]`. + * Array of scopes required for some LIFF SDK methods to function. The default value is `[\"profile\", \"chat_message.write\"]`. */ -export type LiffScope = "openid" | "email" | "profile" | "chat_message.write"; + + + export type LiffScope = + 'openid' + | 'email' + | 'profile' + | 'chat_message.write' + +; + + + diff --git a/lib/liff/model/liffView.ts b/lib/liff/model/liffView.ts index eea1cbf94..4779776ae 100644 --- a/lib/liff/model/liffView.ts +++ b/lib/liff/model/liffView.ts @@ -10,27 +10,50 @@ * Do not edit the class manually. */ -export type LiffView = { - /** - * Size of the LIFF app view. Specify one of these values: - compact - tall - full - * - * @see type Documentation - */ - type: LiffView.TypeEnum /**/; - /** - * Endpoint URL. This is the URL of the web app that implements the LIFF app (e.g. https://example.com). Used when the LIFF app is launched using the LIFF URL. The URL scheme must be https. URL fragments (#URL-fragment) can\'t be specified. - * - * @see url Documentation - */ - url: string /**/; - /** - * `true` to use the LIFF app in modular mode. When in modular mode, the action button in the header is not displayed. - * - * @see moduleMode Documentation - */ - moduleMode?: boolean /**/; -}; + + + + +export type LiffView = { + /** + * Size of the LIFF app view. Specify one of these values: - compact - tall - full + * + * @see type Documentation + */ + 'type': LiffView.TypeEnum/**/; + /** + * Endpoint URL. This is the URL of the web app that implements the LIFF app (e.g. https://example.com). Used when the LIFF app is launched using the LIFF URL. The URL scheme must be https. URL fragments (#URL-fragment) can\'t be specified. + * + * @see url Documentation + */ + 'url': string/**/; + /** + * `true` to use the LIFF app in modular mode. When in modular mode, the action button in the header is not displayed. + * + * @see moduleMode Documentation + */ + 'moduleMode'?: boolean/**/; + +} + + + export namespace LiffView { - export type TypeEnum = "compact" | "tall" | "full"; + export type TypeEnum = + 'compact' + | 'tall' + | 'full' + + + ; + + + + } + + + + + diff --git a/lib/liff/model/models.ts b/lib/liff/model/models.ts index 3ab4beab2..c159cdf8c 100644 --- a/lib/liff/model/models.ts +++ b/lib/liff/model/models.ts @@ -1,9 +1,2 @@ -export * from "./addLiffAppRequest"; -export * from "./addLiffAppResponse"; -export * from "./getAllLiffAppsResponse"; -export * from "./liffApp"; -export * from "./liffBotPrompt"; -export * from "./liffFeatures"; -export * from "./liffScope"; -export * from "./liffView"; -export * from "./updateLiffAppRequest"; + +export * from './addLiffAppRequest.js';export * from './addLiffAppResponse.js';export * from './getAllLiffAppsResponse.js';export * from './liffApp.js';export * from './liffBotPrompt.js';export * from './liffFeatures.js';export * from './liffScope.js';export * from './liffView.js';export * from './updateLiffAppRequest.js'; diff --git a/lib/liff/model/updateLiffAppRequest.ts b/lib/liff/model/updateLiffAppRequest.ts index 6da3ffe4b..b03d0e5dc 100644 --- a/lib/liff/model/updateLiffAppRequest.ts +++ b/lib/liff/model/updateLiffAppRequest.ts @@ -10,44 +10,60 @@ * Do not edit the class manually. */ -import { LiffBotPrompt } from "./liffBotPrompt"; -import { LiffFeatures } from "./liffFeatures"; -import { LiffScope } from "./liffScope"; -import { LiffView } from "./liffView"; - -export type UpdateLiffAppRequest = { - /** - * - * @see view Documentation - */ - view?: LiffView /**/; - /** - * Name of the LIFF app. The LIFF app name can\'t include \"LINE\" or similar strings, or inappropriate strings. - * - * @see description Documentation - */ - description?: string /**/; - /** - * - * @see features Documentation - */ - features?: LiffFeatures /**/; - /** - * How additional information in LIFF URLs is handled. Specify `concat`. - * - * @see permanentLinkPattern Documentation - */ - permanentLinkPattern?: string /**/; - /** - * - * @see scope Documentation - */ - scope?: Array /**/; - /** - * - * @see botPrompt Documentation - */ - botPrompt?: LiffBotPrompt /**/; -}; - -export namespace UpdateLiffAppRequest {} + + + import { LiffBotPrompt } from './liffBotPrompt.js';import { LiffFeatures } from './liffFeatures.js';import { LiffScope } from './liffScope.js';import { LiffView } from './liffView.js'; + + +export type UpdateLiffAppRequest = { + /** + * + * @see view Documentation + */ + 'view'?: LiffView/**/; + /** + * Name of the LIFF app. The LIFF app name can\'t include \"LINE\" or similar strings, or inappropriate strings. + * + * @see description Documentation + */ + 'description'?: string/**/; + /** + * + * @see features Documentation + */ + 'features'?: LiffFeatures/**/; + /** + * How additional information in LIFF URLs is handled. Specify `concat`. + * + * @see permanentLinkPattern Documentation + */ + 'permanentLinkPattern'?: string/**/; + /** + * + * @see scope Documentation + */ + 'scope'?: Array/**/; + /** + * + * @see botPrompt Documentation + */ + 'botPrompt'?: LiffBotPrompt/**/; + +} + + + +export namespace UpdateLiffAppRequest { + + + + + + + +} + + + + + diff --git a/lib/liff/tests/api/LiffClientTest.spec.ts b/lib/liff/tests/api/LiffClientTest.spec.ts index 2593dd9ee..45431ce00 100644 --- a/lib/liff/tests/api/LiffClientTest.spec.ts +++ b/lib/liff/tests/api/LiffClientTest.spec.ts @@ -1,18 +1,31 @@ -import { LiffClient } from "../../api"; -import { AddLiffAppRequest } from "../../model/addLiffAppRequest"; -import { AddLiffAppResponse } from "../../model/addLiffAppResponse"; -import { GetAllLiffAppsResponse } from "../../model/getAllLiffAppsResponse"; -import { UpdateLiffAppRequest } from "../../model/updateLiffAppRequest"; + +import { LiffClient } from "../../api.js"; + +import { AddLiffAppRequest } from '../../model/addLiffAppRequest.js'; +import { AddLiffAppResponse } from '../../model/addLiffAppResponse.js'; +import { GetAllLiffAppsResponse } from '../../model/getAllLiffAppsResponse.js'; +import { UpdateLiffAppRequest } from '../../model/updateLiffAppRequest.js'; + import { createServer } from "node:http"; import { deepEqual, equal, ok } from "node:assert"; -const pkg = require("../../../../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../../../../package.json"); const channel_access_token = "test_channel_access_token"; + + + + describe("LiffClient", () => { + + + + it("addLIFFAppWithHttpInfo", async () => { let requestCount = 0; @@ -21,38 +34,57 @@ describe("LiffClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/liff/v1/apps"); + equal(reqUrl.pathname, "/liff/v1/apps" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LiffClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.addLIFFAppWithHttpInfo( - // addLiffAppRequest: AddLiffAppRequest - {} as unknown as AddLiffAppRequest, // paramName=addLiffAppRequest + + + // addLiffAppRequest: AddLiffAppRequest + {} as unknown as AddLiffAppRequest, // paramName=addLiffAppRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("addLIFFApp", async () => { let requestCount = 0; @@ -61,38 +93,58 @@ describe("LiffClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/liff/v1/apps"); + equal(reqUrl.pathname, "/liff/v1/apps" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LiffClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.addLIFFApp( - // addLiffAppRequest: AddLiffAppRequest - {} as unknown as AddLiffAppRequest, // paramName=addLiffAppRequest + + + // addLiffAppRequest: AddLiffAppRequest + {} as unknown as AddLiffAppRequest, // paramName=addLiffAppRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("deleteLIFFAppWithHttpInfo", async () => { let requestCount = 0; @@ -101,41 +153,58 @@ describe("LiffClient", () => { equal(req.method, "DELETE"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/liff/v1/apps/{liffId}".replace("{liffId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/liff/v1/apps/{liffId}" + .replace("{liffId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LiffClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.deleteLIFFAppWithHttpInfo( - // liffId: string - "DUMMY", // liffId(string) + + + // liffId: string + "DUMMY", // liffId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("deleteLIFFApp", async () => { let requestCount = 0; @@ -144,41 +213,59 @@ describe("LiffClient", () => { equal(req.method, "DELETE"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/liff/v1/apps/{liffId}".replace("{liffId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/liff/v1/apps/{liffId}" + .replace("{liffId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LiffClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.deleteLIFFApp( - // liffId: string - "DUMMY", // liffId(string) + + + // liffId: string + "DUMMY", // liffId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getAllLIFFAppsWithHttpInfo", async () => { let requestCount = 0; @@ -187,35 +274,52 @@ describe("LiffClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/liff/v1/apps"); + equal(reqUrl.pathname, "/liff/v1/apps" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LiffClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getAllLIFFAppsWithHttpInfo(); + const res = await client.getAllLIFFAppsWithHttpInfo( + + ); equal(requestCount, 1); server.close(); }); + + + + it("getAllLIFFApps", async () => { let requestCount = 0; @@ -224,35 +328,53 @@ describe("LiffClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/liff/v1/apps"); + equal(reqUrl.pathname, "/liff/v1/apps" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LiffClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getAllLIFFApps(); + const res = await client.getAllLIFFApps( + + ); equal(requestCount, 1); server.close(); }); + + + + + it("updateLIFFAppWithHttpInfo", async () => { let requestCount = 0; @@ -261,44 +383,63 @@ describe("LiffClient", () => { equal(req.method, "PUT"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/liff/v1/apps/{liffId}".replace("{liffId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/liff/v1/apps/{liffId}" + .replace("{liffId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LiffClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.updateLIFFAppWithHttpInfo( - // liffId: string - "DUMMY", // liffId(string) - // updateLiffAppRequest: UpdateLiffAppRequest - {} as unknown as UpdateLiffAppRequest, // paramName=updateLiffAppRequest + + // liffId: string + "DUMMY", // liffId(string) + + + + // updateLiffAppRequest: UpdateLiffAppRequest + {} as unknown as UpdateLiffAppRequest, // paramName=updateLiffAppRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("updateLIFFApp", async () => { let requestCount = 0; @@ -307,41 +448,59 @@ describe("LiffClient", () => { equal(req.method, "PUT"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/liff/v1/apps/{liffId}".replace("{liffId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/liff/v1/apps/{liffId}" + .replace("{liffId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LiffClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.updateLIFFApp( - // liffId: string - "DUMMY", // liffId(string) - // updateLiffAppRequest: UpdateLiffAppRequest - {} as unknown as UpdateLiffAppRequest, // paramName=updateLiffAppRequest + + // liffId: string + "DUMMY", // liffId(string) + + + + // updateLiffAppRequest: UpdateLiffAppRequest + {} as unknown as UpdateLiffAppRequest, // paramName=updateLiffAppRequest + + ); equal(requestCount, 1); server.close(); }); + + + }); diff --git a/lib/manage-audience/api.ts b/lib/manage-audience/api.ts index eeedcdab6..048a59bd5 100644 --- a/lib/manage-audience/api.ts +++ b/lib/manage-audience/api.ts @@ -1,3 +1,3 @@ // This is the entrypoint for the package -export * from "./api/apis"; -export * from "./model/models"; +export * from './api/apis.js'; +export * from './model/models.js'; diff --git a/lib/manage-audience/api/apis.ts b/lib/manage-audience/api/apis.ts index 7daef664c..295414fa7 100644 --- a/lib/manage-audience/api/apis.ts +++ b/lib/manage-audience/api/apis.ts @@ -1,2 +1,4 @@ -export { ManageAudienceClient } from "./manageAudienceClient"; -export { ManageAudienceBlobClient } from "./manageAudienceBlobClient"; + +export { ManageAudienceClient } from './manageAudienceClient.js'; +export { ManageAudienceBlobClient } from './manageAudienceBlobClient.js'; + diff --git a/lib/manage-audience/api/manageAudienceBlobClient.ts b/lib/manage-audience/api/manageAudienceBlobClient.ts index 2fdf5e574..1614f5946 100644 --- a/lib/manage-audience/api/manageAudienceBlobClient.ts +++ b/lib/manage-audience/api/manageAudienceBlobClient.ts @@ -1,3 +1,5 @@ + + /** * LINE Messaging API * This document describes LINE Messaging API. @@ -10,151 +12,132 @@ * Do not edit the class manually. */ + /* tslint:disable:no-unused-locals */ -import { CreateAudienceGroupResponse } from "../model/createAudienceGroupResponse"; +import { CreateAudienceGroupResponse } from '../model/createAudienceGroupResponse.js'; -import * as Types from "../../types"; -import { ensureJSON } from "../../utils"; -import { Readable } from "node:stream"; +import * as Types from "../../types.js"; +import {ensureJSON} from "../../utils.js"; +import {Readable} from "node:stream"; -import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch"; +import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch.js"; // =============================================== // This file is autogenerated - Please do not edit // =============================================== interface httpClientConfig { - baseURL?: string; - channelAccessToken: string; - // TODO support defaultHeaders? + baseURL?: string; + channelAccessToken: string; + // TODO support defaultHeaders? } + export class ManageAudienceBlobClient { - private httpClient: HTTPFetchClient; + private httpClient: HTTPFetchClient; - constructor(config: httpClientConfig) { - if (!config.baseURL) { - config.baseURL = "https://api-data.line.me"; + constructor(config: httpClientConfig) { + if (!config.baseURL) { + config.baseURL = 'https://api-data.line.me'; + } + this.httpClient = new HTTPFetchClient({ + defaultHeaders: { + Authorization: "Bearer " + config.channelAccessToken, + }, + baseURL: config.baseURL, + }); } - this.httpClient = new HTTPFetchClient({ - defaultHeaders: { - Authorization: "Bearer " + config.channelAccessToken, - }, - baseURL: config.baseURL, - }); - } - - private async parseHTTPResponse(response: Response) { - const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; - let resBody: Record = { - ...(await response.json()), - }; - if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { - resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = response.headers.get( - LINE_REQUEST_ID_HTTP_HEADER_NAME, - ); + + private async parseHTTPResponse(response: Response) { + const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; + let resBody: Record = { + ...await response.json(), + }; + if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { + resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = + response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME); + } + return resBody; } - return resBody; - } - - /** - * Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file). - * @param file A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 - * @param audienceGroupId The audience ID. - * @param uploadDescription The description to register with the job - * - * @see Documentation - */ - public async addUserIdsToAudience( - file: Blob, - audienceGroupId?: number, - uploadDescription?: string, - ): Promise { - return ( - await this.addUserIdsToAudienceWithHttpInfo( - file, - audienceGroupId, - uploadDescription, - ) - ).body; - } - - /** - * Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file).. - * This method includes HttpInfo object to return additional information. - * @param file A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 - * @param audienceGroupId The audience ID. - * @param uploadDescription The description to register with the job - * - * @see Documentation - */ - public async addUserIdsToAudienceWithHttpInfo( - file: Blob, - audienceGroupId?: number, - uploadDescription?: string, - ): Promise> { - const form = new FormData(); - form.append("audienceGroupId", String(audienceGroupId)); - form.append("uploadDescription", String(uploadDescription)); - form.append("file", file); // file - - const res = await this.httpClient.putFormMultipart( - "/v2/bot/audienceGroup/upload/byFile", - form, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Create audience for uploading user IDs (by file). - * @param file A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 - * @param description The audience\\\'s name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 - * @param isIfaAudience To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. - * @param uploadDescription The description to register for the job (in `jobs[].description`). - * - * @see Documentation - */ - public async createAudienceForUploadingUserIds( - file: Blob, - description?: string, - isIfaAudience?: boolean, - uploadDescription?: string, - ): Promise { - return ( - await this.createAudienceForUploadingUserIdsWithHttpInfo( - file, - description, - isIfaAudience, - uploadDescription, - ) - ).body; - } - - /** - * Create audience for uploading user IDs (by file).. - * This method includes HttpInfo object to return additional information. - * @param file A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 - * @param description The audience\\\'s name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 - * @param isIfaAudience To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. - * @param uploadDescription The description to register for the job (in `jobs[].description`). - * - * @see Documentation - */ - public async createAudienceForUploadingUserIdsWithHttpInfo( - file: Blob, - description?: string, - isIfaAudience?: boolean, - uploadDescription?: string, - ): Promise> { - const form = new FormData(); - form.append("description", String(description)); - form.append("isIfaAudience", String(isIfaAudience)); - form.append("uploadDescription", String(uploadDescription)); - form.append("file", file); // file - - const res = await this.httpClient.postFormMultipart( - "/v2/bot/audienceGroup/upload/byFile", - form, - ); - return { httpResponse: res, body: await res.json() }; - } + +/** + * Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file). + * @param file A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 + * @param audienceGroupId The audience ID. + * @param uploadDescription The description to register with the job + * + * @see Documentation + */ + public async addUserIdsToAudience(file: Blob, audienceGroupId?: number, uploadDescription?: string, ) : Promise { + return (await this.addUserIdsToAudienceWithHttpInfo(file, audienceGroupId, uploadDescription, )).body; + } + + /** + * Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file).. + * This method includes HttpInfo object to return additional information. + * @param file A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 + * @param audienceGroupId The audience ID. + * @param uploadDescription The description to register with the job + * + * @see Documentation + */ + public async addUserIdsToAudienceWithHttpInfo(file: Blob, audienceGroupId?: number, uploadDescription?: string, ) : Promise> { + + + const form = new FormData(); +form.append("audienceGroupId", String(audienceGroupId)); + form.append("uploadDescription", String(uploadDescription)); + form.append("file", file); // file + + const res = await this.httpClient.putFormMultipart( + "/v2/bot/audienceGroup/upload/byFile" +, + form, + ); + return {httpResponse: res, body: await res.json()}; + + + } +/** + * Create audience for uploading user IDs (by file). + * @param file A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 + * @param description The audience\\\'s name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 + * @param isIfaAudience To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. + * @param uploadDescription The description to register for the job (in `jobs[].description`). + * + * @see Documentation + */ + public async createAudienceForUploadingUserIds(file: Blob, description?: string, isIfaAudience?: boolean, uploadDescription?: string, ) : Promise { + return (await this.createAudienceForUploadingUserIdsWithHttpInfo(file, description, isIfaAudience, uploadDescription, )).body; + } + + /** + * Create audience for uploading user IDs (by file).. + * This method includes HttpInfo object to return additional information. + * @param file A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 + * @param description The audience\\\'s name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 + * @param isIfaAudience To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. + * @param uploadDescription The description to register for the job (in `jobs[].description`). + * + * @see Documentation + */ + public async createAudienceForUploadingUserIdsWithHttpInfo(file: Blob, description?: string, isIfaAudience?: boolean, uploadDescription?: string, ) : Promise> { + + + const form = new FormData(); +form.append("description", String(description)); + form.append("isIfaAudience", String(isIfaAudience)); + form.append("uploadDescription", String(uploadDescription)); + form.append("file", file); // file + + const res = await this.httpClient.postFormMultipart( + "/v2/bot/audienceGroup/upload/byFile" +, + form, + ); + return {httpResponse: res, body: await res.json()}; + + + } + } diff --git a/lib/manage-audience/api/manageAudienceClient.ts b/lib/manage-audience/api/manageAudienceClient.ts index ab305b0a5..898565a2c 100644 --- a/lib/manage-audience/api/manageAudienceClient.ts +++ b/lib/manage-audience/api/manageAudienceClient.ts @@ -1,3 +1,5 @@ + + /** * LINE Messaging API * This document describes LINE Messaging API. @@ -10,456 +12,518 @@ * Do not edit the class manually. */ + /* tslint:disable:no-unused-locals */ -import { AddAudienceToAudienceGroupRequest } from "../model/addAudienceToAudienceGroupRequest"; -import { AudienceGroupCreateRoute } from "../model/audienceGroupCreateRoute"; -import { AudienceGroupStatus } from "../model/audienceGroupStatus"; -import { CreateAudienceGroupRequest } from "../model/createAudienceGroupRequest"; -import { CreateAudienceGroupResponse } from "../model/createAudienceGroupResponse"; -import { CreateClickBasedAudienceGroupRequest } from "../model/createClickBasedAudienceGroupRequest"; -import { CreateClickBasedAudienceGroupResponse } from "../model/createClickBasedAudienceGroupResponse"; -import { CreateImpBasedAudienceGroupRequest } from "../model/createImpBasedAudienceGroupRequest"; -import { CreateImpBasedAudienceGroupResponse } from "../model/createImpBasedAudienceGroupResponse"; -import { ErrorResponse } from "../model/errorResponse"; -import { GetAudienceDataResponse } from "../model/getAudienceDataResponse"; -import { GetAudienceGroupAuthorityLevelResponse } from "../model/getAudienceGroupAuthorityLevelResponse"; -import { GetAudienceGroupsResponse } from "../model/getAudienceGroupsResponse"; -import { UpdateAudienceGroupAuthorityLevelRequest } from "../model/updateAudienceGroupAuthorityLevelRequest"; -import { UpdateAudienceGroupDescriptionRequest } from "../model/updateAudienceGroupDescriptionRequest"; - -import * as Types from "../../types"; -import { ensureJSON } from "../../utils"; -import { Readable } from "node:stream"; - -import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch"; +import { AddAudienceToAudienceGroupRequest } from '../model/addAudienceToAudienceGroupRequest.js'; +import { AudienceGroupCreateRoute } from '../model/audienceGroupCreateRoute.js'; +import { AudienceGroupStatus } from '../model/audienceGroupStatus.js'; +import { CreateAudienceGroupRequest } from '../model/createAudienceGroupRequest.js'; +import { CreateAudienceGroupResponse } from '../model/createAudienceGroupResponse.js'; +import { CreateClickBasedAudienceGroupRequest } from '../model/createClickBasedAudienceGroupRequest.js'; +import { CreateClickBasedAudienceGroupResponse } from '../model/createClickBasedAudienceGroupResponse.js'; +import { CreateImpBasedAudienceGroupRequest } from '../model/createImpBasedAudienceGroupRequest.js'; +import { CreateImpBasedAudienceGroupResponse } from '../model/createImpBasedAudienceGroupResponse.js'; +import { ErrorResponse } from '../model/errorResponse.js'; +import { GetAudienceDataResponse } from '../model/getAudienceDataResponse.js'; +import { GetAudienceGroupAuthorityLevelResponse } from '../model/getAudienceGroupAuthorityLevelResponse.js'; +import { GetAudienceGroupsResponse } from '../model/getAudienceGroupsResponse.js'; +import { UpdateAudienceGroupAuthorityLevelRequest } from '../model/updateAudienceGroupAuthorityLevelRequest.js'; +import { UpdateAudienceGroupDescriptionRequest } from '../model/updateAudienceGroupDescriptionRequest.js'; + +import * as Types from "../../types.js"; +import {ensureJSON} from "../../utils.js"; +import {Readable} from "node:stream"; + +import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch.js"; // =============================================== // This file is autogenerated - Please do not edit // =============================================== interface httpClientConfig { - baseURL?: string; - channelAccessToken: string; - // TODO support defaultHeaders? + baseURL?: string; + channelAccessToken: string; + // TODO support defaultHeaders? } + export class ManageAudienceClient { - private httpClient: HTTPFetchClient; + private httpClient: HTTPFetchClient; - constructor(config: httpClientConfig) { - if (!config.baseURL) { - config.baseURL = "https://api.line.me"; + constructor(config: httpClientConfig) { + if (!config.baseURL) { + config.baseURL = 'https://api.line.me'; + } + this.httpClient = new HTTPFetchClient({ + defaultHeaders: { + Authorization: "Bearer " + config.channelAccessToken, + }, + baseURL: config.baseURL, + }); } - this.httpClient = new HTTPFetchClient({ - defaultHeaders: { - Authorization: "Bearer " + config.channelAccessToken, - }, - baseURL: config.baseURL, - }); - } - - private async parseHTTPResponse(response: Response) { - const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; - let resBody: Record = { - ...(await response.json()), - }; - if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { - resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = response.headers.get( - LINE_REQUEST_ID_HTTP_HEADER_NAME, - ); + + private async parseHTTPResponse(response: Response) { + const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; + let resBody: Record = { + ...await response.json(), + }; + if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { + resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = + response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME); + } + return resBody; } - return resBody; - } - - /** - * Activate audience - * @param audienceGroupId The audience ID. - * - * @see Documentation - */ - public async activateAudienceGroup( - audienceGroupId: number, - ): Promise { - return (await this.activateAudienceGroupWithHttpInfo(audienceGroupId)).body; - } - - /** - * Activate audience. - * This method includes HttpInfo object to return additional information. - * @param audienceGroupId The audience ID. - * - * @see Documentation - */ - public async activateAudienceGroupWithHttpInfo( - audienceGroupId: number, - ): Promise> { - const res = await this.httpClient.put( - "/v2/bot/audienceGroup/{audienceGroupId}/activate".replace( - "{audienceGroupId}", - String(audienceGroupId), - ), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) - * @param addAudienceToAudienceGroupRequest - * - * @see Documentation - */ - public async addAudienceToAudienceGroup( - addAudienceToAudienceGroupRequest: AddAudienceToAudienceGroupRequest, - ): Promise { - return ( - await this.addAudienceToAudienceGroupWithHttpInfo( - addAudienceToAudienceGroupRequest, - ) - ).body; - } - - /** - * Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON). - * This method includes HttpInfo object to return additional information. - * @param addAudienceToAudienceGroupRequest - * - * @see Documentation - */ - public async addAudienceToAudienceGroupWithHttpInfo( - addAudienceToAudienceGroupRequest: AddAudienceToAudienceGroupRequest, - ): Promise> { + +/** + * Activate audience + * @param audienceGroupId The audience ID. + * + * @see Documentation + */ + public async activateAudienceGroup(audienceGroupId: number, ) : Promise { + return (await this.activateAudienceGroupWithHttpInfo(audienceGroupId, )).body; + } + + /** + * Activate audience. + * This method includes HttpInfo object to return additional information. + * @param audienceGroupId The audience ID. + * + * @see Documentation + */ + public async activateAudienceGroupWithHttpInfo(audienceGroupId: number, ) : Promise> { + + + + + + + + const res = await this.httpClient.put( + "/v2/bot/audienceGroup/{audienceGroupId}/activate" + + .replace("{audienceGroupId}", String(audienceGroupId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) + * @param addAudienceToAudienceGroupRequest + * + * @see Documentation + */ + public async addAudienceToAudienceGroup(addAudienceToAudienceGroupRequest: AddAudienceToAudienceGroupRequest, ) : Promise { + return (await this.addAudienceToAudienceGroupWithHttpInfo(addAudienceToAudienceGroupRequest, )).body; + } + + /** + * Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON). + * This method includes HttpInfo object to return additional information. + * @param addAudienceToAudienceGroupRequest + * + * @see Documentation + */ + public async addAudienceToAudienceGroupWithHttpInfo(addAudienceToAudienceGroupRequest: AddAudienceToAudienceGroupRequest, ) : Promise> { + + + + const params = addAudienceToAudienceGroupRequest; + + + + const res = await this.httpClient.put( + "/v2/bot/audienceGroup/upload" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Create audience for uploading user IDs (by JSON) + * @param createAudienceGroupRequest + * + * @see Documentation + */ + public async createAudienceGroup(createAudienceGroupRequest: CreateAudienceGroupRequest, ) : Promise { + return (await this.createAudienceGroupWithHttpInfo(createAudienceGroupRequest, )).body; + } + + /** + * Create audience for uploading user IDs (by JSON). + * This method includes HttpInfo object to return additional information. + * @param createAudienceGroupRequest + * + * @see Documentation + */ + public async createAudienceGroupWithHttpInfo(createAudienceGroupRequest: CreateAudienceGroupRequest, ) : Promise> { + + + - const res = await this.httpClient.put( - "/v2/bot/audienceGroup/upload", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Create audience for uploading user IDs (by JSON) - * @param createAudienceGroupRequest - * - * @see Documentation - */ - public async createAudienceGroup( - createAudienceGroupRequest: CreateAudienceGroupRequest, - ): Promise { - return ( - await this.createAudienceGroupWithHttpInfo(createAudienceGroupRequest) - ).body; - } - - /** - * Create audience for uploading user IDs (by JSON). - * This method includes HttpInfo object to return additional information. - * @param createAudienceGroupRequest - * - * @see Documentation - */ - public async createAudienceGroupWithHttpInfo( - createAudienceGroupRequest: CreateAudienceGroupRequest, - ): Promise> { const params = createAudienceGroupRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/audienceGroup/upload" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Create audience for click-based retargeting + * @param createClickBasedAudienceGroupRequest + * + * @see Documentation + */ + public async createClickBasedAudienceGroup(createClickBasedAudienceGroupRequest: CreateClickBasedAudienceGroupRequest, ) : Promise { + return (await this.createClickBasedAudienceGroupWithHttpInfo(createClickBasedAudienceGroupRequest, )).body; + } + + /** + * Create audience for click-based retargeting. + * This method includes HttpInfo object to return additional information. + * @param createClickBasedAudienceGroupRequest + * + * @see Documentation + */ + public async createClickBasedAudienceGroupWithHttpInfo(createClickBasedAudienceGroupRequest: CreateClickBasedAudienceGroupRequest, ) : Promise> { + + + - const res = await this.httpClient.post( - "/v2/bot/audienceGroup/upload", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Create audience for click-based retargeting - * @param createClickBasedAudienceGroupRequest - * - * @see Documentation - */ - public async createClickBasedAudienceGroup( - createClickBasedAudienceGroupRequest: CreateClickBasedAudienceGroupRequest, - ): Promise { - return ( - await this.createClickBasedAudienceGroupWithHttpInfo( - createClickBasedAudienceGroupRequest, - ) - ).body; - } - - /** - * Create audience for click-based retargeting. - * This method includes HttpInfo object to return additional information. - * @param createClickBasedAudienceGroupRequest - * - * @see Documentation - */ - public async createClickBasedAudienceGroupWithHttpInfo( - createClickBasedAudienceGroupRequest: CreateClickBasedAudienceGroupRequest, - ): Promise> { const params = createClickBasedAudienceGroupRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/audienceGroup/click" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Create audience for impression-based retargeting + * @param createImpBasedAudienceGroupRequest + * + * @see Documentation + */ + public async createImpBasedAudienceGroup(createImpBasedAudienceGroupRequest: CreateImpBasedAudienceGroupRequest, ) : Promise { + return (await this.createImpBasedAudienceGroupWithHttpInfo(createImpBasedAudienceGroupRequest, )).body; + } + + /** + * Create audience for impression-based retargeting. + * This method includes HttpInfo object to return additional information. + * @param createImpBasedAudienceGroupRequest + * + * @see Documentation + */ + public async createImpBasedAudienceGroupWithHttpInfo(createImpBasedAudienceGroupRequest: CreateImpBasedAudienceGroupRequest, ) : Promise> { + + + - const res = await this.httpClient.post( - "/v2/bot/audienceGroup/click", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Create audience for impression-based retargeting - * @param createImpBasedAudienceGroupRequest - * - * @see Documentation - */ - public async createImpBasedAudienceGroup( - createImpBasedAudienceGroupRequest: CreateImpBasedAudienceGroupRequest, - ): Promise { - return ( - await this.createImpBasedAudienceGroupWithHttpInfo( - createImpBasedAudienceGroupRequest, - ) - ).body; - } - - /** - * Create audience for impression-based retargeting. - * This method includes HttpInfo object to return additional information. - * @param createImpBasedAudienceGroupRequest - * - * @see Documentation - */ - public async createImpBasedAudienceGroupWithHttpInfo( - createImpBasedAudienceGroupRequest: CreateImpBasedAudienceGroupRequest, - ): Promise> { const params = createImpBasedAudienceGroupRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/audienceGroup/imp" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Delete audience + * @param audienceGroupId The audience ID. + * + * @see Documentation + */ + public async deleteAudienceGroup(audienceGroupId: number, ) : Promise { + return (await this.deleteAudienceGroupWithHttpInfo(audienceGroupId, )).body; + } + + /** + * Delete audience. + * This method includes HttpInfo object to return additional information. + * @param audienceGroupId The audience ID. + * + * @see Documentation + */ + public async deleteAudienceGroupWithHttpInfo(audienceGroupId: number, ) : Promise> { + + + + + + + + const res = await this.httpClient.delete( + "/v2/bot/audienceGroup/{audienceGroupId}" + + .replace("{audienceGroupId}", String(audienceGroupId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Gets audience data. + * @param audienceGroupId The audience ID. + * + * @see Documentation + */ + public async getAudienceData(audienceGroupId: number, ) : Promise { + return (await this.getAudienceDataWithHttpInfo(audienceGroupId, )).body; + } + + /** + * Gets audience data.. + * This method includes HttpInfo object to return additional information. + * @param audienceGroupId The audience ID. + * + * @see Documentation + */ + public async getAudienceDataWithHttpInfo(audienceGroupId: number, ) : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/audienceGroup/{audienceGroupId}" + + .replace("{audienceGroupId}", String(audienceGroupId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get the authority level of the audience + * + * @see Documentation + */ + public async getAudienceGroupAuthorityLevel() : Promise { + return (await this.getAudienceGroupAuthorityLevelWithHttpInfo()).body; + } + + /** + * Get the authority level of the audience. + * This method includes HttpInfo object to return additional information. + * + * @see Documentation + */ + public async getAudienceGroupAuthorityLevelWithHttpInfo() : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/audienceGroup/authorityLevel" + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Gets data for more than one audience. + * @param page The page to return when getting (paginated) results. Must be 1 or higher. + * @param description The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + * @param status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + * @param size The number of audiences per page. Default: 20 Max: 40 + * @param includesExternalPublicGroups true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. + * @param createRoute How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + * + * @see Documentation + */ + public async getAudienceGroups(page: number, description?: string, status?: AudienceGroupStatus, size?: number, includesExternalPublicGroups?: boolean, createRoute?: AudienceGroupCreateRoute, ) : Promise { + return (await this.getAudienceGroupsWithHttpInfo(page, description, status, size, includesExternalPublicGroups, createRoute, )).body; + } + + /** + * Gets data for more than one audience.. + * This method includes HttpInfo object to return additional information. + * @param page The page to return when getting (paginated) results. Must be 1 or higher. + * @param description The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + * @param status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + * @param size The number of audiences per page. Default: 20 Max: 40 + * @param includesExternalPublicGroups true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. + * @param createRoute How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + * + * @see Documentation + */ + public async getAudienceGroupsWithHttpInfo(page: number, description?: string, status?: AudienceGroupStatus, size?: number, includesExternalPublicGroups?: boolean, createRoute?: AudienceGroupCreateRoute, ) : Promise> { + + + - const res = await this.httpClient.post("/v2/bot/audienceGroup/imp", params); - return { httpResponse: res, body: await res.json() }; - } - /** - * Delete audience - * @param audienceGroupId The audience ID. - * - * @see Documentation - */ - public async deleteAudienceGroup( - audienceGroupId: number, - ): Promise { - return (await this.deleteAudienceGroupWithHttpInfo(audienceGroupId)).body; - } - - /** - * Delete audience. - * This method includes HttpInfo object to return additional information. - * @param audienceGroupId The audience ID. - * - * @see Documentation - */ - public async deleteAudienceGroupWithHttpInfo( - audienceGroupId: number, - ): Promise> { - const res = await this.httpClient.delete( - "/v2/bot/audienceGroup/{audienceGroupId}".replace( - "{audienceGroupId}", - String(audienceGroupId), - ), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Gets audience data. - * @param audienceGroupId The audience ID. - * - * @see Documentation - */ - public async getAudienceData( - audienceGroupId: number, - ): Promise { - return (await this.getAudienceDataWithHttpInfo(audienceGroupId)).body; - } - - /** - * Gets audience data.. - * This method includes HttpInfo object to return additional information. - * @param audienceGroupId The audience ID. - * - * @see Documentation - */ - public async getAudienceDataWithHttpInfo( - audienceGroupId: number, - ): Promise> { - const res = await this.httpClient.get( - "/v2/bot/audienceGroup/{audienceGroupId}".replace( - "{audienceGroupId}", - String(audienceGroupId), - ), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get the authority level of the audience - * - * @see Documentation - */ - public async getAudienceGroupAuthorityLevel(): Promise { - return (await this.getAudienceGroupAuthorityLevelWithHttpInfo()).body; - } - - /** - * Get the authority level of the audience. - * This method includes HttpInfo object to return additional information. - * - * @see Documentation - */ - public async getAudienceGroupAuthorityLevelWithHttpInfo(): Promise< - Types.ApiResponseType - > { - const res = await this.httpClient.get( - "/v2/bot/audienceGroup/authorityLevel", - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Gets data for more than one audience. - * @param page The page to return when getting (paginated) results. Must be 1 or higher. - * @param description The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. - * @param status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. - * @param size The number of audiences per page. Default: 20 Max: 40 - * @param includesExternalPublicGroups true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. - * @param createRoute How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. - * - * @see Documentation - */ - public async getAudienceGroups( - page: number, - description?: string, - status?: AudienceGroupStatus, - size?: number, - includesExternalPublicGroups?: boolean, - createRoute?: AudienceGroupCreateRoute, - ): Promise { - return ( - await this.getAudienceGroupsWithHttpInfo( - page, - description, - status, - size, - includesExternalPublicGroups, - createRoute, - ) - ).body; - } - - /** - * Gets data for more than one audience.. - * This method includes HttpInfo object to return additional information. - * @param page The page to return when getting (paginated) results. Must be 1 or higher. - * @param description The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. - * @param status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. - * @param size The number of audiences per page. Default: 20 Max: 40 - * @param includesExternalPublicGroups true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. - * @param createRoute How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. - * - * @see Documentation - */ - public async getAudienceGroupsWithHttpInfo( - page: number, - description?: string, - status?: AudienceGroupStatus, - size?: number, - includesExternalPublicGroups?: boolean, - createRoute?: AudienceGroupCreateRoute, - ): Promise> { const queryParams = { - page: page, - description: description, - status: status, - size: size, - includesExternalPublicGroups: includesExternalPublicGroups, - createRoute: createRoute, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/audienceGroup/list", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Change the authority level of the audience - * @param updateAudienceGroupAuthorityLevelRequest - * - * @see Documentation - */ - public async updateAudienceGroupAuthorityLevel( - updateAudienceGroupAuthorityLevelRequest: UpdateAudienceGroupAuthorityLevelRequest, - ): Promise { - return ( - await this.updateAudienceGroupAuthorityLevelWithHttpInfo( - updateAudienceGroupAuthorityLevelRequest, - ) - ).body; - } - - /** - * Change the authority level of the audience. - * This method includes HttpInfo object to return additional information. - * @param updateAudienceGroupAuthorityLevelRequest - * - * @see Documentation - */ - public async updateAudienceGroupAuthorityLevelWithHttpInfo( - updateAudienceGroupAuthorityLevelRequest: UpdateAudienceGroupAuthorityLevelRequest, - ): Promise> { + "page": page, + "description": description, + "status": status, + "size": size, + "includesExternalPublicGroups": includesExternalPublicGroups, + "createRoute": createRoute, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/audienceGroup/list" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Change the authority level of the audience + * @param updateAudienceGroupAuthorityLevelRequest + * + * @see Documentation + */ + public async updateAudienceGroupAuthorityLevel(updateAudienceGroupAuthorityLevelRequest: UpdateAudienceGroupAuthorityLevelRequest, ) : Promise { + return (await this.updateAudienceGroupAuthorityLevelWithHttpInfo(updateAudienceGroupAuthorityLevelRequest, )).body; + } + + /** + * Change the authority level of the audience. + * This method includes HttpInfo object to return additional information. + * @param updateAudienceGroupAuthorityLevelRequest + * + * @see Documentation + */ + public async updateAudienceGroupAuthorityLevelWithHttpInfo(updateAudienceGroupAuthorityLevelRequest: UpdateAudienceGroupAuthorityLevelRequest, ) : Promise> { + + + + const params = updateAudienceGroupAuthorityLevelRequest; + + + + const res = await this.httpClient.put( + "/v2/bot/audienceGroup/authorityLevel" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Renames an existing audience. + * @param audienceGroupId The audience ID. + * @param updateAudienceGroupDescriptionRequest + * + * @see Documentation + */ + public async updateAudienceGroupDescription(audienceGroupId: number, updateAudienceGroupDescriptionRequest: UpdateAudienceGroupDescriptionRequest, ) : Promise { + return (await this.updateAudienceGroupDescriptionWithHttpInfo(audienceGroupId, updateAudienceGroupDescriptionRequest, )).body; + } + + /** + * Renames an existing audience.. + * This method includes HttpInfo object to return additional information. + * @param audienceGroupId The audience ID. + * @param updateAudienceGroupDescriptionRequest + * + * @see Documentation + */ + public async updateAudienceGroupDescriptionWithHttpInfo(audienceGroupId: number, updateAudienceGroupDescriptionRequest: UpdateAudienceGroupDescriptionRequest, ) : Promise> { + + + - const res = await this.httpClient.put( - "/v2/bot/audienceGroup/authorityLevel", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Renames an existing audience. - * @param audienceGroupId The audience ID. - * @param updateAudienceGroupDescriptionRequest - * - * @see Documentation - */ - public async updateAudienceGroupDescription( - audienceGroupId: number, - updateAudienceGroupDescriptionRequest: UpdateAudienceGroupDescriptionRequest, - ): Promise { - return ( - await this.updateAudienceGroupDescriptionWithHttpInfo( - audienceGroupId, - updateAudienceGroupDescriptionRequest, - ) - ).body; - } - - /** - * Renames an existing audience.. - * This method includes HttpInfo object to return additional information. - * @param audienceGroupId The audience ID. - * @param updateAudienceGroupDescriptionRequest - * - * @see Documentation - */ - public async updateAudienceGroupDescriptionWithHttpInfo( - audienceGroupId: number, - updateAudienceGroupDescriptionRequest: UpdateAudienceGroupDescriptionRequest, - ): Promise> { const params = updateAudienceGroupDescriptionRequest; + + + + const res = await this.httpClient.put( + "/v2/bot/audienceGroup/{audienceGroupId}/updateDescription" + + .replace("{audienceGroupId}", String(audienceGroupId)) + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } - const res = await this.httpClient.put( - "/v2/bot/audienceGroup/{audienceGroupId}/updateDescription".replace( - "{audienceGroupId}", - String(audienceGroupId), - ), - params, - ); - return { httpResponse: res, body: await res.json() }; - } } diff --git a/lib/manage-audience/model/addAudienceToAudienceGroupRequest.ts b/lib/manage-audience/model/addAudienceToAudienceGroupRequest.ts index 296adde09..8ffe4c325 100644 --- a/lib/manage-audience/model/addAudienceToAudienceGroupRequest.ts +++ b/lib/manage-audience/model/addAudienceToAudienceGroupRequest.ts @@ -10,28 +10,39 @@ * Do not edit the class manually. */ -import { Audience } from "./audience"; + + import { Audience } from './audience.js'; + + /** * Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) */ -export type AddAudienceToAudienceGroupRequest = { - /** - * The audience ID. - * - * @see audienceGroupId Documentation - */ - audienceGroupId?: number /**/; - /** - * The audience\'s name. - * - * @see uploadDescription Documentation - */ - uploadDescription?: string /**/; - /** - * An array of up to 10,000 user IDs or IFAs. - * - * @see audiences Documentation - */ - audiences?: Array /**/; -}; +export type AddAudienceToAudienceGroupRequest = { + /** + * The audience ID. + * + * @see audienceGroupId Documentation + */ + 'audienceGroupId'?: number/**/; + /** + * The audience\'s name. + * + * @see uploadDescription Documentation + */ + 'uploadDescription'?: string/**/; + /** + * An array of up to 10,000 user IDs or IFAs. + * + * @see audiences Documentation + */ + 'audiences'?: Array/**/; + +} + + + + + + + diff --git a/lib/manage-audience/model/audience.ts b/lib/manage-audience/model/audience.ts index c1a7f189d..9eb39843a 100644 --- a/lib/manage-audience/model/audience.ts +++ b/lib/manage-audience/model/audience.ts @@ -10,12 +10,25 @@ * Do not edit the class manually. */ + + + + + /** * Audience */ -export type Audience = { - /** - * A user ID or IFA. You can specify an empty array. - */ - id?: string /**/; -}; +export type Audience = { + /** + * A user ID or IFA. You can specify an empty array. + */ + 'id'?: string/**/; + +} + + + + + + + diff --git a/lib/manage-audience/model/audienceGroup.ts b/lib/manage-audience/model/audienceGroup.ts index e0595dedb..a86c25a59 100644 --- a/lib/manage-audience/model/audienceGroup.ts +++ b/lib/manage-audience/model/audienceGroup.ts @@ -10,59 +10,80 @@ * Do not edit the class manually. */ -import { AudienceGroupCreateRoute } from "./audienceGroupCreateRoute"; -import { AudienceGroupFailedType } from "./audienceGroupFailedType"; -import { AudienceGroupPermission } from "./audienceGroupPermission"; -import { AudienceGroupStatus } from "./audienceGroupStatus"; -import { AudienceGroupType } from "./audienceGroupType"; + + import { AudienceGroupCreateRoute } from './audienceGroupCreateRoute.js';import { AudienceGroupFailedType } from './audienceGroupFailedType.js';import { AudienceGroupPermission } from './audienceGroupPermission.js';import { AudienceGroupStatus } from './audienceGroupStatus.js';import { AudienceGroupType } from './audienceGroupType.js'; + + /** * Audience group */ -export type AudienceGroup = { - /** - * The audience ID. - */ - audienceGroupId?: number /**/; - /** - */ - type?: AudienceGroupType /**/; - /** - * The audience\'s name. - */ - description?: string /**/; - /** - */ - status?: AudienceGroupStatus /**/; - /** - */ - failedType?: AudienceGroupFailedType | null /**/; - /** - * The number of users included in the audience. - */ - audienceCount?: number /**/; - /** - * When the audience was created (in UNIX time). - */ - created?: number /**/; - /** - * The request ID that was specified when the audience was created. This is only included when `audienceGroup.type` is CLICK or IMP. - */ - requestId?: string /**/; - /** - * The URL that was specified when the audience was created. This is only included when `audienceGroup.type` is CLICK and link URL is specified. - */ - clickUrl?: string /**/; - /** - * The value indicating the type of account to be sent, as specified when creating the audience for uploading user IDs. - */ - isIfaAudience?: boolean /**/; - /** - */ - permission?: AudienceGroupPermission /**/; - /** - */ - createRoute?: AudienceGroupCreateRoute /**/; -}; +export type AudienceGroup = { + /** + * The audience ID. + */ + 'audienceGroupId'?: number/**/; + /** + */ + 'type'?: AudienceGroupType/**/; + /** + * The audience\'s name. + */ + 'description'?: string/**/; + /** + */ + 'status'?: AudienceGroupStatus/**/; + /** + */ + 'failedType'?: AudienceGroupFailedType | null/**/; + /** + * The number of users included in the audience. + */ + 'audienceCount'?: number/**/; + /** + * When the audience was created (in UNIX time). + */ + 'created'?: number/**/; + /** + * The request ID that was specified when the audience was created. This is only included when `audienceGroup.type` is CLICK or IMP. + */ + 'requestId'?: string/**/; + /** + * The URL that was specified when the audience was created. This is only included when `audienceGroup.type` is CLICK and link URL is specified. + */ + 'clickUrl'?: string/**/; + /** + * The value indicating the type of account to be sent, as specified when creating the audience for uploading user IDs. + */ + 'isIfaAudience'?: boolean/**/; + /** + */ + 'permission'?: AudienceGroupPermission/**/; + /** + */ + 'createRoute'?: AudienceGroupCreateRoute/**/; + +} + + + +export namespace AudienceGroup { + + + + + + + + + + + + + +} + + + + -export namespace AudienceGroup {} diff --git a/lib/manage-audience/model/audienceGroupAuthorityLevel.ts b/lib/manage-audience/model/audienceGroupAuthorityLevel.ts index 3aa079ab1..506697d59 100644 --- a/lib/manage-audience/model/audienceGroupAuthorityLevel.ts +++ b/lib/manage-audience/model/audienceGroupAuthorityLevel.ts @@ -10,8 +10,22 @@ * Do not edit the class manually. */ + + + + + /** * authority level */ -export type AudienceGroupAuthorityLevel = "PUBLIC" | "PRIVATE"; + + + export type AudienceGroupAuthorityLevel = + 'PUBLIC' + | 'PRIVATE' + +; + + + diff --git a/lib/manage-audience/model/audienceGroupCreateRoute.ts b/lib/manage-audience/model/audienceGroupCreateRoute.ts index 2a18ae7a8..84eef9037 100644 --- a/lib/manage-audience/model/audienceGroupCreateRoute.ts +++ b/lib/manage-audience/model/audienceGroupCreateRoute.ts @@ -10,12 +10,24 @@ * Do not edit the class manually. */ + + + + + /** - * How the audience was created. One of: - `OA_MANAGER`: Audience created with [LINE Official Account Manager](https://manager.line.biz/). - `MESSAGING_API`: Audience created with Messaging API. - `POINT_AD`: Audience created with [LINE Points Ads](https://www.linebiz.com/jp/service/line-point-ad/) (Japanese only). - `AD_MANAGER`: Audience created with [LINE Ads](https://admanager.line.biz/). + * How the audience was created. One of: - `OA_MANAGER`: Audience created with [LINE Official Account Manager](https://manager.line.biz/). - `MESSAGING_API`: Audience created with Messaging API. - `POINT_AD`: Audience created with [LINE Points Ads](https://www.linebiz.com/jp/service/line-point-ad/) (Japanese only). - `AD_MANAGER`: Audience created with [LINE Ads](https://admanager.line.biz/). */ -export type AudienceGroupCreateRoute = - | "OA_MANAGER" - | "MESSAGING_API" - | "POINT_AD" - | "AD_MANAGER"; + + + export type AudienceGroupCreateRoute = + 'OA_MANAGER' + | 'MESSAGING_API' + | 'POINT_AD' + | 'AD_MANAGER' + +; + + + diff --git a/lib/manage-audience/model/audienceGroupFailedType.ts b/lib/manage-audience/model/audienceGroupFailedType.ts index 1ebca2af0..b706c8a50 100644 --- a/lib/manage-audience/model/audienceGroupFailedType.ts +++ b/lib/manage-audience/model/audienceGroupFailedType.ts @@ -10,11 +10,23 @@ * Do not edit the class manually. */ + + + + + /** * Failed type */ -export type AudienceGroupFailedType = - | "AUDIENCE_GROUP_AUDIENCE_INSUFFICIENT" - | "INTERNAL_ERROR" - | "null"; + + + export type AudienceGroupFailedType = + 'AUDIENCE_GROUP_AUDIENCE_INSUFFICIENT' + | 'INTERNAL_ERROR' + | 'null' + +; + + + diff --git a/lib/manage-audience/model/audienceGroupJob.ts b/lib/manage-audience/model/audienceGroupJob.ts index 2bf7a7a26..d95e09da8 100644 --- a/lib/manage-audience/model/audienceGroupJob.ts +++ b/lib/manage-audience/model/audienceGroupJob.ts @@ -10,59 +10,78 @@ * Do not edit the class manually. */ -import { AudienceGroupJobFailedType } from "./audienceGroupJobFailedType"; -import { AudienceGroupJobStatus } from "./audienceGroupJobStatus"; -import { AudienceGroupJobType } from "./audienceGroupJobType"; + + import { AudienceGroupJobFailedType } from './audienceGroupJobFailedType.js';import { AudienceGroupJobStatus } from './audienceGroupJobStatus.js';import { AudienceGroupJobType } from './audienceGroupJobType.js'; + + /** * Audience group job */ -export type AudienceGroupJob = { - /** - * A job ID. - * - * @see audienceGroupJobId Documentation - */ - audienceGroupJobId?: number /**/; - /** - * An audience ID. - * - * @see audienceGroupId Documentation - */ - audienceGroupId?: number /**/; - /** - * The job\'s description. - * - * @see description Documentation - */ - description?: string /**/; - /** - * - * @see type Documentation - */ - type?: AudienceGroupJobType /**/; - /** - * - * @see jobStatus Documentation - */ - jobStatus?: AudienceGroupJobStatus /**/; - /** - * - * @see failedType Documentation - */ - failedType?: AudienceGroupJobFailedType /**/; - /** - * The number of accounts (recipients) that were added or removed. - * - * @see audienceCount Documentation - */ - audienceCount?: number /**/; - /** - * When the job was created (in UNIX time). - * - * @see created Documentation - */ - created?: number /**/; -}; +export type AudienceGroupJob = { + /** + * A job ID. + * + * @see audienceGroupJobId Documentation + */ + 'audienceGroupJobId'?: number/**/; + /** + * An audience ID. + * + * @see audienceGroupId Documentation + */ + 'audienceGroupId'?: number/**/; + /** + * The job\'s description. + * + * @see description Documentation + */ + 'description'?: string/**/; + /** + * + * @see type Documentation + */ + 'type'?: AudienceGroupJobType/**/; + /** + * + * @see jobStatus Documentation + */ + 'jobStatus'?: AudienceGroupJobStatus/**/; + /** + * + * @see failedType Documentation + */ + 'failedType'?: AudienceGroupJobFailedType/**/; + /** + * The number of accounts (recipients) that were added or removed. + * + * @see audienceCount Documentation + */ + 'audienceCount'?: number/**/; + /** + * When the job was created (in UNIX time). + * + * @see created Documentation + */ + 'created'?: number/**/; + +} + + + +export namespace AudienceGroupJob { + + + + + + + + + +} + + + + -export namespace AudienceGroupJob {} diff --git a/lib/manage-audience/model/audienceGroupJobFailedType.ts b/lib/manage-audience/model/audienceGroupJobFailedType.ts index 29b60a95d..052e87bca 100644 --- a/lib/manage-audience/model/audienceGroupJobFailedType.ts +++ b/lib/manage-audience/model/audienceGroupJobFailedType.ts @@ -10,10 +10,22 @@ * Do not edit the class manually. */ + + + + + /** * Failed type */ -export type AudienceGroupJobFailedType = - | "INTERNAL_ERROR" - | "AUDIENCE_GROUP_AUDIENCE_INSUFFICIENT"; + + + export type AudienceGroupJobFailedType = + 'INTERNAL_ERROR' + | 'AUDIENCE_GROUP_AUDIENCE_INSUFFICIENT' + +; + + + diff --git a/lib/manage-audience/model/audienceGroupJobStatus.ts b/lib/manage-audience/model/audienceGroupJobStatus.ts index 85fd5f9f6..23af950da 100644 --- a/lib/manage-audience/model/audienceGroupJobStatus.ts +++ b/lib/manage-audience/model/audienceGroupJobStatus.ts @@ -10,12 +10,24 @@ * Do not edit the class manually. */ + + + + + /** * Job status */ -export type AudienceGroupJobStatus = - | "QUEUED" - | "WORKING" - | "FINISHED" - | "FAILED"; + + + export type AudienceGroupJobStatus = + 'QUEUED' + | 'WORKING' + | 'FINISHED' + | 'FAILED' + +; + + + diff --git a/lib/manage-audience/model/audienceGroupJobType.ts b/lib/manage-audience/model/audienceGroupJobType.ts index 2340d81f7..078a14f32 100644 --- a/lib/manage-audience/model/audienceGroupJobType.ts +++ b/lib/manage-audience/model/audienceGroupJobType.ts @@ -10,8 +10,21 @@ * Do not edit the class manually. */ + + + + + /** * Job Type */ -export type AudienceGroupJobType = "DIFF_ADD"; + + + export type AudienceGroupJobType = + 'DIFF_ADD' + +; + + + diff --git a/lib/manage-audience/model/audienceGroupPermission.ts b/lib/manage-audience/model/audienceGroupPermission.ts index 29e2db583..e1556b71d 100644 --- a/lib/manage-audience/model/audienceGroupPermission.ts +++ b/lib/manage-audience/model/audienceGroupPermission.ts @@ -10,8 +10,22 @@ * Do not edit the class manually. */ + + + + + /** * Permission */ -export type AudienceGroupPermission = "READ" | "READ_WRITE"; + + + export type AudienceGroupPermission = + 'READ' + | 'READ_WRITE' + +; + + + diff --git a/lib/manage-audience/model/audienceGroupStatus.ts b/lib/manage-audience/model/audienceGroupStatus.ts index 7126df890..985406879 100644 --- a/lib/manage-audience/model/audienceGroupStatus.ts +++ b/lib/manage-audience/model/audienceGroupStatus.ts @@ -10,14 +10,26 @@ * Do not edit the class manually. */ + + + + + /** * Status */ -export type AudienceGroupStatus = - | "IN_PROGRESS" - | "READY" - | "FAILED" - | "EXPIRED" - | "INACTIVE" - | "ACTIVATING"; + + + export type AudienceGroupStatus = + 'IN_PROGRESS' + | 'READY' + | 'FAILED' + | 'EXPIRED' + | 'INACTIVE' + | 'ACTIVATING' + +; + + + diff --git a/lib/manage-audience/model/audienceGroupType.ts b/lib/manage-audience/model/audienceGroupType.ts index efb50dc7d..ebe193c51 100644 --- a/lib/manage-audience/model/audienceGroupType.ts +++ b/lib/manage-audience/model/audienceGroupType.ts @@ -10,20 +10,32 @@ * Do not edit the class manually. */ + + + + + /** * Audience group type */ -export type AudienceGroupType = - | "UPLOAD" - | "CLICK" - | "IMP" - | "CHAT_TAG" - | "FRIEND_PATH" - | "RESERVATION" - | "APP_EVENT" - | "VIDEO_VIEW" - | "WEBTRAFFIC" - | "IMAGE_CLICK" - | "RICHMENU_IMP" - | "RICHMENU_CLICK"; + + + export type AudienceGroupType = + 'UPLOAD' + | 'CLICK' + | 'IMP' + | 'CHAT_TAG' + | 'FRIEND_PATH' + | 'RESERVATION' + | 'APP_EVENT' + | 'VIDEO_VIEW' + | 'WEBTRAFFIC' + | 'IMAGE_CLICK' + | 'RICHMENU_IMP' + | 'RICHMENU_CLICK' + +; + + + diff --git a/lib/manage-audience/model/createAudienceGroupRequest.ts b/lib/manage-audience/model/createAudienceGroupRequest.ts index 724078905..3cad09b59 100644 --- a/lib/manage-audience/model/createAudienceGroupRequest.ts +++ b/lib/manage-audience/model/createAudienceGroupRequest.ts @@ -10,34 +10,45 @@ * Do not edit the class manually. */ -import { Audience } from "./audience"; + + import { Audience } from './audience.js'; + + /** * Create audience for uploading user IDs (by JSON) */ -export type CreateAudienceGroupRequest = { - /** - * The audience\'s name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 - * - * @see description Documentation - */ - description?: string /**/; - /** - * To specify recipients by IFAs: set true. To specify recipients by user IDs: set false or omit isIfaAudience property. - * - * @see isIfaAudience Documentation - */ - isIfaAudience?: boolean /**/; - /** - * The description to register for the job (in jobs[].description). - * - * @see uploadDescription Documentation - */ - uploadDescription?: string /**/; - /** - * An array of user IDs or IFAs. Max number: 10,000 - * - * @see audiences Documentation - */ - audiences?: Array /**/; -}; +export type CreateAudienceGroupRequest = { + /** + * The audience\'s name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 + * + * @see description Documentation + */ + 'description'?: string/**/; + /** + * To specify recipients by IFAs: set true. To specify recipients by user IDs: set false or omit isIfaAudience property. + * + * @see isIfaAudience Documentation + */ + 'isIfaAudience'?: boolean/**/; + /** + * The description to register for the job (in jobs[].description). + * + * @see uploadDescription Documentation + */ + 'uploadDescription'?: string/**/; + /** + * An array of user IDs or IFAs. Max number: 10,000 + * + * @see audiences Documentation + */ + 'audiences'?: Array/**/; + +} + + + + + + + diff --git a/lib/manage-audience/model/createAudienceGroupResponse.ts b/lib/manage-audience/model/createAudienceGroupResponse.ts index 0697255c3..29df05570 100644 --- a/lib/manage-audience/model/createAudienceGroupResponse.ts +++ b/lib/manage-audience/model/createAudienceGroupResponse.ts @@ -10,63 +10,91 @@ * Do not edit the class manually. */ -import { AudienceGroupType } from "./audienceGroupType"; + + import { AudienceGroupType } from './audienceGroupType.js'; + + /** * Create audience for uploading user IDs (by JSON) */ -export type CreateAudienceGroupResponse = { - /** - * The audience ID. - * - * @see audienceGroupId Documentation - */ - audienceGroupId?: number /**/; - /** - * How the audience was created. `MESSAGING_API`: An audience created with Messaging API. - * - * @see createRoute Documentation - */ - createRoute?: CreateAudienceGroupResponse.CreateRouteEnum /**/; - /** - * - * @see type Documentation - */ - type?: AudienceGroupType /**/; - /** - * The audience\'s name. - * - * @see description Documentation - */ - description?: string /**/; - /** - * When the audience was created (in UNIX time). - * - * @see created Documentation - */ - created?: number /**/; - /** - * Audience\'s update permission. Audiences linked to the same channel will be READ_WRITE. `READ`: Can use only. `READ_WRITE`: Can use and update. - * - * @see permission Documentation - */ - permission?: CreateAudienceGroupResponse.PermissionEnum /**/; - /** - * Time of audience expiration. Only returned for specific audiences. - * - * @see expireTimestamp Documentation - */ - expireTimestamp?: number /**/; - /** - * The value indicating the type of account to be sent, as specified when creating the audience for uploading user IDs. One of: `true`: Accounts are specified with IFAs. `false` (default): Accounts are specified with user IDs. - * - * @see isIfaAudience Documentation - */ - isIfaAudience?: boolean /**/; -}; +export type CreateAudienceGroupResponse = { + /** + * The audience ID. + * + * @see audienceGroupId Documentation + */ + 'audienceGroupId'?: number/**/; + /** + * How the audience was created. `MESSAGING_API`: An audience created with Messaging API. + * + * @see createRoute Documentation + */ + 'createRoute'?: CreateAudienceGroupResponse.CreateRouteEnum/**/; + /** + * + * @see type Documentation + */ + 'type'?: AudienceGroupType/**/; + /** + * The audience\'s name. + * + * @see description Documentation + */ + 'description'?: string/**/; + /** + * When the audience was created (in UNIX time). + * + * @see created Documentation + */ + 'created'?: number/**/; + /** + * Audience\'s update permission. Audiences linked to the same channel will be READ_WRITE. `READ`: Can use only. `READ_WRITE`: Can use and update. + * + * @see permission Documentation + */ + 'permission'?: CreateAudienceGroupResponse.PermissionEnum/**/; + /** + * Time of audience expiration. Only returned for specific audiences. + * + * @see expireTimestamp Documentation + */ + 'expireTimestamp'?: number/**/; + /** + * The value indicating the type of account to be sent, as specified when creating the audience for uploading user IDs. One of: `true`: Accounts are specified with IFAs. `false` (default): Accounts are specified with user IDs. + * + * @see isIfaAudience Documentation + */ + 'isIfaAudience'?: boolean/**/; + +} + + export namespace CreateAudienceGroupResponse { - export type CreateRouteEnum = "MESSAGING_API"; - - export type PermissionEnum = "READ" | "READ_WRITE"; + + export type CreateRouteEnum = + 'MESSAGING_API' + + + ; + + + + + export type PermissionEnum = + 'READ' + | 'READ_WRITE' + + + ; + + + + } + + + + + diff --git a/lib/manage-audience/model/createClickBasedAudienceGroupRequest.ts b/lib/manage-audience/model/createClickBasedAudienceGroupRequest.ts index 6c5a97b77..665534af1 100644 --- a/lib/manage-audience/model/createClickBasedAudienceGroupRequest.ts +++ b/lib/manage-audience/model/createClickBasedAudienceGroupRequest.ts @@ -10,26 +10,39 @@ * Do not edit the class manually. */ + + + + + /** * Create audience for click-based retargeting */ -export type CreateClickBasedAudienceGroupRequest = { - /** - * The audience\'s name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 - * - * @see description Documentation - */ - description?: string /**/; - /** - * The request ID of a broadcast or narrowcast message sent in the past 60 days. Each Messaging API request has a request ID. - * - * @see requestId Documentation - */ - requestId?: string /**/; - /** - * The URL clicked by the user. If empty, users who clicked any URL in the message are added to the list of recipients. Max character limit: 2,000 - * - * @see clickUrl Documentation - */ - clickUrl?: string /**/; -}; +export type CreateClickBasedAudienceGroupRequest = { + /** + * The audience\'s name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 + * + * @see description Documentation + */ + 'description'?: string/**/; + /** + * The request ID of a broadcast or narrowcast message sent in the past 60 days. Each Messaging API request has a request ID. + * + * @see requestId Documentation + */ + 'requestId'?: string/**/; + /** + * The URL clicked by the user. If empty, users who clicked any URL in the message are added to the list of recipients. Max character limit: 2,000 + * + * @see clickUrl Documentation + */ + 'clickUrl'?: string/**/; + +} + + + + + + + diff --git a/lib/manage-audience/model/createClickBasedAudienceGroupResponse.ts b/lib/manage-audience/model/createClickBasedAudienceGroupResponse.ts index 4ee7125f2..15b1e10f7 100644 --- a/lib/manage-audience/model/createClickBasedAudienceGroupResponse.ts +++ b/lib/manage-audience/model/createClickBasedAudienceGroupResponse.ts @@ -10,75 +10,105 @@ * Do not edit the class manually. */ -import { AudienceGroupType } from "./audienceGroupType"; + + import { AudienceGroupType } from './audienceGroupType.js'; + + /** * Create audience for click-based retargeting */ -export type CreateClickBasedAudienceGroupResponse = { - /** - * The audience ID. - * - * @see audienceGroupId Documentation - */ - audienceGroupId?: number /**/; - /** - * - * @see type Documentation - */ - type?: AudienceGroupType /**/; - /** - * The audience\'s name. - * - * @see description Documentation - */ - description?: string /**/; - /** - * When the audience was created (in UNIX time). - * - * @see created Documentation - */ - created?: number /**/; - /** - * The request ID that was specified when the audience was created. - * - * @see requestId Documentation - */ - requestId?: string /**/; - /** - * The URL that was specified when the audience was created. - * - * @see clickUrl Documentation - */ - clickUrl?: string /**/; - /** - * How the audience was created. `MESSAGING_API`: An audience created with Messaging API. - * - * @see createRoute Documentation - */ - createRoute?: CreateClickBasedAudienceGroupResponse.CreateRouteEnum /**/; - /** - * Audience\'s update permission. Audiences linked to the same channel will be READ_WRITE. - `READ`: Can use only. - `READ_WRITE`: Can use and update. - * - * @see permission Documentation - */ - permission?: CreateClickBasedAudienceGroupResponse.PermissionEnum /**/; - /** - * Time of audience expiration. Only returned for specific audiences. - * - * @see expireTimestamp Documentation - */ - expireTimestamp?: number /**/; - /** - * The value indicating the type of account to be sent, as specified when creating the audience for uploading user IDs. One of: true: Accounts are specified with IFAs. false (default): Accounts are specified with user IDs. - * - * @see isIfaAudience Documentation - */ - isIfaAudience?: boolean /* = false*/; -}; +export type CreateClickBasedAudienceGroupResponse = { + /** + * The audience ID. + * + * @see audienceGroupId Documentation + */ + 'audienceGroupId'?: number/**/; + /** + * + * @see type Documentation + */ + 'type'?: AudienceGroupType/**/; + /** + * The audience\'s name. + * + * @see description Documentation + */ + 'description'?: string/**/; + /** + * When the audience was created (in UNIX time). + * + * @see created Documentation + */ + 'created'?: number/**/; + /** + * The request ID that was specified when the audience was created. + * + * @see requestId Documentation + */ + 'requestId'?: string/**/; + /** + * The URL that was specified when the audience was created. + * + * @see clickUrl Documentation + */ + 'clickUrl'?: string/**/; + /** + * How the audience was created. `MESSAGING_API`: An audience created with Messaging API. + * + * @see createRoute Documentation + */ + 'createRoute'?: CreateClickBasedAudienceGroupResponse.CreateRouteEnum/**/; + /** + * Audience\'s update permission. Audiences linked to the same channel will be READ_WRITE. - `READ`: Can use only. - `READ_WRITE`: Can use and update. + * + * @see permission Documentation + */ + 'permission'?: CreateClickBasedAudienceGroupResponse.PermissionEnum/**/; + /** + * Time of audience expiration. Only returned for specific audiences. + * + * @see expireTimestamp Documentation + */ + 'expireTimestamp'?: number/**/; + /** + * The value indicating the type of account to be sent, as specified when creating the audience for uploading user IDs. One of: true: Accounts are specified with IFAs. false (default): Accounts are specified with user IDs. + * + * @see isIfaAudience Documentation + */ + 'isIfaAudience'?: boolean/* = false*/; + +} + + export namespace CreateClickBasedAudienceGroupResponse { - export type CreateRouteEnum = "MESSAGING_API"; - - export type PermissionEnum = "READ" | "READ_WRITE"; + + + + + + + export type CreateRouteEnum = + 'MESSAGING_API' + + + ; + + export type PermissionEnum = + 'READ' + | 'READ_WRITE' + + + ; + + + + } + + + + + diff --git a/lib/manage-audience/model/createImpBasedAudienceGroupRequest.ts b/lib/manage-audience/model/createImpBasedAudienceGroupRequest.ts index 4a13fef1c..60769852b 100644 --- a/lib/manage-audience/model/createImpBasedAudienceGroupRequest.ts +++ b/lib/manage-audience/model/createImpBasedAudienceGroupRequest.ts @@ -10,20 +10,33 @@ * Do not edit the class manually. */ + + + + + /** * Create audience for impression-based retargeting */ -export type CreateImpBasedAudienceGroupRequest = { - /** - * The audience\'s name. This is case-insensitive, meaning `AUDIENCE` and `audience` are considered identical. Max character limit: 120 - * - * @see description Documentation - */ - description?: string /**/; - /** - * The request ID of a broadcast or narrowcast message sent in the past 60 days. Each Messaging API request has a request ID. - * - * @see requestId Documentation - */ - requestId?: string /**/; -}; +export type CreateImpBasedAudienceGroupRequest = { + /** + * The audience\'s name. This is case-insensitive, meaning `AUDIENCE` and `audience` are considered identical. Max character limit: 120 + * + * @see description Documentation + */ + 'description'?: string/**/; + /** + * The request ID of a broadcast or narrowcast message sent in the past 60 days. Each Messaging API request has a request ID. + * + * @see requestId Documentation + */ + 'requestId'?: string/**/; + +} + + + + + + + diff --git a/lib/manage-audience/model/createImpBasedAudienceGroupResponse.ts b/lib/manage-audience/model/createImpBasedAudienceGroupResponse.ts index 2f949fd03..1401f448b 100644 --- a/lib/manage-audience/model/createImpBasedAudienceGroupResponse.ts +++ b/lib/manage-audience/model/createImpBasedAudienceGroupResponse.ts @@ -10,41 +10,59 @@ * Do not edit the class manually. */ -import { AudienceGroupType } from "./audienceGroupType"; + + import { AudienceGroupType } from './audienceGroupType.js'; + + /** * Create audience for impression-based retargeting */ -export type CreateImpBasedAudienceGroupResponse = { - /** - * The audience ID. - * - * @see audienceGroupId Documentation - */ - audienceGroupId?: number /**/; - /** - * - * @see type Documentation - */ - type?: AudienceGroupType /**/; - /** - * The audience\'s name. - * - * @see description Documentation - */ - description?: string /**/; - /** - * When the audience was created (in UNIX time). - * - * @see created Documentation - */ - created?: number /**/; - /** - * The request ID that was specified when the audience was created. - * - * @see requestId Documentation - */ - requestId?: string /**/; -}; - -export namespace CreateImpBasedAudienceGroupResponse {} +export type CreateImpBasedAudienceGroupResponse = { + /** + * The audience ID. + * + * @see audienceGroupId Documentation + */ + 'audienceGroupId'?: number/**/; + /** + * + * @see type Documentation + */ + 'type'?: AudienceGroupType/**/; + /** + * The audience\'s name. + * + * @see description Documentation + */ + 'description'?: string/**/; + /** + * When the audience was created (in UNIX time). + * + * @see created Documentation + */ + 'created'?: number/**/; + /** + * The request ID that was specified when the audience was created. + * + * @see requestId Documentation + */ + 'requestId'?: string/**/; + +} + + + +export namespace CreateImpBasedAudienceGroupResponse { + + + + + + +} + + + + + diff --git a/lib/manage-audience/model/errorDetail.ts b/lib/manage-audience/model/errorDetail.ts index 8def5ece3..107413406 100644 --- a/lib/manage-audience/model/errorDetail.ts +++ b/lib/manage-audience/model/errorDetail.ts @@ -10,13 +10,26 @@ * Do not edit the class manually. */ -export type ErrorDetail = { - /** - * Details of the error. Not included in the response under certain situations. - */ - message?: string /**/; - /** - * Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations. - */ - property?: string /**/; -}; + + + + + +export type ErrorDetail = { + /** + * Details of the error. Not included in the response under certain situations. + */ + 'message'?: string/**/; + /** + * Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations. + */ + 'property'?: string/**/; + +} + + + + + + + diff --git a/lib/manage-audience/model/errorResponse.ts b/lib/manage-audience/model/errorResponse.ts index 3c6763bbe..b63add7ab 100644 --- a/lib/manage-audience/model/errorResponse.ts +++ b/lib/manage-audience/model/errorResponse.ts @@ -10,19 +10,30 @@ * Do not edit the class manually. */ -import { ErrorDetail } from "./errorDetail"; - -export type ErrorResponse = { - /** - * Message containing information about the error. - * - * @see message Documentation - */ - message: string /**/; - /** - * An array of error details. If the array is empty, this property will not be included in the response. - * - * @see details Documentation - */ - details?: Array /**/; -}; + + + import { ErrorDetail } from './errorDetail.js'; + + +export type ErrorResponse = { + /** + * Message containing information about the error. + * + * @see message Documentation + */ + 'message': string/**/; + /** + * An array of error details. If the array is empty, this property will not be included in the response. + * + * @see details Documentation + */ + 'details'?: Array/**/; + +} + + + + + + + diff --git a/lib/manage-audience/model/getAudienceDataResponse.ts b/lib/manage-audience/model/getAudienceDataResponse.ts index 221536d07..a8ee982da 100644 --- a/lib/manage-audience/model/getAudienceDataResponse.ts +++ b/lib/manage-audience/model/getAudienceDataResponse.ts @@ -10,22 +10,32 @@ * Do not edit the class manually. */ -import { AudienceGroup } from "./audienceGroup"; -import { AudienceGroupJob } from "./audienceGroupJob"; + + import { AudienceGroup } from './audienceGroup.js';import { AudienceGroupJob } from './audienceGroupJob.js'; + + /** * Get audience data */ -export type GetAudienceDataResponse = { - /** - * - * @see audienceGroup Documentation - */ - audienceGroup?: AudienceGroup /**/; - /** - * An array of jobs. This array is used to keep track of each attempt to add new user IDs or IFAs to an audience for uploading user IDs. Empty array is returned for any other type of audience. Max: 50 - * - * @see jobs Documentation - */ - jobs?: Array /**/; -}; +export type GetAudienceDataResponse = { + /** + * + * @see audienceGroup Documentation + */ + 'audienceGroup'?: AudienceGroup/**/; + /** + * An array of jobs. This array is used to keep track of each attempt to add new user IDs or IFAs to an audience for uploading user IDs. Empty array is returned for any other type of audience. Max: 50 + * + * @see jobs Documentation + */ + 'jobs'?: Array/**/; + +} + + + + + + + diff --git a/lib/manage-audience/model/getAudienceGroupAuthorityLevelResponse.ts b/lib/manage-audience/model/getAudienceGroupAuthorityLevelResponse.ts index 35f203824..96e5dd126 100644 --- a/lib/manage-audience/model/getAudienceGroupAuthorityLevelResponse.ts +++ b/lib/manage-audience/model/getAudienceGroupAuthorityLevelResponse.ts @@ -10,17 +10,31 @@ * Do not edit the class manually. */ -import { AudienceGroupAuthorityLevel } from "./audienceGroupAuthorityLevel"; + + import { AudienceGroupAuthorityLevel } from './audienceGroupAuthorityLevel.js'; + + /** * Get the authority level of the audience */ -export type GetAudienceGroupAuthorityLevelResponse = { - /** - * - * @see authorityLevel Documentation - */ - authorityLevel?: AudienceGroupAuthorityLevel /**/; -}; - -export namespace GetAudienceGroupAuthorityLevelResponse {} +export type GetAudienceGroupAuthorityLevelResponse = { + /** + * + * @see authorityLevel Documentation + */ + 'authorityLevel'?: AudienceGroupAuthorityLevel/**/; + +} + + + +export namespace GetAudienceGroupAuthorityLevelResponse { + + +} + + + + + diff --git a/lib/manage-audience/model/getAudienceGroupsResponse.ts b/lib/manage-audience/model/getAudienceGroupsResponse.ts index 7307e811f..d30f0de82 100644 --- a/lib/manage-audience/model/getAudienceGroupsResponse.ts +++ b/lib/manage-audience/model/getAudienceGroupsResponse.ts @@ -10,46 +10,57 @@ * Do not edit the class manually. */ -import { AudienceGroup } from "./audienceGroup"; + + import { AudienceGroup } from './audienceGroup.js'; + + /** * Gets data for more than one audience. */ -export type GetAudienceGroupsResponse = { - /** - * An array of audience data. If there are no audiences that match the specified filter, an empty array will be returned. - * - * @see audienceGroups Documentation - */ - audienceGroups?: Array /**/; - /** - * true when this is not the last page. - * - * @see hasNextPage Documentation - */ - hasNextPage?: boolean /**/; - /** - * The total number of audiences that can be returned with the specified filter. - * - * @see totalCount Documentation - */ - totalCount?: number /**/; - /** - * Of the audiences you can get with the specified filter, the number of audiences with the update permission set to READ_WRITE. - * - * @see readWriteAudienceGroupTotalCount Documentation - */ - readWriteAudienceGroupTotalCount?: number /**/; - /** - * The current page number. - * - * @see page Documentation - */ - page?: number /**/; - /** - * The maximum number of audiences on the current page. - * - * @see size Documentation - */ - size?: number /**/; -}; +export type GetAudienceGroupsResponse = { + /** + * An array of audience data. If there are no audiences that match the specified filter, an empty array will be returned. + * + * @see audienceGroups Documentation + */ + 'audienceGroups'?: Array/**/; + /** + * true when this is not the last page. + * + * @see hasNextPage Documentation + */ + 'hasNextPage'?: boolean/**/; + /** + * The total number of audiences that can be returned with the specified filter. + * + * @see totalCount Documentation + */ + 'totalCount'?: number/**/; + /** + * Of the audiences you can get with the specified filter, the number of audiences with the update permission set to READ_WRITE. + * + * @see readWriteAudienceGroupTotalCount Documentation + */ + 'readWriteAudienceGroupTotalCount'?: number/**/; + /** + * The current page number. + * + * @see page Documentation + */ + 'page'?: number/**/; + /** + * The maximum number of audiences on the current page. + * + * @see size Documentation + */ + 'size'?: number/**/; + +} + + + + + + + diff --git a/lib/manage-audience/model/models.ts b/lib/manage-audience/model/models.ts index 7fd0566c7..ec5d48881 100644 --- a/lib/manage-audience/model/models.ts +++ b/lib/manage-audience/model/models.ts @@ -1,26 +1,2 @@ -export * from "./addAudienceToAudienceGroupRequest"; -export * from "./audience"; -export * from "./audienceGroup"; -export * from "./audienceGroupAuthorityLevel"; -export * from "./audienceGroupCreateRoute"; -export * from "./audienceGroupFailedType"; -export * from "./audienceGroupJob"; -export * from "./audienceGroupJobFailedType"; -export * from "./audienceGroupJobStatus"; -export * from "./audienceGroupJobType"; -export * from "./audienceGroupPermission"; -export * from "./audienceGroupStatus"; -export * from "./audienceGroupType"; -export * from "./createAudienceGroupRequest"; -export * from "./createAudienceGroupResponse"; -export * from "./createClickBasedAudienceGroupRequest"; -export * from "./createClickBasedAudienceGroupResponse"; -export * from "./createImpBasedAudienceGroupRequest"; -export * from "./createImpBasedAudienceGroupResponse"; -export * from "./errorDetail"; -export * from "./errorResponse"; -export * from "./getAudienceDataResponse"; -export * from "./getAudienceGroupAuthorityLevelResponse"; -export * from "./getAudienceGroupsResponse"; -export * from "./updateAudienceGroupAuthorityLevelRequest"; -export * from "./updateAudienceGroupDescriptionRequest"; + +export * from './addAudienceToAudienceGroupRequest.js';export * from './audience.js';export * from './audienceGroup.js';export * from './audienceGroupAuthorityLevel.js';export * from './audienceGroupCreateRoute.js';export * from './audienceGroupFailedType.js';export * from './audienceGroupJob.js';export * from './audienceGroupJobFailedType.js';export * from './audienceGroupJobStatus.js';export * from './audienceGroupJobType.js';export * from './audienceGroupPermission.js';export * from './audienceGroupStatus.js';export * from './audienceGroupType.js';export * from './createAudienceGroupRequest.js';export * from './createAudienceGroupResponse.js';export * from './createClickBasedAudienceGroupRequest.js';export * from './createClickBasedAudienceGroupResponse.js';export * from './createImpBasedAudienceGroupRequest.js';export * from './createImpBasedAudienceGroupResponse.js';export * from './errorDetail.js';export * from './errorResponse.js';export * from './getAudienceDataResponse.js';export * from './getAudienceGroupAuthorityLevelResponse.js';export * from './getAudienceGroupsResponse.js';export * from './updateAudienceGroupAuthorityLevelRequest.js';export * from './updateAudienceGroupDescriptionRequest.js'; diff --git a/lib/manage-audience/model/updateAudienceGroupAuthorityLevelRequest.ts b/lib/manage-audience/model/updateAudienceGroupAuthorityLevelRequest.ts index 2879db757..3695e4dca 100644 --- a/lib/manage-audience/model/updateAudienceGroupAuthorityLevelRequest.ts +++ b/lib/manage-audience/model/updateAudienceGroupAuthorityLevelRequest.ts @@ -10,17 +10,31 @@ * Do not edit the class manually. */ -import { AudienceGroupAuthorityLevel } from "./audienceGroupAuthorityLevel"; + + import { AudienceGroupAuthorityLevel } from './audienceGroupAuthorityLevel.js'; + + /** * Change the authority level of the audience */ -export type UpdateAudienceGroupAuthorityLevelRequest = { - /** - * - * @see authorityLevel Documentation - */ - authorityLevel?: AudienceGroupAuthorityLevel /**/; -}; - -export namespace UpdateAudienceGroupAuthorityLevelRequest {} +export type UpdateAudienceGroupAuthorityLevelRequest = { + /** + * + * @see authorityLevel Documentation + */ + 'authorityLevel'?: AudienceGroupAuthorityLevel/**/; + +} + + + +export namespace UpdateAudienceGroupAuthorityLevelRequest { + + +} + + + + + diff --git a/lib/manage-audience/model/updateAudienceGroupDescriptionRequest.ts b/lib/manage-audience/model/updateAudienceGroupDescriptionRequest.ts index f77bb302b..d24d63029 100644 --- a/lib/manage-audience/model/updateAudienceGroupDescriptionRequest.ts +++ b/lib/manage-audience/model/updateAudienceGroupDescriptionRequest.ts @@ -10,14 +10,27 @@ * Do not edit the class manually. */ + + + + + /** * Rename an audience */ -export type UpdateAudienceGroupDescriptionRequest = { - /** - * The audience\'s name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 - * - * @see description Documentation - */ - description?: string /**/; -}; +export type UpdateAudienceGroupDescriptionRequest = { + /** + * The audience\'s name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 + * + * @see description Documentation + */ + 'description'?: string/**/; + +} + + + + + + + diff --git a/lib/manage-audience/tests/api/ManageAudienceBlobClientTest.spec.ts b/lib/manage-audience/tests/api/ManageAudienceBlobClientTest.spec.ts index ebf6cad8f..fc305b89b 100644 --- a/lib/manage-audience/tests/api/ManageAudienceBlobClientTest.spec.ts +++ b/lib/manage-audience/tests/api/ManageAudienceBlobClientTest.spec.ts @@ -1,15 +1,28 @@ -import { ManageAudienceBlobClient } from "../../api"; -import { CreateAudienceGroupResponse } from "../../model/createAudienceGroupResponse"; + +import { ManageAudienceBlobClient } from "../../api.js"; + +import { CreateAudienceGroupResponse } from '../../model/createAudienceGroupResponse.js'; + import { createServer } from "node:http"; import { deepEqual, equal, ok } from "node:assert"; -const pkg = require("../../../../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../../../../package.json"); const channel_access_token = "test_channel_access_token"; + + + + describe("ManageAudienceBlobClient", () => { + + + + it("addUserIdsToAudienceWithHttpInfo", async () => { let requestCount = 0; @@ -18,55 +31,74 @@ describe("ManageAudienceBlobClient", () => { equal(req.method, "PUT"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/audienceGroup/upload/byFile" - .replace("{audienceGroupId}", "0") // number - .replace("{uploadDescription}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/upload/byFile" + .replace("{audienceGroupId}", "0") // number + .replace("{uploadDescription}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + ok( - req.headers["content-type"].startsWith( - `multipart/form-data; boundary=`, - ), + req.headers["content-type"] + .startsWith(`multipart/form-data; boundary=`), ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceBlobClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.addUserIdsToAudienceWithHttpInfo( - // file: Blob - new Blob([]), // paramName=file - // audienceGroupId: number - 0, // paramName=audienceGroupId(number or int or long) - // uploadDescription: string - "DUMMY", // uploadDescription(string) + // file: Blob + new Blob([]), // paramName=file + + + + // audienceGroupId: number + 0, // paramName=audienceGroupId(number or int or long) + + + + // uploadDescription: string + "DUMMY", // uploadDescription(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("addUserIdsToAudience", async () => { let requestCount = 0; @@ -75,55 +107,75 @@ describe("ManageAudienceBlobClient", () => { equal(req.method, "PUT"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/audienceGroup/upload/byFile" - .replace("{audienceGroupId}", "0") // number - .replace("{uploadDescription}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/upload/byFile" + .replace("{audienceGroupId}", "0") // number + .replace("{uploadDescription}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + ok( - req.headers["content-type"].startsWith( - `multipart/form-data; boundary=`, - ), + req.headers["content-type"] + .startsWith(`multipart/form-data; boundary=`), ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceBlobClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.addUserIdsToAudience( - // file: Blob - new Blob([]), // paramName=file - // audienceGroupId: number - 0, // paramName=audienceGroupId(number or int or long) - // uploadDescription: string - "DUMMY", // uploadDescription(string) + // file: Blob + new Blob([]), // paramName=file + + + + // audienceGroupId: number + 0, // paramName=audienceGroupId(number or int or long) + + + + // uploadDescription: string + "DUMMY", // uploadDescription(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("createAudienceForUploadingUserIdsWithHttpInfo", async () => { let requestCount = 0; @@ -132,58 +184,79 @@ describe("ManageAudienceBlobClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/audienceGroup/upload/byFile" - .replace("{description}", "DUMMY") // string - .replace("{uploadDescription}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/upload/byFile" + .replace("{description}", "DUMMY") // string + .replace("{uploadDescription}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + ok( - req.headers["content-type"].startsWith( - `multipart/form-data; boundary=`, - ), + req.headers["content-type"] + .startsWith(`multipart/form-data; boundary=`), ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceBlobClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.createAudienceForUploadingUserIdsWithHttpInfo( - // file: Blob - new Blob([]), // paramName=file - // description: string - "DUMMY", // description(string) - // isIfaAudience: boolean - true, // paramName=isIfaAudience + // file: Blob + new Blob([]), // paramName=file + + + + // description: string + "DUMMY", // description(string) + + + + // isIfaAudience: boolean + true, // paramName=isIfaAudience + + + + // uploadDescription: string + "DUMMY", // uploadDescription(string) + - // uploadDescription: string - "DUMMY", // uploadDescription(string) ); equal(requestCount, 1); server.close(); }); + + + + it("createAudienceForUploadingUserIds", async () => { let requestCount = 0; @@ -192,55 +265,75 @@ describe("ManageAudienceBlobClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/audienceGroup/upload/byFile" - .replace("{description}", "DUMMY") // string - .replace("{uploadDescription}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/upload/byFile" + .replace("{description}", "DUMMY") // string + .replace("{uploadDescription}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + ok( - req.headers["content-type"].startsWith( - `multipart/form-data; boundary=`, - ), + req.headers["content-type"] + .startsWith(`multipart/form-data; boundary=`), ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceBlobClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.createAudienceForUploadingUserIds( - // file: Blob - new Blob([]), // paramName=file - // description: string - "DUMMY", // description(string) - // isIfaAudience: boolean - true, // paramName=isIfaAudience + // file: Blob + new Blob([]), // paramName=file + + + + // description: string + "DUMMY", // description(string) + + + + // isIfaAudience: boolean + true, // paramName=isIfaAudience + + + + // uploadDescription: string + "DUMMY", // uploadDescription(string) + - // uploadDescription: string - "DUMMY", // uploadDescription(string) ); equal(requestCount, 1); server.close(); }); + + + }); diff --git a/lib/manage-audience/tests/api/ManageAudienceClientTest.spec.ts b/lib/manage-audience/tests/api/ManageAudienceClientTest.spec.ts index 52139b855..4266fc82b 100644 --- a/lib/manage-audience/tests/api/ManageAudienceClientTest.spec.ts +++ b/lib/manage-audience/tests/api/ManageAudienceClientTest.spec.ts @@ -1,29 +1,42 @@ -import { ManageAudienceClient } from "../../api"; - -import { AddAudienceToAudienceGroupRequest } from "../../model/addAudienceToAudienceGroupRequest"; -import { AudienceGroupCreateRoute } from "../../model/audienceGroupCreateRoute"; -import { AudienceGroupStatus } from "../../model/audienceGroupStatus"; -import { CreateAudienceGroupRequest } from "../../model/createAudienceGroupRequest"; -import { CreateAudienceGroupResponse } from "../../model/createAudienceGroupResponse"; -import { CreateClickBasedAudienceGroupRequest } from "../../model/createClickBasedAudienceGroupRequest"; -import { CreateClickBasedAudienceGroupResponse } from "../../model/createClickBasedAudienceGroupResponse"; -import { CreateImpBasedAudienceGroupRequest } from "../../model/createImpBasedAudienceGroupRequest"; -import { CreateImpBasedAudienceGroupResponse } from "../../model/createImpBasedAudienceGroupResponse"; -import { ErrorResponse } from "../../model/errorResponse"; -import { GetAudienceDataResponse } from "../../model/getAudienceDataResponse"; -import { GetAudienceGroupAuthorityLevelResponse } from "../../model/getAudienceGroupAuthorityLevelResponse"; -import { GetAudienceGroupsResponse } from "../../model/getAudienceGroupsResponse"; -import { UpdateAudienceGroupAuthorityLevelRequest } from "../../model/updateAudienceGroupAuthorityLevelRequest"; -import { UpdateAudienceGroupDescriptionRequest } from "../../model/updateAudienceGroupDescriptionRequest"; + + +import { ManageAudienceClient } from "../../api.js"; + +import { AddAudienceToAudienceGroupRequest } from '../../model/addAudienceToAudienceGroupRequest.js'; +import { AudienceGroupCreateRoute } from '../../model/audienceGroupCreateRoute.js'; +import { AudienceGroupStatus } from '../../model/audienceGroupStatus.js'; +import { CreateAudienceGroupRequest } from '../../model/createAudienceGroupRequest.js'; +import { CreateAudienceGroupResponse } from '../../model/createAudienceGroupResponse.js'; +import { CreateClickBasedAudienceGroupRequest } from '../../model/createClickBasedAudienceGroupRequest.js'; +import { CreateClickBasedAudienceGroupResponse } from '../../model/createClickBasedAudienceGroupResponse.js'; +import { CreateImpBasedAudienceGroupRequest } from '../../model/createImpBasedAudienceGroupRequest.js'; +import { CreateImpBasedAudienceGroupResponse } from '../../model/createImpBasedAudienceGroupResponse.js'; +import { ErrorResponse } from '../../model/errorResponse.js'; +import { GetAudienceDataResponse } from '../../model/getAudienceDataResponse.js'; +import { GetAudienceGroupAuthorityLevelResponse } from '../../model/getAudienceGroupAuthorityLevelResponse.js'; +import { GetAudienceGroupsResponse } from '../../model/getAudienceGroupsResponse.js'; +import { UpdateAudienceGroupAuthorityLevelRequest } from '../../model/updateAudienceGroupAuthorityLevelRequest.js'; +import { UpdateAudienceGroupDescriptionRequest } from '../../model/updateAudienceGroupDescriptionRequest.js'; + import { createServer } from "node:http"; import { deepEqual, equal, ok } from "node:assert"; -const pkg = require("../../../../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../../../../package.json"); const channel_access_token = "test_channel_access_token"; + + + + describe("ManageAudienceClient", () => { + + + + it("activateAudienceGroupWithHttpInfo", async () => { let requestCount = 0; @@ -32,44 +45,58 @@ describe("ManageAudienceClient", () => { equal(req.method, "PUT"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/audienceGroup/{audienceGroupId}/activate".replace( - "{audienceGroupId}", - "0", - ), // number - ); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/{audienceGroupId}/activate" + .replace("{audienceGroupId}", "0") // number + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.activateAudienceGroupWithHttpInfo( - // audienceGroupId: number - 0, // paramName=audienceGroupId(number or int or long) + + + // audienceGroupId: number + 0, // paramName=audienceGroupId(number or int or long) + + ); equal(requestCount, 1); server.close(); }); + + + + it("activateAudienceGroup", async () => { let requestCount = 0; @@ -78,44 +105,59 @@ describe("ManageAudienceClient", () => { equal(req.method, "PUT"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/audienceGroup/{audienceGroupId}/activate".replace( - "{audienceGroupId}", - "0", - ), // number - ); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/{audienceGroupId}/activate" + .replace("{audienceGroupId}", "0") // number + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.activateAudienceGroup( - // audienceGroupId: number - 0, // paramName=audienceGroupId(number or int or long) + + + // audienceGroupId: number + 0, // paramName=audienceGroupId(number or int or long) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("addAudienceToAudienceGroupWithHttpInfo", async () => { let requestCount = 0; @@ -124,38 +166,57 @@ describe("ManageAudienceClient", () => { equal(req.method, "PUT"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/audienceGroup/upload"); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/upload" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.addAudienceToAudienceGroupWithHttpInfo( - // addAudienceToAudienceGroupRequest: AddAudienceToAudienceGroupRequest - {} as unknown as AddAudienceToAudienceGroupRequest, // paramName=addAudienceToAudienceGroupRequest + + + // addAudienceToAudienceGroupRequest: AddAudienceToAudienceGroupRequest + {} as unknown as AddAudienceToAudienceGroupRequest, // paramName=addAudienceToAudienceGroupRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("addAudienceToAudienceGroup", async () => { let requestCount = 0; @@ -164,38 +225,58 @@ describe("ManageAudienceClient", () => { equal(req.method, "PUT"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/audienceGroup/upload"); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/upload" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.addAudienceToAudienceGroup( - // addAudienceToAudienceGroupRequest: AddAudienceToAudienceGroupRequest - {} as unknown as AddAudienceToAudienceGroupRequest, // paramName=addAudienceToAudienceGroupRequest + + + // addAudienceToAudienceGroupRequest: AddAudienceToAudienceGroupRequest + {} as unknown as AddAudienceToAudienceGroupRequest, // paramName=addAudienceToAudienceGroupRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("createAudienceGroupWithHttpInfo", async () => { let requestCount = 0; @@ -204,38 +285,57 @@ describe("ManageAudienceClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/audienceGroup/upload"); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/upload" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.createAudienceGroupWithHttpInfo( - // createAudienceGroupRequest: CreateAudienceGroupRequest - {} as unknown as CreateAudienceGroupRequest, // paramName=createAudienceGroupRequest + + + // createAudienceGroupRequest: CreateAudienceGroupRequest + {} as unknown as CreateAudienceGroupRequest, // paramName=createAudienceGroupRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("createAudienceGroup", async () => { let requestCount = 0; @@ -244,38 +344,58 @@ describe("ManageAudienceClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/audienceGroup/upload"); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/upload" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.createAudienceGroup( - // createAudienceGroupRequest: CreateAudienceGroupRequest - {} as unknown as CreateAudienceGroupRequest, // paramName=createAudienceGroupRequest + + + // createAudienceGroupRequest: CreateAudienceGroupRequest + {} as unknown as CreateAudienceGroupRequest, // paramName=createAudienceGroupRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("createClickBasedAudienceGroupWithHttpInfo", async () => { let requestCount = 0; @@ -284,38 +404,57 @@ describe("ManageAudienceClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/audienceGroup/click"); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/click" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.createClickBasedAudienceGroupWithHttpInfo( - // createClickBasedAudienceGroupRequest: CreateClickBasedAudienceGroupRequest - {} as unknown as CreateClickBasedAudienceGroupRequest, // paramName=createClickBasedAudienceGroupRequest + + + // createClickBasedAudienceGroupRequest: CreateClickBasedAudienceGroupRequest + {} as unknown as CreateClickBasedAudienceGroupRequest, // paramName=createClickBasedAudienceGroupRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("createClickBasedAudienceGroup", async () => { let requestCount = 0; @@ -324,38 +463,58 @@ describe("ManageAudienceClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/audienceGroup/click"); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/click" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.createClickBasedAudienceGroup( - // createClickBasedAudienceGroupRequest: CreateClickBasedAudienceGroupRequest - {} as unknown as CreateClickBasedAudienceGroupRequest, // paramName=createClickBasedAudienceGroupRequest + + + // createClickBasedAudienceGroupRequest: CreateClickBasedAudienceGroupRequest + {} as unknown as CreateClickBasedAudienceGroupRequest, // paramName=createClickBasedAudienceGroupRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("createImpBasedAudienceGroupWithHttpInfo", async () => { let requestCount = 0; @@ -364,38 +523,57 @@ describe("ManageAudienceClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/audienceGroup/imp"); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/imp" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.createImpBasedAudienceGroupWithHttpInfo( - // createImpBasedAudienceGroupRequest: CreateImpBasedAudienceGroupRequest - {} as unknown as CreateImpBasedAudienceGroupRequest, // paramName=createImpBasedAudienceGroupRequest + + + // createImpBasedAudienceGroupRequest: CreateImpBasedAudienceGroupRequest + {} as unknown as CreateImpBasedAudienceGroupRequest, // paramName=createImpBasedAudienceGroupRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("createImpBasedAudienceGroup", async () => { let requestCount = 0; @@ -404,38 +582,58 @@ describe("ManageAudienceClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/audienceGroup/imp"); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/imp" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.createImpBasedAudienceGroup( - // createImpBasedAudienceGroupRequest: CreateImpBasedAudienceGroupRequest - {} as unknown as CreateImpBasedAudienceGroupRequest, // paramName=createImpBasedAudienceGroupRequest + + + // createImpBasedAudienceGroupRequest: CreateImpBasedAudienceGroupRequest + {} as unknown as CreateImpBasedAudienceGroupRequest, // paramName=createImpBasedAudienceGroupRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("deleteAudienceGroupWithHttpInfo", async () => { let requestCount = 0; @@ -444,44 +642,58 @@ describe("ManageAudienceClient", () => { equal(req.method, "DELETE"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/audienceGroup/{audienceGroupId}".replace( - "{audienceGroupId}", - "0", - ), // number - ); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/{audienceGroupId}" + .replace("{audienceGroupId}", "0") // number + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.deleteAudienceGroupWithHttpInfo( - // audienceGroupId: number - 0, // paramName=audienceGroupId(number or int or long) + + + // audienceGroupId: number + 0, // paramName=audienceGroupId(number or int or long) + + ); equal(requestCount, 1); server.close(); }); + + + + it("deleteAudienceGroup", async () => { let requestCount = 0; @@ -490,44 +702,59 @@ describe("ManageAudienceClient", () => { equal(req.method, "DELETE"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/audienceGroup/{audienceGroupId}".replace( - "{audienceGroupId}", - "0", - ), // number - ); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/{audienceGroupId}" + .replace("{audienceGroupId}", "0") // number + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.deleteAudienceGroup( - // audienceGroupId: number - 0, // paramName=audienceGroupId(number or int or long) + + + // audienceGroupId: number + 0, // paramName=audienceGroupId(number or int or long) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getAudienceDataWithHttpInfo", async () => { let requestCount = 0; @@ -536,44 +763,58 @@ describe("ManageAudienceClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/audienceGroup/{audienceGroupId}".replace( - "{audienceGroupId}", - "0", - ), // number - ); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/{audienceGroupId}" + .replace("{audienceGroupId}", "0") // number + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getAudienceDataWithHttpInfo( - // audienceGroupId: number - 0, // paramName=audienceGroupId(number or int or long) + + + // audienceGroupId: number + 0, // paramName=audienceGroupId(number or int or long) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getAudienceData", async () => { let requestCount = 0; @@ -582,44 +823,59 @@ describe("ManageAudienceClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/audienceGroup/{audienceGroupId}".replace( - "{audienceGroupId}", - "0", - ), // number - ); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/{audienceGroupId}" + .replace("{audienceGroupId}", "0") // number + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getAudienceData( - // audienceGroupId: number - 0, // paramName=audienceGroupId(number or int or long) + + + // audienceGroupId: number + 0, // paramName=audienceGroupId(number or int or long) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getAudienceGroupAuthorityLevelWithHttpInfo", async () => { let requestCount = 0; @@ -628,35 +884,52 @@ describe("ManageAudienceClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/audienceGroup/authorityLevel"); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/authorityLevel" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getAudienceGroupAuthorityLevelWithHttpInfo(); + const res = await client.getAudienceGroupAuthorityLevelWithHttpInfo( + + ); equal(requestCount, 1); server.close(); }); + + + + it("getAudienceGroupAuthorityLevel", async () => { let requestCount = 0; @@ -665,35 +938,53 @@ describe("ManageAudienceClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/audienceGroup/authorityLevel"); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/authorityLevel" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getAudienceGroupAuthorityLevel(); + const res = await client.getAudienceGroupAuthorityLevel( + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getAudienceGroupsWithHttpInfo", async () => { let requestCount = 0; @@ -702,104 +993,119 @@ describe("ManageAudienceClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/audienceGroup/list" - .replace("{page}", "0") // number - .replace("{description}", "DUMMY") // string - .replace("{size}", "0"), // number - ); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/list" + .replace("{page}", "0") // number + .replace("{description}", "DUMMY") // string + .replace("{size}", "0") // number + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("page"), - String( - // page: number - "DUMMY" as unknown as number, // paramName=page(enum) - ), + equal(queryParams.get("page"), String( + + // page: number + "DUMMY" as unknown as number, // paramName=page(enum) + )); + equal(queryParams.get("description"), String( + + // description: string + "DUMMY" as unknown as string, // paramName=description(enum) + )); + equal(queryParams.get("status"), String( + + // status: AudienceGroupStatus + "DUMMY" as unknown as AudienceGroupStatus, // paramName=status(enum) + )); + equal(queryParams.get("size"), String( + + // size: number + "DUMMY" as unknown as number, // paramName=size(enum) + )); + equal(queryParams.get("includesExternalPublicGroups"), String( + + // includesExternalPublicGroups: boolean + "DUMMY" as unknown as boolean, // paramName=includesExternalPublicGroups(enum) + )); + equal(queryParams.get("createRoute"), String( + + // createRoute: AudienceGroupCreateRoute + "DUMMY" as unknown as AudienceGroupCreateRoute, // paramName=createRoute(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, ); - equal( - queryParams.get("description"), - String( - // description: string - "DUMMY" as unknown as string, // paramName=description(enum) - ), - ); - equal( - queryParams.get("status"), - String( - // status: AudienceGroupStatus - "DUMMY" as unknown as AudienceGroupStatus, // paramName=status(enum) - ), - ); - equal( - queryParams.get("size"), - String( - // size: number - "DUMMY" as unknown as number, // paramName=size(enum) - ), - ); - equal( - queryParams.get("includesExternalPublicGroups"), - String( - // includesExternalPublicGroups: boolean - "DUMMY" as unknown as boolean, // paramName=includesExternalPublicGroups(enum) - ), - ); - equal( - queryParams.get("createRoute"), - String( - // createRoute: AudienceGroupCreateRoute - "DUMMY" as unknown as AudienceGroupCreateRoute, // paramName=createRoute(enum) - ), + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getAudienceGroupsWithHttpInfo( - // page: number - "DUMMY" as unknown as number, // paramName=page(enum) - // description: string - "DUMMY" as unknown as string, // paramName=description(enum) - // status: AudienceGroupStatus - "DUMMY" as unknown as AudienceGroupStatus, // paramName=status(enum) + // page: number + "DUMMY" as unknown as number, // paramName=page(enum) + + + + // description: string + "DUMMY" as unknown as string, // paramName=description(enum) + + - // size: number - "DUMMY" as unknown as number, // paramName=size(enum) + // status: AudienceGroupStatus + "DUMMY" as unknown as AudienceGroupStatus, // paramName=status(enum) + - // includesExternalPublicGroups: boolean - "DUMMY" as unknown as boolean, // paramName=includesExternalPublicGroups(enum) - // createRoute: AudienceGroupCreateRoute - "DUMMY" as unknown as AudienceGroupCreateRoute, // paramName=createRoute(enum) + // size: number + "DUMMY" as unknown as number, // paramName=size(enum) + + + + // includesExternalPublicGroups: boolean + "DUMMY" as unknown as boolean, // paramName=includesExternalPublicGroups(enum) + + + + // createRoute: AudienceGroupCreateRoute + "DUMMY" as unknown as AudienceGroupCreateRoute, // paramName=createRoute(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getAudienceGroups", async () => { let requestCount = 0; @@ -808,104 +1114,120 @@ describe("ManageAudienceClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/audienceGroup/list" - .replace("{page}", "0") // number - .replace("{description}", "DUMMY") // string - .replace("{size}", "0"), // number - ); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/list" + .replace("{page}", "0") // number + .replace("{description}", "DUMMY") // string + .replace("{size}", "0") // number + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("page"), - String( - // page: number - "DUMMY" as unknown as number, // paramName=page(enum) - ), - ); - equal( - queryParams.get("description"), - String( - // description: string - "DUMMY" as unknown as string, // paramName=description(enum) - ), + equal(queryParams.get("page"), String( + + // page: number + "DUMMY" as unknown as number, // paramName=page(enum) + )); + equal(queryParams.get("description"), String( + + // description: string + "DUMMY" as unknown as string, // paramName=description(enum) + )); + equal(queryParams.get("status"), String( + + // status: AudienceGroupStatus + "DUMMY" as unknown as AudienceGroupStatus, // paramName=status(enum) + )); + equal(queryParams.get("size"), String( + + // size: number + "DUMMY" as unknown as number, // paramName=size(enum) + )); + equal(queryParams.get("includesExternalPublicGroups"), String( + + // includesExternalPublicGroups: boolean + "DUMMY" as unknown as boolean, // paramName=includesExternalPublicGroups(enum) + )); + equal(queryParams.get("createRoute"), String( + + // createRoute: AudienceGroupCreateRoute + "DUMMY" as unknown as AudienceGroupCreateRoute, // paramName=createRoute(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, ); - equal( - queryParams.get("status"), - String( - // status: AudienceGroupStatus - "DUMMY" as unknown as AudienceGroupStatus, // paramName=status(enum) - ), + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - equal( - queryParams.get("size"), - String( - // size: number - "DUMMY" as unknown as number, // paramName=size(enum) - ), - ); - equal( - queryParams.get("includesExternalPublicGroups"), - String( - // includesExternalPublicGroups: boolean - "DUMMY" as unknown as boolean, // paramName=includesExternalPublicGroups(enum) - ), - ); - equal( - queryParams.get("createRoute"), - String( - // createRoute: AudienceGroupCreateRoute - "DUMMY" as unknown as AudienceGroupCreateRoute, // paramName=createRoute(enum) - ), - ); - - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getAudienceGroups( - // page: number - "DUMMY" as unknown as number, // paramName=page(enum) - // description: string - "DUMMY" as unknown as string, // paramName=description(enum) - // status: AudienceGroupStatus - "DUMMY" as unknown as AudienceGroupStatus, // paramName=status(enum) + // page: number + "DUMMY" as unknown as number, // paramName=page(enum) + + + + // description: string + "DUMMY" as unknown as string, // paramName=description(enum) + + + + // status: AudienceGroupStatus + "DUMMY" as unknown as AudienceGroupStatus, // paramName=status(enum) + + + + // size: number + "DUMMY" as unknown as number, // paramName=size(enum) + + + + // includesExternalPublicGroups: boolean + "DUMMY" as unknown as boolean, // paramName=includesExternalPublicGroups(enum) + - // size: number - "DUMMY" as unknown as number, // paramName=size(enum) - // includesExternalPublicGroups: boolean - "DUMMY" as unknown as boolean, // paramName=includesExternalPublicGroups(enum) + // createRoute: AudienceGroupCreateRoute + "DUMMY" as unknown as AudienceGroupCreateRoute, // paramName=createRoute(enum) + - // createRoute: AudienceGroupCreateRoute - "DUMMY" as unknown as AudienceGroupCreateRoute, // paramName=createRoute(enum) ); equal(requestCount, 1); server.close(); }); + + + + + it("updateAudienceGroupAuthorityLevelWithHttpInfo", async () => { let requestCount = 0; @@ -914,38 +1236,57 @@ describe("ManageAudienceClient", () => { equal(req.method, "PUT"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/audienceGroup/authorityLevel"); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/authorityLevel" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.updateAudienceGroupAuthorityLevelWithHttpInfo( - // updateAudienceGroupAuthorityLevelRequest: UpdateAudienceGroupAuthorityLevelRequest - {} as unknown as UpdateAudienceGroupAuthorityLevelRequest, // paramName=updateAudienceGroupAuthorityLevelRequest + + + // updateAudienceGroupAuthorityLevelRequest: UpdateAudienceGroupAuthorityLevelRequest + {} as unknown as UpdateAudienceGroupAuthorityLevelRequest, // paramName=updateAudienceGroupAuthorityLevelRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("updateAudienceGroupAuthorityLevel", async () => { let requestCount = 0; @@ -954,38 +1295,58 @@ describe("ManageAudienceClient", () => { equal(req.method, "PUT"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/audienceGroup/authorityLevel"); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/authorityLevel" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.updateAudienceGroupAuthorityLevel( - // updateAudienceGroupAuthorityLevelRequest: UpdateAudienceGroupAuthorityLevelRequest - {} as unknown as UpdateAudienceGroupAuthorityLevelRequest, // paramName=updateAudienceGroupAuthorityLevelRequest + + + // updateAudienceGroupAuthorityLevelRequest: UpdateAudienceGroupAuthorityLevelRequest + {} as unknown as UpdateAudienceGroupAuthorityLevelRequest, // paramName=updateAudienceGroupAuthorityLevelRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("updateAudienceGroupDescriptionWithHttpInfo", async () => { let requestCount = 0; @@ -994,47 +1355,63 @@ describe("ManageAudienceClient", () => { equal(req.method, "PUT"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/audienceGroup/{audienceGroupId}/updateDescription".replace( - "{audienceGroupId}", - "0", - ), // number - ); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/{audienceGroupId}/updateDescription" + .replace("{audienceGroupId}", "0") // number + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.updateAudienceGroupDescriptionWithHttpInfo( - // audienceGroupId: number - 0, // paramName=audienceGroupId(number or int or long) - // updateAudienceGroupDescriptionRequest: UpdateAudienceGroupDescriptionRequest - {} as unknown as UpdateAudienceGroupDescriptionRequest, // paramName=updateAudienceGroupDescriptionRequest + + // audienceGroupId: number + 0, // paramName=audienceGroupId(number or int or long) + + + + // updateAudienceGroupDescriptionRequest: UpdateAudienceGroupDescriptionRequest + {} as unknown as UpdateAudienceGroupDescriptionRequest, // paramName=updateAudienceGroupDescriptionRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("updateAudienceGroupDescription", async () => { let requestCount = 0; @@ -1043,44 +1420,59 @@ describe("ManageAudienceClient", () => { equal(req.method, "PUT"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/audienceGroup/{audienceGroupId}/updateDescription".replace( - "{audienceGroupId}", - "0", - ), // number - ); + equal(reqUrl.pathname, "/v2/bot/audienceGroup/{audienceGroupId}/updateDescription" + .replace("{audienceGroupId}", "0") // number + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ManageAudienceClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.updateAudienceGroupDescription( - // audienceGroupId: number - 0, // paramName=audienceGroupId(number or int or long) - // updateAudienceGroupDescriptionRequest: UpdateAudienceGroupDescriptionRequest - {} as unknown as UpdateAudienceGroupDescriptionRequest, // paramName=updateAudienceGroupDescriptionRequest + + // audienceGroupId: number + 0, // paramName=audienceGroupId(number or int or long) + + + + // updateAudienceGroupDescriptionRequest: UpdateAudienceGroupDescriptionRequest + {} as unknown as UpdateAudienceGroupDescriptionRequest, // paramName=updateAudienceGroupDescriptionRequest + + ); equal(requestCount, 1); server.close(); }); + + + }); diff --git a/lib/messaging-api/api.ts b/lib/messaging-api/api.ts index eeedcdab6..048a59bd5 100644 --- a/lib/messaging-api/api.ts +++ b/lib/messaging-api/api.ts @@ -1,3 +1,3 @@ // This is the entrypoint for the package -export * from "./api/apis"; -export * from "./model/models"; +export * from './api/apis.js'; +export * from './model/models.js'; diff --git a/lib/messaging-api/api/apis.ts b/lib/messaging-api/api/apis.ts index fe311f03a..0a774e498 100644 --- a/lib/messaging-api/api/apis.ts +++ b/lib/messaging-api/api/apis.ts @@ -1,2 +1,4 @@ -export { MessagingApiClient } from "./messagingApiClient"; -export { MessagingApiBlobClient } from "./messagingApiBlobClient"; + +export { MessagingApiClient } from './messagingApiClient.js'; +export { MessagingApiBlobClient } from './messagingApiBlobClient.js'; + diff --git a/lib/messaging-api/api/messagingApiBlobClient.ts b/lib/messaging-api/api/messagingApiBlobClient.ts index ee461015f..90430e6fb 100644 --- a/lib/messaging-api/api/messagingApiBlobClient.ts +++ b/lib/messaging-api/api/messagingApiBlobClient.ts @@ -1,3 +1,5 @@ + + /** * LINE Messaging API * This document describes LINE Messaging API. @@ -10,213 +12,231 @@ * Do not edit the class manually. */ + /* tslint:disable:no-unused-locals */ -import { GetMessageContentTranscodingResponse } from "../model/getMessageContentTranscodingResponse"; +import { GetMessageContentTranscodingResponse } from '../model/getMessageContentTranscodingResponse.js'; -import * as Types from "../../types"; -import { ensureJSON } from "../../utils"; -import { Readable } from "node:stream"; +import * as Types from "../../types.js"; +import {ensureJSON} from "../../utils.js"; +import {Readable} from "node:stream"; -import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch"; +import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch.js"; // =============================================== // This file is autogenerated - Please do not edit // =============================================== interface httpClientConfig { - baseURL?: string; - channelAccessToken: string; - // TODO support defaultHeaders? + baseURL?: string; + channelAccessToken: string; + // TODO support defaultHeaders? } + export class MessagingApiBlobClient { - private httpClient: HTTPFetchClient; + private httpClient: HTTPFetchClient; + + constructor(config: httpClientConfig) { + if (!config.baseURL) { + config.baseURL = 'https://api-data.line.me'; + } + this.httpClient = new HTTPFetchClient({ + defaultHeaders: { + Authorization: "Bearer " + config.channelAccessToken, + }, + baseURL: config.baseURL, + }); + } + + private async parseHTTPResponse(response: Response) { + const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; + let resBody: Record = { + ...await response.json(), + }; + if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { + resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = + response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME); + } + return resBody; + } + +/** + * Download image, video, and audio data sent from users. + * @param messageId Message ID of video or audio + * + * @see Documentation + */ + public async getMessageContent(messageId: string, ) : Promise { + return (await this.getMessageContentWithHttpInfo(messageId, )).body; + } + + /** + * Download image, video, and audio data sent from users.. + * This method includes HttpInfo object to return additional information. + * @param messageId Message ID of video or audio + * + * @see Documentation + */ + public async getMessageContentWithHttpInfo(messageId: string, ) : Promise> { + + + + + const response = await this.httpClient.get("/v2/bot/message/{messageId}/content" + + .replace('{' + "messageId" + '}', String(messageId)) + + ); + return {httpResponse: response, body: convertResponseToReadable(response)}; + + + + } +/** + * Get a preview image of the image or video + * @param messageId Message ID of image or video + * + * @see Documentation + */ + public async getMessageContentPreview(messageId: string, ) : Promise { + return (await this.getMessageContentPreviewWithHttpInfo(messageId, )).body; + } + + /** + * Get a preview image of the image or video. + * This method includes HttpInfo object to return additional information. + * @param messageId Message ID of image or video + * + * @see Documentation + */ + public async getMessageContentPreviewWithHttpInfo(messageId: string, ) : Promise> { + + + + + const response = await this.httpClient.get("/v2/bot/message/{messageId}/content/preview" + + .replace('{' + "messageId" + '}', String(messageId)) + + ); + return {httpResponse: response, body: convertResponseToReadable(response)}; + + + + } +/** + * Verify the preparation status of a video or audio for getting + * @param messageId Message ID of video or audio + * + * @see Documentation + */ + public async getMessageContentTranscodingByMessageId(messageId: string, ) : Promise { + return (await this.getMessageContentTranscodingByMessageIdWithHttpInfo(messageId, )).body; + } + + /** + * Verify the preparation status of a video or audio for getting. + * This method includes HttpInfo object to return additional information. + * @param messageId Message ID of video or audio + * + * @see Documentation + */ + public async getMessageContentTranscodingByMessageIdWithHttpInfo(messageId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/message/{messageId}/content/transcoding" + + .replace("{messageId}", String(messageId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; - constructor(config: httpClientConfig) { - if (!config.baseURL) { - config.baseURL = "https://api-data.line.me"; + + } - this.httpClient = new HTTPFetchClient({ - defaultHeaders: { - Authorization: "Bearer " + config.channelAccessToken, - }, - baseURL: config.baseURL, - }); - } - - private async parseHTTPResponse(response: Response) { - const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; - let resBody: Record = { - ...(await response.json()), - }; - if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { - resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = response.headers.get( - LINE_REQUEST_ID_HTTP_HEADER_NAME, - ); +/** + * Download rich menu image. + * @param richMenuId ID of the rich menu with the image to be downloaded + * + * @see Documentation + */ + public async getRichMenuImage(richMenuId: string, ) : Promise { + return (await this.getRichMenuImageWithHttpInfo(richMenuId, )).body; } - return resBody; - } - - /** - * Download image, video, and audio data sent from users. - * @param messageId Message ID of video or audio - * - * @see Documentation - */ - public async getMessageContent(messageId: string): Promise { - return (await this.getMessageContentWithHttpInfo(messageId)).body; - } - - /** - * Download image, video, and audio data sent from users.. - * This method includes HttpInfo object to return additional information. - * @param messageId Message ID of video or audio - * - * @see Documentation - */ - public async getMessageContentWithHttpInfo( - messageId: string, - ): Promise> { - const response = await this.httpClient.get( - "/v2/bot/message/{messageId}/content".replace( - "{" + "messageId" + "}", - String(messageId), - ), - ); - return { - httpResponse: response, - body: convertResponseToReadable(response), - }; - } - /** - * Get a preview image of the image or video - * @param messageId Message ID of image or video - * - * @see Documentation - */ - public async getMessageContentPreview(messageId: string): Promise { - return (await this.getMessageContentPreviewWithHttpInfo(messageId)).body; - } - - /** - * Get a preview image of the image or video. - * This method includes HttpInfo object to return additional information. - * @param messageId Message ID of image or video - * - * @see Documentation - */ - public async getMessageContentPreviewWithHttpInfo( - messageId: string, - ): Promise> { - const response = await this.httpClient.get( - "/v2/bot/message/{messageId}/content/preview".replace( - "{" + "messageId" + "}", - String(messageId), - ), - ); - return { - httpResponse: response, - body: convertResponseToReadable(response), - }; - } - /** - * Verify the preparation status of a video or audio for getting - * @param messageId Message ID of video or audio - * - * @see Documentation - */ - public async getMessageContentTranscodingByMessageId( - messageId: string, - ): Promise { - return ( - await this.getMessageContentTranscodingByMessageIdWithHttpInfo(messageId) - ).body; - } - - /** - * Verify the preparation status of a video or audio for getting. - * This method includes HttpInfo object to return additional information. - * @param messageId Message ID of video or audio - * - * @see Documentation - */ - public async getMessageContentTranscodingByMessageIdWithHttpInfo( - messageId: string, - ): Promise> { - const res = await this.httpClient.get( - "/v2/bot/message/{messageId}/content/transcoding".replace( - "{messageId}", - String(messageId), - ), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Download rich menu image. - * @param richMenuId ID of the rich menu with the image to be downloaded - * - * @see Documentation - */ - public async getRichMenuImage(richMenuId: string): Promise { - return (await this.getRichMenuImageWithHttpInfo(richMenuId)).body; - } - - /** - * Download rich menu image.. - * This method includes HttpInfo object to return additional information. - * @param richMenuId ID of the rich menu with the image to be downloaded - * - * @see Documentation - */ - public async getRichMenuImageWithHttpInfo( - richMenuId: string, - ): Promise> { - const response = await this.httpClient.get( - "/v2/bot/richmenu/{richMenuId}/content".replace( - "{" + "richMenuId" + "}", - String(richMenuId), - ), - ); - return { - httpResponse: response, - body: convertResponseToReadable(response), - }; - } - /** - * Upload rich menu image - * @param richMenuId The ID of the rich menu to attach the image to - * @param body - * - * @see Documentation - */ - public async setRichMenuImage( - richMenuId: string, - body?: Blob, - ): Promise { - return (await this.setRichMenuImageWithHttpInfo(richMenuId, body)).body; - } - - /** - * Upload rich menu image. - * This method includes HttpInfo object to return additional information. - * @param richMenuId The ID of the rich menu to attach the image to - * @param body - * - * @see Documentation - */ - public async setRichMenuImageWithHttpInfo( - richMenuId: string, - body?: Blob, - ): Promise> { + + /** + * Download rich menu image.. + * This method includes HttpInfo object to return additional information. + * @param richMenuId ID of the rich menu with the image to be downloaded + * + * @see Documentation + */ + public async getRichMenuImageWithHttpInfo(richMenuId: string, ) : Promise> { + + + + + const response = await this.httpClient.get("/v2/bot/richmenu/{richMenuId}/content" + + .replace('{' + "richMenuId" + '}', String(richMenuId)) + + ); + return {httpResponse: response, body: convertResponseToReadable(response)}; + + + + } +/** + * Upload rich menu image + * @param richMenuId The ID of the rich menu to attach the image to + * @param body + * + * @see Documentation + */ + public async setRichMenuImage(richMenuId: string, body?: Blob, ) : Promise { + return (await this.setRichMenuImageWithHttpInfo(richMenuId, body, )).body; + } + + /** + * Upload rich menu image. + * This method includes HttpInfo object to return additional information. + * @param richMenuId The ID of the rich menu to attach the image to + * @param body + * + * @see Documentation + */ + public async setRichMenuImageWithHttpInfo(richMenuId: string, body?: Blob, ) : Promise> { + + + + const params = body; + + + + const res = await this.httpClient.postBinaryContent( + "/v2/bot/richmenu/{richMenuId}/content" + + .replace("{richMenuId}", String(richMenuId)) + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } - const res = await this.httpClient.postBinaryContent( - "/v2/bot/richmenu/{richMenuId}/content".replace( - "{richMenuId}", - String(richMenuId), - ), - params, - ); - return { httpResponse: res, body: await res.json() }; - } } diff --git a/lib/messaging-api/api/messagingApiClient.ts b/lib/messaging-api/api/messagingApiClient.ts index aa81d7513..fe9cd07c4 100644 --- a/lib/messaging-api/api/messagingApiClient.ts +++ b/lib/messaging-api/api/messagingApiClient.ts @@ -1,3 +1,5 @@ + + /** * LINE Messaging API * This document describes LINE Messaging API. @@ -10,2007 +12,2583 @@ * Do not edit the class manually. */ + /* tslint:disable:no-unused-locals */ -import { AudienceMatchMessagesRequest } from "../model/audienceMatchMessagesRequest"; -import { BotInfoResponse } from "../model/botInfoResponse"; -import { BroadcastRequest } from "../model/broadcastRequest"; -import { CreateRichMenuAliasRequest } from "../model/createRichMenuAliasRequest"; -import { ErrorResponse } from "../model/errorResponse"; -import { GetAggregationUnitNameListResponse } from "../model/getAggregationUnitNameListResponse"; -import { GetAggregationUnitUsageResponse } from "../model/getAggregationUnitUsageResponse"; -import { GetFollowersResponse } from "../model/getFollowersResponse"; -import { GetWebhookEndpointResponse } from "../model/getWebhookEndpointResponse"; -import { GroupMemberCountResponse } from "../model/groupMemberCountResponse"; -import { GroupSummaryResponse } from "../model/groupSummaryResponse"; -import { GroupUserProfileResponse } from "../model/groupUserProfileResponse"; -import { IssueLinkTokenResponse } from "../model/issueLinkTokenResponse"; -import { MarkMessagesAsReadRequest } from "../model/markMessagesAsReadRequest"; -import { MembersIdsResponse } from "../model/membersIdsResponse"; -import { MessageQuotaResponse } from "../model/messageQuotaResponse"; -import { MulticastRequest } from "../model/multicastRequest"; -import { NarrowcastProgressResponse } from "../model/narrowcastProgressResponse"; -import { NarrowcastRequest } from "../model/narrowcastRequest"; -import { NumberOfMessagesResponse } from "../model/numberOfMessagesResponse"; -import { PnpMessagesRequest } from "../model/pnpMessagesRequest"; -import { PushMessageRequest } from "../model/pushMessageRequest"; -import { PushMessageResponse } from "../model/pushMessageResponse"; -import { QuotaConsumptionResponse } from "../model/quotaConsumptionResponse"; -import { ReplyMessageRequest } from "../model/replyMessageRequest"; -import { ReplyMessageResponse } from "../model/replyMessageResponse"; -import { RichMenuAliasListResponse } from "../model/richMenuAliasListResponse"; -import { RichMenuAliasResponse } from "../model/richMenuAliasResponse"; -import { RichMenuBatchProgressResponse } from "../model/richMenuBatchProgressResponse"; -import { RichMenuBatchRequest } from "../model/richMenuBatchRequest"; -import { RichMenuBulkLinkRequest } from "../model/richMenuBulkLinkRequest"; -import { RichMenuBulkUnlinkRequest } from "../model/richMenuBulkUnlinkRequest"; -import { RichMenuIdResponse } from "../model/richMenuIdResponse"; -import { RichMenuListResponse } from "../model/richMenuListResponse"; -import { RichMenuRequest } from "../model/richMenuRequest"; -import { RichMenuResponse } from "../model/richMenuResponse"; -import { RoomMemberCountResponse } from "../model/roomMemberCountResponse"; -import { RoomUserProfileResponse } from "../model/roomUserProfileResponse"; -import { SetWebhookEndpointRequest } from "../model/setWebhookEndpointRequest"; -import { TestWebhookEndpointRequest } from "../model/testWebhookEndpointRequest"; -import { TestWebhookEndpointResponse } from "../model/testWebhookEndpointResponse"; -import { UpdateRichMenuAliasRequest } from "../model/updateRichMenuAliasRequest"; -import { UserProfileResponse } from "../model/userProfileResponse"; -import { ValidateMessageRequest } from "../model/validateMessageRequest"; - -import * as Types from "../../types"; -import { ensureJSON } from "../../utils"; -import { Readable } from "node:stream"; - -import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch"; +import { AudienceMatchMessagesRequest } from '../model/audienceMatchMessagesRequest.js'; +import { BotInfoResponse } from '../model/botInfoResponse.js'; +import { BroadcastRequest } from '../model/broadcastRequest.js'; +import { CreateRichMenuAliasRequest } from '../model/createRichMenuAliasRequest.js'; +import { ErrorResponse } from '../model/errorResponse.js'; +import { GetAggregationUnitNameListResponse } from '../model/getAggregationUnitNameListResponse.js'; +import { GetAggregationUnitUsageResponse } from '../model/getAggregationUnitUsageResponse.js'; +import { GetFollowersResponse } from '../model/getFollowersResponse.js'; +import { GetWebhookEndpointResponse } from '../model/getWebhookEndpointResponse.js'; +import { GroupMemberCountResponse } from '../model/groupMemberCountResponse.js'; +import { GroupSummaryResponse } from '../model/groupSummaryResponse.js'; +import { GroupUserProfileResponse } from '../model/groupUserProfileResponse.js'; +import { IssueLinkTokenResponse } from '../model/issueLinkTokenResponse.js'; +import { MarkMessagesAsReadRequest } from '../model/markMessagesAsReadRequest.js'; +import { MembersIdsResponse } from '../model/membersIdsResponse.js'; +import { MessageQuotaResponse } from '../model/messageQuotaResponse.js'; +import { MulticastRequest } from '../model/multicastRequest.js'; +import { NarrowcastProgressResponse } from '../model/narrowcastProgressResponse.js'; +import { NarrowcastRequest } from '../model/narrowcastRequest.js'; +import { NumberOfMessagesResponse } from '../model/numberOfMessagesResponse.js'; +import { PnpMessagesRequest } from '../model/pnpMessagesRequest.js'; +import { PushMessageRequest } from '../model/pushMessageRequest.js'; +import { PushMessageResponse } from '../model/pushMessageResponse.js'; +import { QuotaConsumptionResponse } from '../model/quotaConsumptionResponse.js'; +import { ReplyMessageRequest } from '../model/replyMessageRequest.js'; +import { ReplyMessageResponse } from '../model/replyMessageResponse.js'; +import { RichMenuAliasListResponse } from '../model/richMenuAliasListResponse.js'; +import { RichMenuAliasResponse } from '../model/richMenuAliasResponse.js'; +import { RichMenuBatchProgressResponse } from '../model/richMenuBatchProgressResponse.js'; +import { RichMenuBatchRequest } from '../model/richMenuBatchRequest.js'; +import { RichMenuBulkLinkRequest } from '../model/richMenuBulkLinkRequest.js'; +import { RichMenuBulkUnlinkRequest } from '../model/richMenuBulkUnlinkRequest.js'; +import { RichMenuIdResponse } from '../model/richMenuIdResponse.js'; +import { RichMenuListResponse } from '../model/richMenuListResponse.js'; +import { RichMenuRequest } from '../model/richMenuRequest.js'; +import { RichMenuResponse } from '../model/richMenuResponse.js'; +import { RoomMemberCountResponse } from '../model/roomMemberCountResponse.js'; +import { RoomUserProfileResponse } from '../model/roomUserProfileResponse.js'; +import { SetWebhookEndpointRequest } from '../model/setWebhookEndpointRequest.js'; +import { TestWebhookEndpointRequest } from '../model/testWebhookEndpointRequest.js'; +import { TestWebhookEndpointResponse } from '../model/testWebhookEndpointResponse.js'; +import { UpdateRichMenuAliasRequest } from '../model/updateRichMenuAliasRequest.js'; +import { UserProfileResponse } from '../model/userProfileResponse.js'; +import { ValidateMessageRequest } from '../model/validateMessageRequest.js'; + +import * as Types from "../../types.js"; +import {ensureJSON} from "../../utils.js"; +import {Readable} from "node:stream"; + +import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch.js"; // =============================================== // This file is autogenerated - Please do not edit // =============================================== interface httpClientConfig { - baseURL?: string; - channelAccessToken: string; - // TODO support defaultHeaders? + baseURL?: string; + channelAccessToken: string; + // TODO support defaultHeaders? } + export class MessagingApiClient { - private httpClient: HTTPFetchClient; - - constructor(config: httpClientConfig) { - if (!config.baseURL) { - config.baseURL = "https://api.line.me"; - } - this.httpClient = new HTTPFetchClient({ - defaultHeaders: { - Authorization: "Bearer " + config.channelAccessToken, - }, - baseURL: config.baseURL, - }); - } - - private async parseHTTPResponse(response: Response) { - const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; - let resBody: Record = { - ...(await response.json()), - }; - if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { - resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = response.headers.get( - LINE_REQUEST_ID_HTTP_HEADER_NAME, - ); - } - return resBody; - } - - /** - * Send a message using phone number - * @param audienceMatchMessagesRequest - * - * @see Documentation - */ - public async audienceMatch( - audienceMatchMessagesRequest: AudienceMatchMessagesRequest, - ): Promise { - return (await this.audienceMatchWithHttpInfo(audienceMatchMessagesRequest)) - .body; - } - - /** - * Send a message using phone number. - * This method includes HttpInfo object to return additional information. - * @param audienceMatchMessagesRequest - * - * @see Documentation - */ - public async audienceMatchWithHttpInfo( - audienceMatchMessagesRequest: AudienceMatchMessagesRequest, - ): Promise> { + private httpClient: HTTPFetchClient; + + constructor(config: httpClientConfig) { + if (!config.baseURL) { + config.baseURL = 'https://api.line.me'; + } + this.httpClient = new HTTPFetchClient({ + defaultHeaders: { + Authorization: "Bearer " + config.channelAccessToken, + }, + baseURL: config.baseURL, + }); + } + + private async parseHTTPResponse(response: Response) { + const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; + let resBody: Record = { + ...await response.json(), + }; + if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { + resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = + response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME); + } + return resBody; + } + +/** + * Send a message using phone number + * @param audienceMatchMessagesRequest + * + * @see Documentation + */ + public async audienceMatch(audienceMatchMessagesRequest: AudienceMatchMessagesRequest, ) : Promise { + return (await this.audienceMatchWithHttpInfo(audienceMatchMessagesRequest, )).body; + } + + /** + * Send a message using phone number. + * This method includes HttpInfo object to return additional information. + * @param audienceMatchMessagesRequest + * + * @see Documentation + */ + public async audienceMatchWithHttpInfo(audienceMatchMessagesRequest: AudienceMatchMessagesRequest, ) : Promise> { + + + + const params = audienceMatchMessagesRequest; + + + + const res = await this.httpClient.post( + "/bot/ad/multicast/phone" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; - const res = await this.httpClient.post("/bot/ad/multicast/phone", params); - return { httpResponse: res, body: await res.json() }; - } - /** - * Sends a message to multiple users at any time. - * @param broadcastRequest - * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. - * - * @see Documentation - */ - public async broadcast( - broadcastRequest: BroadcastRequest, - xLineRetryKey?: string, - ): Promise { - return (await this.broadcastWithHttpInfo(broadcastRequest, xLineRetryKey)) - .body; - } - - /** - * Sends a message to multiple users at any time.. - * This method includes HttpInfo object to return additional information. - * @param broadcastRequest - * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. - * - * @see Documentation - */ - public async broadcastWithHttpInfo( - broadcastRequest: BroadcastRequest, - xLineRetryKey?: string, - ): Promise> { - const params = broadcastRequest; + + } +/** + * Sends a message to multiple users at any time. + * @param broadcastRequest + * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. + * + * @see Documentation + */ + public async broadcast(broadcastRequest: BroadcastRequest, xLineRetryKey?: string, ) : Promise { + return (await this.broadcastWithHttpInfo(broadcastRequest, xLineRetryKey, )).body; + } + + /** + * Sends a message to multiple users at any time.. + * This method includes HttpInfo object to return additional information. + * @param broadcastRequest + * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. + * + * @see Documentation + */ + public async broadcastWithHttpInfo(broadcastRequest: BroadcastRequest, xLineRetryKey?: string, ) : Promise> { + + + + + const params = broadcastRequest; + const headerParams = { - ...(xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}), - }; - - const res = await this.httpClient.post( - "/v2/bot/message/broadcast", - params, - - { headers: headerParams }, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Cancel default rich menu - * - * @see Documentation - */ - public async cancelDefaultRichMenu(): Promise { - return (await this.cancelDefaultRichMenuWithHttpInfo()).body; - } - - /** - * Cancel default rich menu. - * This method includes HttpInfo object to return additional information. - * - * @see Documentation - */ - public async cancelDefaultRichMenuWithHttpInfo(): Promise< - Types.ApiResponseType - > { - const res = await this.httpClient.delete("/v2/bot/user/all/richmenu"); - return { httpResponse: res, body: await res.json() }; - } - /** - * Create rich menu - * @param richMenuRequest - * - * @see Documentation - */ - public async createRichMenu( - richMenuRequest: RichMenuRequest, - ): Promise { - return (await this.createRichMenuWithHttpInfo(richMenuRequest)).body; - } - - /** - * Create rich menu. - * This method includes HttpInfo object to return additional information. - * @param richMenuRequest - * - * @see Documentation - */ - public async createRichMenuWithHttpInfo( - richMenuRequest: RichMenuRequest, - ): Promise> { + ...(xLineRetryKey != null ? {"X-Line-Retry-Key": xLineRetryKey} : {}), + + }; + + + const res = await this.httpClient.post( + "/v2/bot/message/broadcast" + , + + params, + + {headers: headerParams}, + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Cancel default rich menu + * + * @see Documentation + */ + public async cancelDefaultRichMenu() : Promise { + return (await this.cancelDefaultRichMenuWithHttpInfo()).body; + } + + /** + * Cancel default rich menu. + * This method includes HttpInfo object to return additional information. + * + * @see Documentation + */ + public async cancelDefaultRichMenuWithHttpInfo() : Promise> { + + + + + + + + const res = await this.httpClient.delete( + "/v2/bot/user/all/richmenu" + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Create rich menu + * @param richMenuRequest + * + * @see Documentation + */ + public async createRichMenu(richMenuRequest: RichMenuRequest, ) : Promise { + return (await this.createRichMenuWithHttpInfo(richMenuRequest, )).body; + } + + /** + * Create rich menu. + * This method includes HttpInfo object to return additional information. + * @param richMenuRequest + * + * @see Documentation + */ + public async createRichMenuWithHttpInfo(richMenuRequest: RichMenuRequest, ) : Promise> { + + + + const params = richMenuRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/richmenu" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Create rich menu alias + * @param createRichMenuAliasRequest + * + * @see Documentation + */ + public async createRichMenuAlias(createRichMenuAliasRequest: CreateRichMenuAliasRequest, ) : Promise { + return (await this.createRichMenuAliasWithHttpInfo(createRichMenuAliasRequest, )).body; + } + + /** + * Create rich menu alias. + * This method includes HttpInfo object to return additional information. + * @param createRichMenuAliasRequest + * + * @see Documentation + */ + public async createRichMenuAliasWithHttpInfo(createRichMenuAliasRequest: CreateRichMenuAliasRequest, ) : Promise> { + + + - const res = await this.httpClient.post("/v2/bot/richmenu", params); - return { httpResponse: res, body: await res.json() }; - } - /** - * Create rich menu alias - * @param createRichMenuAliasRequest - * - * @see Documentation - */ - public async createRichMenuAlias( - createRichMenuAliasRequest: CreateRichMenuAliasRequest, - ): Promise { - return ( - await this.createRichMenuAliasWithHttpInfo(createRichMenuAliasRequest) - ).body; - } - - /** - * Create rich menu alias. - * This method includes HttpInfo object to return additional information. - * @param createRichMenuAliasRequest - * - * @see Documentation - */ - public async createRichMenuAliasWithHttpInfo( - createRichMenuAliasRequest: CreateRichMenuAliasRequest, - ): Promise> { const params = createRichMenuAliasRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/richmenu/alias" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Deletes a rich menu. + * @param richMenuId ID of a rich menu + * + * @see Documentation + */ + public async deleteRichMenu(richMenuId: string, ) : Promise { + return (await this.deleteRichMenuWithHttpInfo(richMenuId, )).body; + } + + /** + * Deletes a rich menu.. + * This method includes HttpInfo object to return additional information. + * @param richMenuId ID of a rich menu + * + * @see Documentation + */ + public async deleteRichMenuWithHttpInfo(richMenuId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.delete( + "/v2/bot/richmenu/{richMenuId}" + + .replace("{richMenuId}", String(richMenuId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Delete rich menu alias + * @param richMenuAliasId Rich menu alias ID that you want to delete. + * + * @see Documentation + */ + public async deleteRichMenuAlias(richMenuAliasId: string, ) : Promise { + return (await this.deleteRichMenuAliasWithHttpInfo(richMenuAliasId, )).body; + } + + /** + * Delete rich menu alias. + * This method includes HttpInfo object to return additional information. + * @param richMenuAliasId Rich menu alias ID that you want to delete. + * + * @see Documentation + */ + public async deleteRichMenuAliasWithHttpInfo(richMenuAliasId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.delete( + "/v2/bot/richmenu/alias/{richMenuAliasId}" + + .replace("{richMenuAliasId}", String(richMenuAliasId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get result of message delivery using phone number + * @param date Date the message was sent Format: `yyyyMMdd` (e.g. `20190831`) Time Zone: UTC+9 + * + * @see Documentation + */ + public async getAdPhoneMessageStatistics(date: string, ) : Promise { + return (await this.getAdPhoneMessageStatisticsWithHttpInfo(date, )).body; + } + + /** + * Get result of message delivery using phone number. + * This method includes HttpInfo object to return additional information. + * @param date Date the message was sent Format: `yyyyMMdd` (e.g. `20190831`) Time Zone: UTC+9 + * + * @see Documentation + */ + public async getAdPhoneMessageStatisticsWithHttpInfo(date: string, ) : Promise> { + + + - const res = await this.httpClient.post("/v2/bot/richmenu/alias", params); - return { httpResponse: res, body: await res.json() }; - } - /** - * Deletes a rich menu. - * @param richMenuId ID of a rich menu - * - * @see Documentation - */ - public async deleteRichMenu( - richMenuId: string, - ): Promise { - return (await this.deleteRichMenuWithHttpInfo(richMenuId)).body; - } - - /** - * Deletes a rich menu.. - * This method includes HttpInfo object to return additional information. - * @param richMenuId ID of a rich menu - * - * @see Documentation - */ - public async deleteRichMenuWithHttpInfo( - richMenuId: string, - ): Promise> { - const res = await this.httpClient.delete( - "/v2/bot/richmenu/{richMenuId}".replace( - "{richMenuId}", - String(richMenuId), - ), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Delete rich menu alias - * @param richMenuAliasId Rich menu alias ID that you want to delete. - * - * @see Documentation - */ - public async deleteRichMenuAlias( - richMenuAliasId: string, - ): Promise { - return (await this.deleteRichMenuAliasWithHttpInfo(richMenuAliasId)).body; - } - - /** - * Delete rich menu alias. - * This method includes HttpInfo object to return additional information. - * @param richMenuAliasId Rich menu alias ID that you want to delete. - * - * @see Documentation - */ - public async deleteRichMenuAliasWithHttpInfo( - richMenuAliasId: string, - ): Promise> { - const res = await this.httpClient.delete( - "/v2/bot/richmenu/alias/{richMenuAliasId}".replace( - "{richMenuAliasId}", - String(richMenuAliasId), - ), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get result of message delivery using phone number - * @param date Date the message was sent Format: `yyyyMMdd` (e.g. `20190831`) Time Zone: UTC+9 - * - * @see Documentation - */ - public async getAdPhoneMessageStatistics( - date: string, - ): Promise { - return (await this.getAdPhoneMessageStatisticsWithHttpInfo(date)).body; - } - - /** - * Get result of message delivery using phone number. - * This method includes HttpInfo object to return additional information. - * @param date Date the message was sent Format: `yyyyMMdd` (e.g. `20190831`) Time Zone: UTC+9 - * - * @see Documentation - */ - public async getAdPhoneMessageStatisticsWithHttpInfo( - date: string, - ): Promise> { - const queryParams = { - date: date, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/message/delivery/ad_phone", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get name list of units used this month - * @param limit The maximum number of aggregation units you can get per request. - * @param start Value of the continuation token found in the next property of the JSON object returned in the response. If you can\'t get all the aggregation units in one request, include this parameter to get the remaining array. - * - * @see Documentation - */ - public async getAggregationUnitNameList( - limit?: string, - start?: string, - ): Promise { - return (await this.getAggregationUnitNameListWithHttpInfo(limit, start)) - .body; - } - - /** - * Get name list of units used this month. - * This method includes HttpInfo object to return additional information. - * @param limit The maximum number of aggregation units you can get per request. - * @param start Value of the continuation token found in the next property of the JSON object returned in the response. If you can\'t get all the aggregation units in one request, include this parameter to get the remaining array. - * - * @see Documentation - */ - public async getAggregationUnitNameListWithHttpInfo( - limit?: string, - start?: string, - ): Promise> { - const queryParams = { - limit: limit, - start: start, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/message/aggregation/list", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get number of units used this month - * - * @see Documentation - */ - public async getAggregationUnitUsage(): Promise { - return (await this.getAggregationUnitUsageWithHttpInfo()).body; - } - - /** - * Get number of units used this month. - * This method includes HttpInfo object to return additional information. - * - * @see Documentation - */ - public async getAggregationUnitUsageWithHttpInfo(): Promise< - Types.ApiResponseType - > { - const res = await this.httpClient.get("/v2/bot/message/aggregation/info"); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get bot info - * - * @see Documentation - */ - public async getBotInfo(): Promise { - return (await this.getBotInfoWithHttpInfo()).body; - } - - /** - * Get bot info. - * This method includes HttpInfo object to return additional information. - * - * @see Documentation - */ - public async getBotInfoWithHttpInfo(): Promise< - Types.ApiResponseType - > { - const res = await this.httpClient.get("/v2/bot/info"); - return { httpResponse: res, body: await res.json() }; - } - /** - * Gets the ID of the default rich menu set with the Messaging API. - * - * @see Documentation - */ - public async getDefaultRichMenuId(): Promise { - return (await this.getDefaultRichMenuIdWithHttpInfo()).body; - } - - /** - * Gets the ID of the default rich menu set with the Messaging API.. - * This method includes HttpInfo object to return additional information. - * - * @see Documentation - */ - public async getDefaultRichMenuIdWithHttpInfo(): Promise< - Types.ApiResponseType - > { - const res = await this.httpClient.get("/v2/bot/user/all/richmenu"); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get a list of users who added your LINE Official Account as a friend - * @param start Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. - * @param limit The maximum number of user IDs to retrieve in a single request. - * - * @see Documentation - */ - public async getFollowers( - start?: string, - limit?: number, - ): Promise { - return (await this.getFollowersWithHttpInfo(start, limit)).body; - } - - /** - * Get a list of users who added your LINE Official Account as a friend. - * This method includes HttpInfo object to return additional information. - * @param start Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. - * @param limit The maximum number of user IDs to retrieve in a single request. - * - * @see Documentation - */ - public async getFollowersWithHttpInfo( - start?: string, - limit?: number, - ): Promise> { const queryParams = { - start: start, - limit: limit, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get("/v2/bot/followers/ids", queryParams); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get number of users in a group chat - * @param groupId Group ID - * - * @see Documentation - */ - public async getGroupMemberCount( - groupId: string, - ): Promise { - return (await this.getGroupMemberCountWithHttpInfo(groupId)).body; - } - - /** - * Get number of users in a group chat. - * This method includes HttpInfo object to return additional information. - * @param groupId Group ID - * - * @see Documentation - */ - public async getGroupMemberCountWithHttpInfo( - groupId: string, - ): Promise> { - const res = await this.httpClient.get( - "/v2/bot/group/{groupId}/members/count".replace( - "{groupId}", - String(groupId), - ), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get group chat member profile - * @param groupId Group ID - * @param userId User ID - * - * @see Documentation - */ - public async getGroupMemberProfile( - groupId: string, - userId: string, - ): Promise { - return (await this.getGroupMemberProfileWithHttpInfo(groupId, userId)).body; - } - - /** - * Get group chat member profile. - * This method includes HttpInfo object to return additional information. - * @param groupId Group ID - * @param userId User ID - * - * @see Documentation - */ - public async getGroupMemberProfileWithHttpInfo( - groupId: string, - userId: string, - ): Promise> { - const res = await this.httpClient.get( - "/v2/bot/group/{groupId}/member/{userId}" - - .replace("{groupId}", String(groupId)) - - .replace("{userId}", String(userId)), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get group chat member user IDs - * @param groupId Group ID - * @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. - * - * @see Documentation - */ - public async getGroupMembersIds( - groupId: string, - start?: string, - ): Promise { - return (await this.getGroupMembersIdsWithHttpInfo(groupId, start)).body; - } - - /** - * Get group chat member user IDs. - * This method includes HttpInfo object to return additional information. - * @param groupId Group ID - * @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. - * - * @see Documentation - */ - public async getGroupMembersIdsWithHttpInfo( - groupId: string, - start?: string, - ): Promise> { + "date": date, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/message/delivery/ad_phone" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get name list of units used this month + * @param limit The maximum number of aggregation units you can get per request. + * @param start Value of the continuation token found in the next property of the JSON object returned in the response. If you can\'t get all the aggregation units in one request, include this parameter to get the remaining array. + * + * @see Documentation + */ + public async getAggregationUnitNameList(limit?: string, start?: string, ) : Promise { + return (await this.getAggregationUnitNameListWithHttpInfo(limit, start, )).body; + } + + /** + * Get name list of units used this month. + * This method includes HttpInfo object to return additional information. + * @param limit The maximum number of aggregation units you can get per request. + * @param start Value of the continuation token found in the next property of the JSON object returned in the response. If you can\'t get all the aggregation units in one request, include this parameter to get the remaining array. + * + * @see Documentation + */ + public async getAggregationUnitNameListWithHttpInfo(limit?: string, start?: string, ) : Promise> { + + + + const queryParams = { - start: start, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/group/{groupId}/members/ids".replace( - "{groupId}", - String(groupId), - ), - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get group chat summary - * @param groupId Group ID - * - * @see Documentation - */ - public async getGroupSummary(groupId: string): Promise { - return (await this.getGroupSummaryWithHttpInfo(groupId)).body; - } - - /** - * Get group chat summary. - * This method includes HttpInfo object to return additional information. - * @param groupId Group ID - * - * @see Documentation - */ - public async getGroupSummaryWithHttpInfo( - groupId: string, - ): Promise> { - const res = await this.httpClient.get( - "/v2/bot/group/{groupId}/summary".replace("{groupId}", String(groupId)), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned. - * - * @see Documentation - */ - public async getMessageQuota(): Promise { - return (await this.getMessageQuotaWithHttpInfo()).body; - } - - /** - * Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned.. - * This method includes HttpInfo object to return additional information. - * - * @see Documentation - */ - public async getMessageQuotaWithHttpInfo(): Promise< - Types.ApiResponseType - > { - const res = await this.httpClient.get("/v2/bot/message/quota"); - return { httpResponse: res, body: await res.json() }; - } - /** - * Gets the number of messages sent in the current month. - * - * @see Documentation - */ - public async getMessageQuotaConsumption(): Promise { - return (await this.getMessageQuotaConsumptionWithHttpInfo()).body; - } - - /** - * Gets the number of messages sent in the current month.. - * This method includes HttpInfo object to return additional information. - * - * @see Documentation - */ - public async getMessageQuotaConsumptionWithHttpInfo(): Promise< - Types.ApiResponseType - > { - const res = await this.httpClient.get("/v2/bot/message/quota/consumption"); - return { httpResponse: res, body: await res.json() }; - } - /** - * Gets the status of a narrowcast message. - * @param requestId The narrowcast message\'s request ID. Each Messaging API request has a request ID. - * - * @see Documentation - */ - public async getNarrowcastProgress( - requestId: string, - ): Promise { - return (await this.getNarrowcastProgressWithHttpInfo(requestId)).body; - } - - /** - * Gets the status of a narrowcast message.. - * This method includes HttpInfo object to return additional information. - * @param requestId The narrowcast message\'s request ID. Each Messaging API request has a request ID. - * - * @see Documentation - */ - public async getNarrowcastProgressWithHttpInfo( - requestId: string, - ): Promise> { + "limit": limit, + "start": start, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/message/aggregation/list" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get number of units used this month + * + * @see Documentation + */ + public async getAggregationUnitUsage() : Promise { + return (await this.getAggregationUnitUsageWithHttpInfo()).body; + } + + /** + * Get number of units used this month. + * This method includes HttpInfo object to return additional information. + * + * @see Documentation + */ + public async getAggregationUnitUsageWithHttpInfo() : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/message/aggregation/info" + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get bot info + * + * @see Documentation + */ + public async getBotInfo() : Promise { + return (await this.getBotInfoWithHttpInfo()).body; + } + + /** + * Get bot info. + * This method includes HttpInfo object to return additional information. + * + * @see Documentation + */ + public async getBotInfoWithHttpInfo() : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/info" + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Gets the ID of the default rich menu set with the Messaging API. + * + * @see Documentation + */ + public async getDefaultRichMenuId() : Promise { + return (await this.getDefaultRichMenuIdWithHttpInfo()).body; + } + + /** + * Gets the ID of the default rich menu set with the Messaging API.. + * This method includes HttpInfo object to return additional information. + * + * @see Documentation + */ + public async getDefaultRichMenuIdWithHttpInfo() : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/user/all/richmenu" + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get a list of users who added your LINE Official Account as a friend + * @param start Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. + * @param limit The maximum number of user IDs to retrieve in a single request. + * + * @see Documentation + */ + public async getFollowers(start?: string, limit?: number, ) : Promise { + return (await this.getFollowersWithHttpInfo(start, limit, )).body; + } + + /** + * Get a list of users who added your LINE Official Account as a friend. + * This method includes HttpInfo object to return additional information. + * @param start Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. + * @param limit The maximum number of user IDs to retrieve in a single request. + * + * @see Documentation + */ + public async getFollowersWithHttpInfo(start?: string, limit?: number, ) : Promise> { + + + + const queryParams = { - requestId: requestId, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/message/progress/narrowcast", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get number of sent broadcast messages - * @param date Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 - * - * @see Documentation - */ - public async getNumberOfSentBroadcastMessages( - date: string, - ): Promise { - return (await this.getNumberOfSentBroadcastMessagesWithHttpInfo(date)).body; - } - - /** - * Get number of sent broadcast messages. - * This method includes HttpInfo object to return additional information. - * @param date Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 - * - * @see Documentation - */ - public async getNumberOfSentBroadcastMessagesWithHttpInfo( - date: string, - ): Promise> { + "start": start, + "limit": limit, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/followers/ids" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get number of users in a group chat + * @param groupId Group ID + * + * @see Documentation + */ + public async getGroupMemberCount(groupId: string, ) : Promise { + return (await this.getGroupMemberCountWithHttpInfo(groupId, )).body; + } + + /** + * Get number of users in a group chat. + * This method includes HttpInfo object to return additional information. + * @param groupId Group ID + * + * @see Documentation + */ + public async getGroupMemberCountWithHttpInfo(groupId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/group/{groupId}/members/count" + + .replace("{groupId}", String(groupId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get group chat member profile + * @param groupId Group ID + * @param userId User ID + * + * @see Documentation + */ + public async getGroupMemberProfile(groupId: string, userId: string, ) : Promise { + return (await this.getGroupMemberProfileWithHttpInfo(groupId, userId, )).body; + } + + /** + * Get group chat member profile. + * This method includes HttpInfo object to return additional information. + * @param groupId Group ID + * @param userId User ID + * + * @see Documentation + */ + public async getGroupMemberProfileWithHttpInfo(groupId: string, userId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/group/{groupId}/member/{userId}" + + .replace("{groupId}", String(groupId)) + + .replace("{userId}", String(userId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get group chat member user IDs + * @param groupId Group ID + * @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + * + * @see Documentation + */ + public async getGroupMembersIds(groupId: string, start?: string, ) : Promise { + return (await this.getGroupMembersIdsWithHttpInfo(groupId, start, )).body; + } + + /** + * Get group chat member user IDs. + * This method includes HttpInfo object to return additional information. + * @param groupId Group ID + * @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + * + * @see Documentation + */ + public async getGroupMembersIdsWithHttpInfo(groupId: string, start?: string, ) : Promise> { + + + + const queryParams = { - date: date, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/message/delivery/broadcast", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get number of sent multicast messages - * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 - * - * @see Documentation - */ - public async getNumberOfSentMulticastMessages( - date: string, - ): Promise { - return (await this.getNumberOfSentMulticastMessagesWithHttpInfo(date)).body; - } - - /** - * Get number of sent multicast messages. - * This method includes HttpInfo object to return additional information. - * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 - * - * @see Documentation - */ - public async getNumberOfSentMulticastMessagesWithHttpInfo( - date: string, - ): Promise> { + "start": start, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/group/{groupId}/members/ids" + + .replace("{groupId}", String(groupId)) + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get group chat summary + * @param groupId Group ID + * + * @see Documentation + */ + public async getGroupSummary(groupId: string, ) : Promise { + return (await this.getGroupSummaryWithHttpInfo(groupId, )).body; + } + + /** + * Get group chat summary. + * This method includes HttpInfo object to return additional information. + * @param groupId Group ID + * + * @see Documentation + */ + public async getGroupSummaryWithHttpInfo(groupId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/group/{groupId}/summary" + + .replace("{groupId}", String(groupId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned. + * + * @see Documentation + */ + public async getMessageQuota() : Promise { + return (await this.getMessageQuotaWithHttpInfo()).body; + } + + /** + * Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned.. + * This method includes HttpInfo object to return additional information. + * + * @see Documentation + */ + public async getMessageQuotaWithHttpInfo() : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/message/quota" + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Gets the number of messages sent in the current month. + * + * @see Documentation + */ + public async getMessageQuotaConsumption() : Promise { + return (await this.getMessageQuotaConsumptionWithHttpInfo()).body; + } + + /** + * Gets the number of messages sent in the current month.. + * This method includes HttpInfo object to return additional information. + * + * @see Documentation + */ + public async getMessageQuotaConsumptionWithHttpInfo() : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/message/quota/consumption" + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Gets the status of a narrowcast message. + * @param requestId The narrowcast message\'s request ID. Each Messaging API request has a request ID. + * + * @see Documentation + */ + public async getNarrowcastProgress(requestId: string, ) : Promise { + return (await this.getNarrowcastProgressWithHttpInfo(requestId, )).body; + } + + /** + * Gets the status of a narrowcast message.. + * This method includes HttpInfo object to return additional information. + * @param requestId The narrowcast message\'s request ID. Each Messaging API request has a request ID. + * + * @see Documentation + */ + public async getNarrowcastProgressWithHttpInfo(requestId: string, ) : Promise> { + + + + const queryParams = { - date: date, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/message/delivery/multicast", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get number of sent push messages - * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 - * - * @see Documentation - */ - public async getNumberOfSentPushMessages( - date: string, - ): Promise { - return (await this.getNumberOfSentPushMessagesWithHttpInfo(date)).body; - } - - /** - * Get number of sent push messages. - * This method includes HttpInfo object to return additional information. - * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 - * - * @see Documentation - */ - public async getNumberOfSentPushMessagesWithHttpInfo( - date: string, - ): Promise> { + "requestId": requestId, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/message/progress/narrowcast" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get number of sent broadcast messages + * @param date Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + * + * @see Documentation + */ + public async getNumberOfSentBroadcastMessages(date: string, ) : Promise { + return (await this.getNumberOfSentBroadcastMessagesWithHttpInfo(date, )).body; + } + + /** + * Get number of sent broadcast messages. + * This method includes HttpInfo object to return additional information. + * @param date Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + * + * @see Documentation + */ + public async getNumberOfSentBroadcastMessagesWithHttpInfo(date: string, ) : Promise> { + + + + const queryParams = { - date: date, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/message/delivery/push", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get number of sent reply messages - * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 - * - * @see Documentation - */ - public async getNumberOfSentReplyMessages( - date: string, - ): Promise { - return (await this.getNumberOfSentReplyMessagesWithHttpInfo(date)).body; - } - - /** - * Get number of sent reply messages. - * This method includes HttpInfo object to return additional information. - * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 - * - * @see Documentation - */ - public async getNumberOfSentReplyMessagesWithHttpInfo( - date: string, - ): Promise> { + "date": date, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/message/delivery/broadcast" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get number of sent multicast messages + * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + * + * @see Documentation + */ + public async getNumberOfSentMulticastMessages(date: string, ) : Promise { + return (await this.getNumberOfSentMulticastMessagesWithHttpInfo(date, )).body; + } + + /** + * Get number of sent multicast messages. + * This method includes HttpInfo object to return additional information. + * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + * + * @see Documentation + */ + public async getNumberOfSentMulticastMessagesWithHttpInfo(date: string, ) : Promise> { + + + + const queryParams = { - date: date, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/message/delivery/reply", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get number of sent LINE notification messages - * @param date Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 - * - * @see Documentation - */ - public async getPNPMessageStatistics( - date: string, - ): Promise { - return (await this.getPNPMessageStatisticsWithHttpInfo(date)).body; - } - - /** - * Get number of sent LINE notification messages . - * This method includes HttpInfo object to return additional information. - * @param date Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 - * - * @see Documentation - */ - public async getPNPMessageStatisticsWithHttpInfo( - date: string, - ): Promise> { + "date": date, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/message/delivery/multicast" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get number of sent push messages + * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + * + * @see Documentation + */ + public async getNumberOfSentPushMessages(date: string, ) : Promise { + return (await this.getNumberOfSentPushMessagesWithHttpInfo(date, )).body; + } + + /** + * Get number of sent push messages. + * This method includes HttpInfo object to return additional information. + * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + * + * @see Documentation + */ + public async getNumberOfSentPushMessagesWithHttpInfo(date: string, ) : Promise> { + + + + const queryParams = { - date: date, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/message/delivery/pnp", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get profile - * @param userId User ID - * - * @see Documentation - */ - public async getProfile(userId: string): Promise { - return (await this.getProfileWithHttpInfo(userId)).body; - } - - /** - * Get profile. - * This method includes HttpInfo object to return additional information. - * @param userId User ID - * - * @see Documentation - */ - public async getProfileWithHttpInfo( - userId: string, - ): Promise> { - const res = await this.httpClient.get( - "/v2/bot/profile/{userId}".replace("{userId}", String(userId)), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Gets a rich menu via a rich menu ID. - * @param richMenuId ID of a rich menu - * - * @see Documentation - */ - public async getRichMenu(richMenuId: string): Promise { - return (await this.getRichMenuWithHttpInfo(richMenuId)).body; - } - - /** - * Gets a rich menu via a rich menu ID.. - * This method includes HttpInfo object to return additional information. - * @param richMenuId ID of a rich menu - * - * @see Documentation - */ - public async getRichMenuWithHttpInfo( - richMenuId: string, - ): Promise> { - const res = await this.httpClient.get( - "/v2/bot/richmenu/{richMenuId}".replace( - "{richMenuId}", - String(richMenuId), - ), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get rich menu alias information - * @param richMenuAliasId The rich menu alias ID whose information you want to obtain. - * - * @see Documentation - */ - public async getRichMenuAlias( - richMenuAliasId: string, - ): Promise { - return (await this.getRichMenuAliasWithHttpInfo(richMenuAliasId)).body; - } - - /** - * Get rich menu alias information. - * This method includes HttpInfo object to return additional information. - * @param richMenuAliasId The rich menu alias ID whose information you want to obtain. - * - * @see Documentation - */ - public async getRichMenuAliasWithHttpInfo( - richMenuAliasId: string, - ): Promise> { - const res = await this.httpClient.get( - "/v2/bot/richmenu/alias/{richMenuAliasId}".replace( - "{richMenuAliasId}", - String(richMenuAliasId), - ), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get list of rich menu alias - * - * @see Documentation - */ - public async getRichMenuAliasList(): Promise { - return (await this.getRichMenuAliasListWithHttpInfo()).body; - } - - /** - * Get list of rich menu alias. - * This method includes HttpInfo object to return additional information. - * - * @see Documentation - */ - public async getRichMenuAliasListWithHttpInfo(): Promise< - Types.ApiResponseType - > { - const res = await this.httpClient.get("/v2/bot/richmenu/alias/list"); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get the status of Replace or unlink a linked rich menus in batches. - * @param requestId A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. - * - * @see Documentation - */ - public async getRichMenuBatchProgress( - requestId: string, - ): Promise { - return (await this.getRichMenuBatchProgressWithHttpInfo(requestId)).body; - } - - /** - * Get the status of Replace or unlink a linked rich menus in batches.. - * This method includes HttpInfo object to return additional information. - * @param requestId A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. - * - * @see Documentation - */ - public async getRichMenuBatchProgressWithHttpInfo( - requestId: string, - ): Promise> { + "date": date, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/message/delivery/push" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get number of sent reply messages + * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + * + * @see Documentation + */ + public async getNumberOfSentReplyMessages(date: string, ) : Promise { + return (await this.getNumberOfSentReplyMessagesWithHttpInfo(date, )).body; + } + + /** + * Get number of sent reply messages. + * This method includes HttpInfo object to return additional information. + * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + * + * @see Documentation + */ + public async getNumberOfSentReplyMessagesWithHttpInfo(date: string, ) : Promise> { + + + + const queryParams = { - requestId: requestId, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/richmenu/progress/batch", - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get rich menu ID of user - * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. - * - * @see Documentation - */ - public async getRichMenuIdOfUser( - userId: string, - ): Promise { - return (await this.getRichMenuIdOfUserWithHttpInfo(userId)).body; - } - - /** - * Get rich menu ID of user. - * This method includes HttpInfo object to return additional information. - * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. - * - * @see Documentation - */ - public async getRichMenuIdOfUserWithHttpInfo( - userId: string, - ): Promise> { - const res = await this.httpClient.get( - "/v2/bot/user/{userId}/richmenu".replace("{userId}", String(userId)), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get rich menu list - * - * @see Documentation - */ - public async getRichMenuList(): Promise { - return (await this.getRichMenuListWithHttpInfo()).body; - } - - /** - * Get rich menu list. - * This method includes HttpInfo object to return additional information. - * - * @see Documentation - */ - public async getRichMenuListWithHttpInfo(): Promise< - Types.ApiResponseType - > { - const res = await this.httpClient.get("/v2/bot/richmenu/list"); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get number of users in a multi-person chat - * @param roomId Room ID - * - * @see Documentation - */ - public async getRoomMemberCount( - roomId: string, - ): Promise { - return (await this.getRoomMemberCountWithHttpInfo(roomId)).body; - } - - /** - * Get number of users in a multi-person chat. - * This method includes HttpInfo object to return additional information. - * @param roomId Room ID - * - * @see Documentation - */ - public async getRoomMemberCountWithHttpInfo( - roomId: string, - ): Promise> { - const res = await this.httpClient.get( - "/v2/bot/room/{roomId}/members/count".replace("{roomId}", String(roomId)), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get multi-person chat member profile - * @param roomId Room ID - * @param userId User ID - * - * @see Documentation - */ - public async getRoomMemberProfile( - roomId: string, - userId: string, - ): Promise { - return (await this.getRoomMemberProfileWithHttpInfo(roomId, userId)).body; - } - - /** - * Get multi-person chat member profile. - * This method includes HttpInfo object to return additional information. - * @param roomId Room ID - * @param userId User ID - * - * @see Documentation - */ - public async getRoomMemberProfileWithHttpInfo( - roomId: string, - userId: string, - ): Promise> { - const res = await this.httpClient.get( - "/v2/bot/room/{roomId}/member/{userId}" - - .replace("{roomId}", String(roomId)) - - .replace("{userId}", String(userId)), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get multi-person chat member user IDs - * @param roomId Room ID - * @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. - * - * @see Documentation - */ - public async getRoomMembersIds( - roomId: string, - start?: string, - ): Promise { - return (await this.getRoomMembersIdsWithHttpInfo(roomId, start)).body; - } - - /** - * Get multi-person chat member user IDs. - * This method includes HttpInfo object to return additional information. - * @param roomId Room ID - * @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. - * - * @see Documentation - */ - public async getRoomMembersIdsWithHttpInfo( - roomId: string, - start?: string, - ): Promise> { + "date": date, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/message/delivery/reply" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get number of sent LINE notification messages  + * @param date Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 + * + * @see Documentation + */ + public async getPNPMessageStatistics(date: string, ) : Promise { + return (await this.getPNPMessageStatisticsWithHttpInfo(date, )).body; + } + + /** + * Get number of sent LINE notification messages . + * This method includes HttpInfo object to return additional information. + * @param date Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 + * + * @see Documentation + */ + public async getPNPMessageStatisticsWithHttpInfo(date: string, ) : Promise> { + + + + const queryParams = { - start: start, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get( - "/v2/bot/room/{roomId}/members/ids".replace("{roomId}", String(roomId)), - queryParams, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Get webhook endpoint information - * - * @see Documentation - */ - public async getWebhookEndpoint(): Promise { - return (await this.getWebhookEndpointWithHttpInfo()).body; - } - - /** - * Get webhook endpoint information. - * This method includes HttpInfo object to return additional information. - * - * @see Documentation - */ - public async getWebhookEndpointWithHttpInfo(): Promise< - Types.ApiResponseType - > { - const res = await this.httpClient.get("/v2/bot/channel/webhook/endpoint"); - return { httpResponse: res, body: await res.json() }; - } - /** - * Issue link token - * @param userId User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. - * - * @see Documentation - */ - public async issueLinkToken(userId: string): Promise { - return (await this.issueLinkTokenWithHttpInfo(userId)).body; - } - - /** - * Issue link token. - * This method includes HttpInfo object to return additional information. - * @param userId User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. - * - * @see Documentation - */ - public async issueLinkTokenWithHttpInfo( - userId: string, - ): Promise> { - const res = await this.httpClient.post( - "/v2/bot/user/{userId}/linkToken".replace("{userId}", String(userId)), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Leave group chat - * @param groupId Group ID - * - * @see Documentation - */ - public async leaveGroup( - groupId: string, - ): Promise { - return (await this.leaveGroupWithHttpInfo(groupId)).body; - } - - /** - * Leave group chat. - * This method includes HttpInfo object to return additional information. - * @param groupId Group ID - * - * @see Documentation - */ - public async leaveGroupWithHttpInfo( - groupId: string, - ): Promise> { - const res = await this.httpClient.post( - "/v2/bot/group/{groupId}/leave".replace("{groupId}", String(groupId)), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Leave multi-person chat - * @param roomId Room ID - * - * @see Documentation - */ - public async leaveRoom( - roomId: string, - ): Promise { - return (await this.leaveRoomWithHttpInfo(roomId)).body; - } - - /** - * Leave multi-person chat. - * This method includes HttpInfo object to return additional information. - * @param roomId Room ID - * - * @see Documentation - */ - public async leaveRoomWithHttpInfo( - roomId: string, - ): Promise> { - const res = await this.httpClient.post( - "/v2/bot/room/{roomId}/leave".replace("{roomId}", String(roomId)), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Link rich menu to user. - * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. - * @param richMenuId ID of a rich menu - * - * @see Documentation - */ - public async linkRichMenuIdToUser( - userId: string, - richMenuId: string, - ): Promise { - return (await this.linkRichMenuIdToUserWithHttpInfo(userId, richMenuId)) - .body; - } - - /** - * Link rich menu to user.. - * This method includes HttpInfo object to return additional information. - * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. - * @param richMenuId ID of a rich menu - * - * @see Documentation - */ - public async linkRichMenuIdToUserWithHttpInfo( - userId: string, - richMenuId: string, - ): Promise> { - const res = await this.httpClient.post( - "/v2/bot/user/{userId}/richmenu/{richMenuId}" - - .replace("{userId}", String(userId)) - - .replace("{richMenuId}", String(richMenuId)), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Link rich menu to multiple users - * @param richMenuBulkLinkRequest - * - * @see Documentation - */ - public async linkRichMenuIdToUsers( - richMenuBulkLinkRequest: RichMenuBulkLinkRequest, - ): Promise { - return ( - await this.linkRichMenuIdToUsersWithHttpInfo(richMenuBulkLinkRequest) - ).body; - } - - /** - * Link rich menu to multiple users. - * This method includes HttpInfo object to return additional information. - * @param richMenuBulkLinkRequest - * - * @see Documentation - */ - public async linkRichMenuIdToUsersWithHttpInfo( - richMenuBulkLinkRequest: RichMenuBulkLinkRequest, - ): Promise> { - const params = richMenuBulkLinkRequest; + "date": date, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/message/delivery/pnp" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get profile + * @param userId User ID + * + * @see Documentation + */ + public async getProfile(userId: string, ) : Promise { + return (await this.getProfileWithHttpInfo(userId, )).body; + } - const res = await this.httpClient.post( - "/v2/bot/richmenu/bulk/link", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Mark messages from users as read - * @param markMessagesAsReadRequest - * - * @see Documentation - */ - public async markMessagesAsRead( - markMessagesAsReadRequest: MarkMessagesAsReadRequest, - ): Promise { - return ( - await this.markMessagesAsReadWithHttpInfo(markMessagesAsReadRequest) - ).body; - } - - /** - * Mark messages from users as read. - * This method includes HttpInfo object to return additional information. - * @param markMessagesAsReadRequest - * - * @see Documentation - */ - public async markMessagesAsReadWithHttpInfo( - markMessagesAsReadRequest: MarkMessagesAsReadRequest, - ): Promise> { - const params = markMessagesAsReadRequest; + /** + * Get profile. + * This method includes HttpInfo object to return additional information. + * @param userId User ID + * + * @see Documentation + */ + public async getProfileWithHttpInfo(userId: string, ) : Promise> { + + - const res = await this.httpClient.post( - "/v2/bot/message/markAsRead", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * An API that efficiently sends the same message to multiple user IDs. You can\'t send messages to group chats or multi-person chats. - * @param multicastRequest - * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. - * - * @see Documentation - */ - public async multicast( - multicastRequest: MulticastRequest, - xLineRetryKey?: string, - ): Promise { - return (await this.multicastWithHttpInfo(multicastRequest, xLineRetryKey)) - .body; - } - - /** - * An API that efficiently sends the same message to multiple user IDs. You can\'t send messages to group chats or multi-person chats.. - * This method includes HttpInfo object to return additional information. - * @param multicastRequest - * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. - * - * @see Documentation - */ - public async multicastWithHttpInfo( - multicastRequest: MulticastRequest, - xLineRetryKey?: string, - ): Promise> { - const params = multicastRequest; - const headerParams = { - ...(xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}), - }; - - const res = await this.httpClient.post( - "/v2/bot/message/multicast", - params, - - { headers: headerParams }, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Send narrowcast message - * @param narrowcastRequest - * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. - * - * @see Documentation - */ - public async narrowcast( - narrowcastRequest: NarrowcastRequest, - xLineRetryKey?: string, - ): Promise { - return (await this.narrowcastWithHttpInfo(narrowcastRequest, xLineRetryKey)) - .body; - } - - /** - * Send narrowcast message. - * This method includes HttpInfo object to return additional information. - * @param narrowcastRequest - * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. - * - * @see Documentation - */ - public async narrowcastWithHttpInfo( - narrowcastRequest: NarrowcastRequest, - xLineRetryKey?: string, - ): Promise> { - const params = narrowcastRequest; + + - const headerParams = { - ...(xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}), - }; - - const res = await this.httpClient.post( - "/v2/bot/message/narrowcast", - params, - - { headers: headerParams }, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Sends a message to a user, group chat, or multi-person chat at any time. - * @param pushMessageRequest - * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. - * - * @see Documentation - */ - public async pushMessage( - pushMessageRequest: PushMessageRequest, - xLineRetryKey?: string, - ): Promise { - return ( - await this.pushMessageWithHttpInfo(pushMessageRequest, xLineRetryKey) - ).body; - } - - /** - * Sends a message to a user, group chat, or multi-person chat at any time.. - * This method includes HttpInfo object to return additional information. - * @param pushMessageRequest - * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. - * - * @see Documentation - */ - public async pushMessageWithHttpInfo( - pushMessageRequest: PushMessageRequest, - xLineRetryKey?: string, - ): Promise> { - const params = pushMessageRequest; + const res = await this.httpClient.get( + "/v2/bot/profile/{userId}" + + .replace("{userId}", String(userId)) + , - const headerParams = { - ...(xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}), - }; - - const res = await this.httpClient.post( - "/v2/bot/message/push", - params, - - { headers: headerParams }, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Send LINE notification message - * @param pnpMessagesRequest - * @param xLineDeliveryTag String returned in the delivery.data property of the delivery completion event via Webhook. - * - * @see Documentation - */ - public async pushMessagesByPhone( - pnpMessagesRequest: PnpMessagesRequest, - xLineDeliveryTag?: string, - ): Promise { - return ( - await this.pushMessagesByPhoneWithHttpInfo( - pnpMessagesRequest, - xLineDeliveryTag, - ) - ).body; - } - - /** - * Send LINE notification message. - * This method includes HttpInfo object to return additional information. - * @param pnpMessagesRequest - * @param xLineDeliveryTag String returned in the delivery.data property of the delivery completion event via Webhook. - * - * @see Documentation - */ - public async pushMessagesByPhoneWithHttpInfo( - pnpMessagesRequest: PnpMessagesRequest, - xLineDeliveryTag?: string, - ): Promise> { - const params = pnpMessagesRequest; + + + ); + return {httpResponse: res, body: await res.json()}; - const headerParams = { - ...(xLineDeliveryTag != null - ? { "X-Line-Delivery-Tag": xLineDeliveryTag } - : {}), - }; - - const res = await this.httpClient.post( - "/bot/pnp/push", - params, - - { headers: headerParams }, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Send reply message - * @param replyMessageRequest - * - * @see Documentation - */ - public async replyMessage( - replyMessageRequest: ReplyMessageRequest, - ): Promise { - return (await this.replyMessageWithHttpInfo(replyMessageRequest)).body; - } - - /** - * Send reply message. - * This method includes HttpInfo object to return additional information. - * @param replyMessageRequest - * - * @see Documentation - */ - public async replyMessageWithHttpInfo( - replyMessageRequest: ReplyMessageRequest, - ): Promise> { - const params = replyMessageRequest; - const res = await this.httpClient.post("/v2/bot/message/reply", params); - return { httpResponse: res, body: await res.json() }; - } - /** - * You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu - * @param richMenuBatchRequest - * - * @see Documentation - */ - public async richMenuBatch( - richMenuBatchRequest: RichMenuBatchRequest, - ): Promise { - return (await this.richMenuBatchWithHttpInfo(richMenuBatchRequest)).body; - } - - /** - * You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu . - * This method includes HttpInfo object to return additional information. - * @param richMenuBatchRequest - * - * @see Documentation - */ - public async richMenuBatchWithHttpInfo( - richMenuBatchRequest: RichMenuBatchRequest, - ): Promise> { - const params = richMenuBatchRequest; + + } +/** + * Gets a rich menu via a rich menu ID. + * @param richMenuId ID of a rich menu + * + * @see Documentation + */ + public async getRichMenu(richMenuId: string, ) : Promise { + return (await this.getRichMenuWithHttpInfo(richMenuId, )).body; + } - const res = await this.httpClient.post("/v2/bot/richmenu/batch", params); - return { httpResponse: res, body: await res.json() }; - } - /** - * Set default rich menu - * @param richMenuId ID of a rich menu - * - * @see Documentation - */ - public async setDefaultRichMenu( - richMenuId: string, - ): Promise { - return (await this.setDefaultRichMenuWithHttpInfo(richMenuId)).body; - } - - /** - * Set default rich menu. - * This method includes HttpInfo object to return additional information. - * @param richMenuId ID of a rich menu - * - * @see Documentation - */ - public async setDefaultRichMenuWithHttpInfo( - richMenuId: string, - ): Promise> { - const res = await this.httpClient.post( - "/v2/bot/user/all/richmenu/{richMenuId}".replace( - "{richMenuId}", - String(richMenuId), - ), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Set webhook endpoint URL - * @param setWebhookEndpointRequest - * - * @see Documentation - */ - public async setWebhookEndpoint( - setWebhookEndpointRequest: SetWebhookEndpointRequest, - ): Promise { - return ( - await this.setWebhookEndpointWithHttpInfo(setWebhookEndpointRequest) - ).body; - } - - /** - * Set webhook endpoint URL. - * This method includes HttpInfo object to return additional information. - * @param setWebhookEndpointRequest - * - * @see Documentation - */ - public async setWebhookEndpointWithHttpInfo( - setWebhookEndpointRequest: SetWebhookEndpointRequest, - ): Promise> { - const params = setWebhookEndpointRequest; + /** + * Gets a rich menu via a rich menu ID.. + * This method includes HttpInfo object to return additional information. + * @param richMenuId ID of a rich menu + * + * @see Documentation + */ + public async getRichMenuWithHttpInfo(richMenuId: string, ) : Promise> { + + - const res = await this.httpClient.put( - "/v2/bot/channel/webhook/endpoint", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Test webhook endpoint - * @param testWebhookEndpointRequest - * - * @see Documentation - */ - public async testWebhookEndpoint( - testWebhookEndpointRequest?: TestWebhookEndpointRequest, - ): Promise { - return ( - await this.testWebhookEndpointWithHttpInfo(testWebhookEndpointRequest) - ).body; - } - - /** - * Test webhook endpoint. - * This method includes HttpInfo object to return additional information. - * @param testWebhookEndpointRequest - * - * @see Documentation - */ - public async testWebhookEndpointWithHttpInfo( - testWebhookEndpointRequest?: TestWebhookEndpointRequest, - ): Promise> { - const params = testWebhookEndpointRequest; - const res = await this.httpClient.post( - "/v2/bot/channel/webhook/test", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Unlink rich menu from user - * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. - * - * @see Documentation - */ - public async unlinkRichMenuIdFromUser( - userId: string, - ): Promise { - return (await this.unlinkRichMenuIdFromUserWithHttpInfo(userId)).body; - } - - /** - * Unlink rich menu from user. - * This method includes HttpInfo object to return additional information. - * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. - * - * @see Documentation - */ - public async unlinkRichMenuIdFromUserWithHttpInfo( - userId: string, - ): Promise> { - const res = await this.httpClient.delete( - "/v2/bot/user/{userId}/richmenu".replace("{userId}", String(userId)), - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Unlink rich menus from multiple users - * @param richMenuBulkUnlinkRequest - * - * @see Documentation - */ - public async unlinkRichMenuIdFromUsers( - richMenuBulkUnlinkRequest: RichMenuBulkUnlinkRequest, - ): Promise { - return ( - await this.unlinkRichMenuIdFromUsersWithHttpInfo( - richMenuBulkUnlinkRequest, - ) - ).body; - } - - /** - * Unlink rich menus from multiple users. - * This method includes HttpInfo object to return additional information. - * @param richMenuBulkUnlinkRequest - * - * @see Documentation - */ - public async unlinkRichMenuIdFromUsersWithHttpInfo( - richMenuBulkUnlinkRequest: RichMenuBulkUnlinkRequest, - ): Promise> { - const params = richMenuBulkUnlinkRequest; + + - const res = await this.httpClient.post( - "/v2/bot/richmenu/bulk/unlink", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Update rich menu alias - * @param richMenuAliasId The rich menu alias ID you want to update. - * @param updateRichMenuAliasRequest - * - * @see Documentation - */ - public async updateRichMenuAlias( - richMenuAliasId: string, - updateRichMenuAliasRequest: UpdateRichMenuAliasRequest, - ): Promise { - return ( - await this.updateRichMenuAliasWithHttpInfo( - richMenuAliasId, - updateRichMenuAliasRequest, - ) - ).body; - } - - /** - * Update rich menu alias. - * This method includes HttpInfo object to return additional information. - * @param richMenuAliasId The rich menu alias ID you want to update. - * @param updateRichMenuAliasRequest - * - * @see Documentation - */ - public async updateRichMenuAliasWithHttpInfo( - richMenuAliasId: string, - updateRichMenuAliasRequest: UpdateRichMenuAliasRequest, - ): Promise> { - const params = updateRichMenuAliasRequest; + const res = await this.httpClient.get( + "/v2/bot/richmenu/{richMenuId}" + + .replace("{richMenuId}", String(richMenuId)) + , - const res = await this.httpClient.post( - "/v2/bot/richmenu/alias/{richMenuAliasId}".replace( - "{richMenuAliasId}", - String(richMenuAliasId), - ), - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Validate message objects of a broadcast message - * @param validateMessageRequest - * - * @see Documentation - */ - public async validateBroadcast( - validateMessageRequest: ValidateMessageRequest, - ): Promise { - return (await this.validateBroadcastWithHttpInfo(validateMessageRequest)) - .body; - } - - /** - * Validate message objects of a broadcast message. - * This method includes HttpInfo object to return additional information. - * @param validateMessageRequest - * - * @see Documentation - */ - public async validateBroadcastWithHttpInfo( - validateMessageRequest: ValidateMessageRequest, - ): Promise> { - const params = validateMessageRequest; + + + ); + return {httpResponse: res, body: await res.json()}; - const res = await this.httpClient.post( - "/v2/bot/message/validate/broadcast", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Validate message objects of a multicast message - * @param validateMessageRequest - * - * @see Documentation - */ - public async validateMulticast( - validateMessageRequest: ValidateMessageRequest, - ): Promise { - return (await this.validateMulticastWithHttpInfo(validateMessageRequest)) - .body; - } - - /** - * Validate message objects of a multicast message. - * This method includes HttpInfo object to return additional information. - * @param validateMessageRequest - * - * @see Documentation - */ - public async validateMulticastWithHttpInfo( - validateMessageRequest: ValidateMessageRequest, - ): Promise> { - const params = validateMessageRequest; - const res = await this.httpClient.post( - "/v2/bot/message/validate/multicast", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Validate message objects of a narrowcast message - * @param validateMessageRequest - * - * @see Documentation - */ - public async validateNarrowcast( - validateMessageRequest: ValidateMessageRequest, - ): Promise { - return (await this.validateNarrowcastWithHttpInfo(validateMessageRequest)) - .body; - } - - /** - * Validate message objects of a narrowcast message. - * This method includes HttpInfo object to return additional information. - * @param validateMessageRequest - * - * @see Documentation - */ - public async validateNarrowcastWithHttpInfo( - validateMessageRequest: ValidateMessageRequest, - ): Promise> { - const params = validateMessageRequest; + + } +/** + * Get rich menu alias information + * @param richMenuAliasId The rich menu alias ID whose information you want to obtain. + * + * @see Documentation + */ + public async getRichMenuAlias(richMenuAliasId: string, ) : Promise { + return (await this.getRichMenuAliasWithHttpInfo(richMenuAliasId, )).body; + } - const res = await this.httpClient.post( - "/v2/bot/message/validate/narrowcast", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Validate message objects of a push message - * @param validateMessageRequest - * - * @see Documentation - */ - public async validatePush( - validateMessageRequest: ValidateMessageRequest, - ): Promise { - return (await this.validatePushWithHttpInfo(validateMessageRequest)).body; - } - - /** - * Validate message objects of a push message. - * This method includes HttpInfo object to return additional information. - * @param validateMessageRequest - * - * @see Documentation - */ - public async validatePushWithHttpInfo( - validateMessageRequest: ValidateMessageRequest, - ): Promise> { - const params = validateMessageRequest; + /** + * Get rich menu alias information. + * This method includes HttpInfo object to return additional information. + * @param richMenuAliasId The rich menu alias ID whose information you want to obtain. + * + * @see Documentation + */ + public async getRichMenuAliasWithHttpInfo(richMenuAliasId: string, ) : Promise> { + + - const res = await this.httpClient.post( - "/v2/bot/message/validate/push", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Validate message objects of a reply message - * @param validateMessageRequest - * - * @see Documentation - */ - public async validateReply( - validateMessageRequest: ValidateMessageRequest, - ): Promise { - return (await this.validateReplyWithHttpInfo(validateMessageRequest)).body; - } - - /** - * Validate message objects of a reply message. - * This method includes HttpInfo object to return additional information. - * @param validateMessageRequest - * - * @see Documentation - */ - public async validateReplyWithHttpInfo( - validateMessageRequest: ValidateMessageRequest, - ): Promise> { - const params = validateMessageRequest; - const res = await this.httpClient.post( - "/v2/bot/message/validate/reply", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Validate a request body of the Replace or unlink the linked rich menus in batches endpoint. - * @param richMenuBatchRequest - * - * @see Documentation - */ - public async validateRichMenuBatchRequest( - richMenuBatchRequest: RichMenuBatchRequest, - ): Promise { - return ( - await this.validateRichMenuBatchRequestWithHttpInfo(richMenuBatchRequest) - ).body; - } - - /** - * Validate a request body of the Replace or unlink the linked rich menus in batches endpoint.. - * This method includes HttpInfo object to return additional information. - * @param richMenuBatchRequest - * - * @see Documentation - */ - public async validateRichMenuBatchRequestWithHttpInfo( - richMenuBatchRequest: RichMenuBatchRequest, - ): Promise> { - const params = richMenuBatchRequest; + + - const res = await this.httpClient.post( - "/v2/bot/richmenu/validate/batch", - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * Validate rich menu object - * @param richMenuRequest - * - * @see Documentation - */ - public async validateRichMenuObject( - richMenuRequest: RichMenuRequest, - ): Promise { - return (await this.validateRichMenuObjectWithHttpInfo(richMenuRequest)) - .body; - } - - /** - * Validate rich menu object. - * This method includes HttpInfo object to return additional information. - * @param richMenuRequest - * - * @see Documentation - */ - public async validateRichMenuObjectWithHttpInfo( - richMenuRequest: RichMenuRequest, - ): Promise> { - const params = richMenuRequest; + const res = await this.httpClient.get( + "/v2/bot/richmenu/alias/{richMenuAliasId}" + + .replace("{richMenuAliasId}", String(richMenuAliasId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get list of rich menu alias + * + * @see Documentation + */ + public async getRichMenuAliasList() : Promise { + return (await this.getRichMenuAliasListWithHttpInfo()).body; + } + + /** + * Get list of rich menu alias. + * This method includes HttpInfo object to return additional information. + * + * @see Documentation + */ + public async getRichMenuAliasListWithHttpInfo() : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/richmenu/alias/list" + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get the status of Replace or unlink a linked rich menus in batches. + * @param requestId A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. + * + * @see Documentation + */ + public async getRichMenuBatchProgress(requestId: string, ) : Promise { + return (await this.getRichMenuBatchProgressWithHttpInfo(requestId, )).body; + } + + /** + * Get the status of Replace or unlink a linked rich menus in batches.. + * This method includes HttpInfo object to return additional information. + * @param requestId A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. + * + * @see Documentation + */ + public async getRichMenuBatchProgressWithHttpInfo(requestId: string, ) : Promise> { + + + + + const queryParams = { + "requestId": requestId, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/richmenu/progress/batch" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get rich menu ID of user + * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + * + * @see Documentation + */ + public async getRichMenuIdOfUser(userId: string, ) : Promise { + return (await this.getRichMenuIdOfUserWithHttpInfo(userId, )).body; + } + + /** + * Get rich menu ID of user. + * This method includes HttpInfo object to return additional information. + * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + * + * @see Documentation + */ + public async getRichMenuIdOfUserWithHttpInfo(userId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/user/{userId}/richmenu" + + .replace("{userId}", String(userId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get rich menu list + * + * @see Documentation + */ + public async getRichMenuList() : Promise { + return (await this.getRichMenuListWithHttpInfo()).body; + } + + /** + * Get rich menu list. + * This method includes HttpInfo object to return additional information. + * + * @see Documentation + */ + public async getRichMenuListWithHttpInfo() : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/richmenu/list" + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get number of users in a multi-person chat + * @param roomId Room ID + * + * @see Documentation + */ + public async getRoomMemberCount(roomId: string, ) : Promise { + return (await this.getRoomMemberCountWithHttpInfo(roomId, )).body; + } + + /** + * Get number of users in a multi-person chat. + * This method includes HttpInfo object to return additional information. + * @param roomId Room ID + * + * @see Documentation + */ + public async getRoomMemberCountWithHttpInfo(roomId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/room/{roomId}/members/count" + + .replace("{roomId}", String(roomId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get multi-person chat member profile + * @param roomId Room ID + * @param userId User ID + * + * @see Documentation + */ + public async getRoomMemberProfile(roomId: string, userId: string, ) : Promise { + return (await this.getRoomMemberProfileWithHttpInfo(roomId, userId, )).body; + } + + /** + * Get multi-person chat member profile. + * This method includes HttpInfo object to return additional information. + * @param roomId Room ID + * @param userId User ID + * + * @see Documentation + */ + public async getRoomMemberProfileWithHttpInfo(roomId: string, userId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/room/{roomId}/member/{userId}" + + .replace("{roomId}", String(roomId)) + + .replace("{userId}", String(userId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get multi-person chat member user IDs + * @param roomId Room ID + * @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + * + * @see Documentation + */ + public async getRoomMembersIds(roomId: string, start?: string, ) : Promise { + return (await this.getRoomMembersIdsWithHttpInfo(roomId, start, )).body; + } + + /** + * Get multi-person chat member user IDs. + * This method includes HttpInfo object to return additional information. + * @param roomId Room ID + * @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + * + * @see Documentation + */ + public async getRoomMembersIdsWithHttpInfo(roomId: string, start?: string, ) : Promise> { + + + + + const queryParams = { + "start": start, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/room/{roomId}/members/ids" + + .replace("{roomId}", String(roomId)) + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Get webhook endpoint information + * + * @see Documentation + */ + public async getWebhookEndpoint() : Promise { + return (await this.getWebhookEndpointWithHttpInfo()).body; + } + + /** + * Get webhook endpoint information. + * This method includes HttpInfo object to return additional information. + * + * @see Documentation + */ + public async getWebhookEndpointWithHttpInfo() : Promise> { + + + + + + + + const res = await this.httpClient.get( + "/v2/bot/channel/webhook/endpoint" + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Issue link token + * @param userId User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. + * + * @see Documentation + */ + public async issueLinkToken(userId: string, ) : Promise { + return (await this.issueLinkTokenWithHttpInfo(userId, )).body; + } + + /** + * Issue link token. + * This method includes HttpInfo object to return additional information. + * @param userId User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. + * + * @see Documentation + */ + public async issueLinkTokenWithHttpInfo(userId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.post( + "/v2/bot/user/{userId}/linkToken" + + .replace("{userId}", String(userId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Leave group chat + * @param groupId Group ID + * + * @see Documentation + */ + public async leaveGroup(groupId: string, ) : Promise { + return (await this.leaveGroupWithHttpInfo(groupId, )).body; + } + + /** + * Leave group chat. + * This method includes HttpInfo object to return additional information. + * @param groupId Group ID + * + * @see Documentation + */ + public async leaveGroupWithHttpInfo(groupId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.post( + "/v2/bot/group/{groupId}/leave" + + .replace("{groupId}", String(groupId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Leave multi-person chat + * @param roomId Room ID + * + * @see Documentation + */ + public async leaveRoom(roomId: string, ) : Promise { + return (await this.leaveRoomWithHttpInfo(roomId, )).body; + } + + /** + * Leave multi-person chat. + * This method includes HttpInfo object to return additional information. + * @param roomId Room ID + * + * @see Documentation + */ + public async leaveRoomWithHttpInfo(roomId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.post( + "/v2/bot/room/{roomId}/leave" + + .replace("{roomId}", String(roomId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Link rich menu to user. + * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + * @param richMenuId ID of a rich menu + * + * @see Documentation + */ + public async linkRichMenuIdToUser(userId: string, richMenuId: string, ) : Promise { + return (await this.linkRichMenuIdToUserWithHttpInfo(userId, richMenuId, )).body; + } + + /** + * Link rich menu to user.. + * This method includes HttpInfo object to return additional information. + * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + * @param richMenuId ID of a rich menu + * + * @see Documentation + */ + public async linkRichMenuIdToUserWithHttpInfo(userId: string, richMenuId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.post( + "/v2/bot/user/{userId}/richmenu/{richMenuId}" + + .replace("{userId}", String(userId)) + + .replace("{richMenuId}", String(richMenuId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Link rich menu to multiple users + * @param richMenuBulkLinkRequest + * + * @see Documentation + */ + public async linkRichMenuIdToUsers(richMenuBulkLinkRequest: RichMenuBulkLinkRequest, ) : Promise { + return (await this.linkRichMenuIdToUsersWithHttpInfo(richMenuBulkLinkRequest, )).body; + } + + /** + * Link rich menu to multiple users. + * This method includes HttpInfo object to return additional information. + * @param richMenuBulkLinkRequest + * + * @see Documentation + */ + public async linkRichMenuIdToUsersWithHttpInfo(richMenuBulkLinkRequest: RichMenuBulkLinkRequest, ) : Promise> { + + + + + const params = richMenuBulkLinkRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/richmenu/bulk/link" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Mark messages from users as read + * @param markMessagesAsReadRequest + * + * @see Documentation + */ + public async markMessagesAsRead(markMessagesAsReadRequest: MarkMessagesAsReadRequest, ) : Promise { + return (await this.markMessagesAsReadWithHttpInfo(markMessagesAsReadRequest, )).body; + } + + /** + * Mark messages from users as read. + * This method includes HttpInfo object to return additional information. + * @param markMessagesAsReadRequest + * + * @see Documentation + */ + public async markMessagesAsReadWithHttpInfo(markMessagesAsReadRequest: MarkMessagesAsReadRequest, ) : Promise> { + + + + + const params = markMessagesAsReadRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/message/markAsRead" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * An API that efficiently sends the same message to multiple user IDs. You can\'t send messages to group chats or multi-person chats. + * @param multicastRequest + * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. + * + * @see Documentation + */ + public async multicast(multicastRequest: MulticastRequest, xLineRetryKey?: string, ) : Promise { + return (await this.multicastWithHttpInfo(multicastRequest, xLineRetryKey, )).body; + } + + /** + * An API that efficiently sends the same message to multiple user IDs. You can\'t send messages to group chats or multi-person chats.. + * This method includes HttpInfo object to return additional information. + * @param multicastRequest + * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. + * + * @see Documentation + */ + public async multicastWithHttpInfo(multicastRequest: MulticastRequest, xLineRetryKey?: string, ) : Promise> { + + + + + const params = multicastRequest; + + const headerParams = { + ...(xLineRetryKey != null ? {"X-Line-Retry-Key": xLineRetryKey} : {}), + + }; + + + const res = await this.httpClient.post( + "/v2/bot/message/multicast" + , + + params, + + {headers: headerParams}, + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Send narrowcast message + * @param narrowcastRequest + * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. + * + * @see Documentation + */ + public async narrowcast(narrowcastRequest: NarrowcastRequest, xLineRetryKey?: string, ) : Promise { + return (await this.narrowcastWithHttpInfo(narrowcastRequest, xLineRetryKey, )).body; + } + + /** + * Send narrowcast message. + * This method includes HttpInfo object to return additional information. + * @param narrowcastRequest + * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. + * + * @see Documentation + */ + public async narrowcastWithHttpInfo(narrowcastRequest: NarrowcastRequest, xLineRetryKey?: string, ) : Promise> { + + + + + const params = narrowcastRequest; + + const headerParams = { + ...(xLineRetryKey != null ? {"X-Line-Retry-Key": xLineRetryKey} : {}), + + }; + + + const res = await this.httpClient.post( + "/v2/bot/message/narrowcast" + , + + params, + + {headers: headerParams}, + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Sends a message to a user, group chat, or multi-person chat at any time. + * @param pushMessageRequest + * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. + * + * @see Documentation + */ + public async pushMessage(pushMessageRequest: PushMessageRequest, xLineRetryKey?: string, ) : Promise { + return (await this.pushMessageWithHttpInfo(pushMessageRequest, xLineRetryKey, )).body; + } + + /** + * Sends a message to a user, group chat, or multi-person chat at any time.. + * This method includes HttpInfo object to return additional information. + * @param pushMessageRequest + * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key. + * + * @see Documentation + */ + public async pushMessageWithHttpInfo(pushMessageRequest: PushMessageRequest, xLineRetryKey?: string, ) : Promise> { + + + + + const params = pushMessageRequest; + + const headerParams = { + ...(xLineRetryKey != null ? {"X-Line-Retry-Key": xLineRetryKey} : {}), + + }; + + + const res = await this.httpClient.post( + "/v2/bot/message/push" + , + + params, + + {headers: headerParams}, + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Send LINE notification message + * @param pnpMessagesRequest + * @param xLineDeliveryTag String returned in the delivery.data property of the delivery completion event via Webhook. + * + * @see Documentation + */ + public async pushMessagesByPhone(pnpMessagesRequest: PnpMessagesRequest, xLineDeliveryTag?: string, ) : Promise { + return (await this.pushMessagesByPhoneWithHttpInfo(pnpMessagesRequest, xLineDeliveryTag, )).body; + } + + /** + * Send LINE notification message. + * This method includes HttpInfo object to return additional information. + * @param pnpMessagesRequest + * @param xLineDeliveryTag String returned in the delivery.data property of the delivery completion event via Webhook. + * + * @see Documentation + */ + public async pushMessagesByPhoneWithHttpInfo(pnpMessagesRequest: PnpMessagesRequest, xLineDeliveryTag?: string, ) : Promise> { + + + + + const params = pnpMessagesRequest; + + const headerParams = { + ...(xLineDeliveryTag != null ? {"X-Line-Delivery-Tag": xLineDeliveryTag} : {}), + + }; + + + const res = await this.httpClient.post( + "/bot/pnp/push" + , + + params, + + {headers: headerParams}, + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Send reply message + * @param replyMessageRequest + * + * @see Documentation + */ + public async replyMessage(replyMessageRequest: ReplyMessageRequest, ) : Promise { + return (await this.replyMessageWithHttpInfo(replyMessageRequest, )).body; + } + + /** + * Send reply message. + * This method includes HttpInfo object to return additional information. + * @param replyMessageRequest + * + * @see Documentation + */ + public async replyMessageWithHttpInfo(replyMessageRequest: ReplyMessageRequest, ) : Promise> { + + + + + const params = replyMessageRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/message/reply" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu + * @param richMenuBatchRequest + * + * @see Documentation + */ + public async richMenuBatch(richMenuBatchRequest: RichMenuBatchRequest, ) : Promise { + return (await this.richMenuBatchWithHttpInfo(richMenuBatchRequest, )).body; + } + + /** + * You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu . + * This method includes HttpInfo object to return additional information. + * @param richMenuBatchRequest + * + * @see Documentation + */ + public async richMenuBatchWithHttpInfo(richMenuBatchRequest: RichMenuBatchRequest, ) : Promise> { + + + + + const params = richMenuBatchRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/richmenu/batch" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Set default rich menu + * @param richMenuId ID of a rich menu + * + * @see Documentation + */ + public async setDefaultRichMenu(richMenuId: string, ) : Promise { + return (await this.setDefaultRichMenuWithHttpInfo(richMenuId, )).body; + } + + /** + * Set default rich menu. + * This method includes HttpInfo object to return additional information. + * @param richMenuId ID of a rich menu + * + * @see Documentation + */ + public async setDefaultRichMenuWithHttpInfo(richMenuId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.post( + "/v2/bot/user/all/richmenu/{richMenuId}" + + .replace("{richMenuId}", String(richMenuId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Set webhook endpoint URL + * @param setWebhookEndpointRequest + * + * @see Documentation + */ + public async setWebhookEndpoint(setWebhookEndpointRequest: SetWebhookEndpointRequest, ) : Promise { + return (await this.setWebhookEndpointWithHttpInfo(setWebhookEndpointRequest, )).body; + } + + /** + * Set webhook endpoint URL. + * This method includes HttpInfo object to return additional information. + * @param setWebhookEndpointRequest + * + * @see Documentation + */ + public async setWebhookEndpointWithHttpInfo(setWebhookEndpointRequest: SetWebhookEndpointRequest, ) : Promise> { + + + + + const params = setWebhookEndpointRequest; + + + + const res = await this.httpClient.put( + "/v2/bot/channel/webhook/endpoint" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Test webhook endpoint + * @param testWebhookEndpointRequest + * + * @see Documentation + */ + public async testWebhookEndpoint(testWebhookEndpointRequest?: TestWebhookEndpointRequest, ) : Promise { + return (await this.testWebhookEndpointWithHttpInfo(testWebhookEndpointRequest, )).body; + } + + /** + * Test webhook endpoint. + * This method includes HttpInfo object to return additional information. + * @param testWebhookEndpointRequest + * + * @see Documentation + */ + public async testWebhookEndpointWithHttpInfo(testWebhookEndpointRequest?: TestWebhookEndpointRequest, ) : Promise> { + + + + + const params = testWebhookEndpointRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/channel/webhook/test" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Unlink rich menu from user + * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + * + * @see Documentation + */ + public async unlinkRichMenuIdFromUser(userId: string, ) : Promise { + return (await this.unlinkRichMenuIdFromUserWithHttpInfo(userId, )).body; + } + + /** + * Unlink rich menu from user. + * This method includes HttpInfo object to return additional information. + * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + * + * @see Documentation + */ + public async unlinkRichMenuIdFromUserWithHttpInfo(userId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.delete( + "/v2/bot/user/{userId}/richmenu" + + .replace("{userId}", String(userId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Unlink rich menus from multiple users + * @param richMenuBulkUnlinkRequest + * + * @see Documentation + */ + public async unlinkRichMenuIdFromUsers(richMenuBulkUnlinkRequest: RichMenuBulkUnlinkRequest, ) : Promise { + return (await this.unlinkRichMenuIdFromUsersWithHttpInfo(richMenuBulkUnlinkRequest, )).body; + } + + /** + * Unlink rich menus from multiple users. + * This method includes HttpInfo object to return additional information. + * @param richMenuBulkUnlinkRequest + * + * @see Documentation + */ + public async unlinkRichMenuIdFromUsersWithHttpInfo(richMenuBulkUnlinkRequest: RichMenuBulkUnlinkRequest, ) : Promise> { + + + + + const params = richMenuBulkUnlinkRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/richmenu/bulk/unlink" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Update rich menu alias + * @param richMenuAliasId The rich menu alias ID you want to update. + * @param updateRichMenuAliasRequest + * + * @see Documentation + */ + public async updateRichMenuAlias(richMenuAliasId: string, updateRichMenuAliasRequest: UpdateRichMenuAliasRequest, ) : Promise { + return (await this.updateRichMenuAliasWithHttpInfo(richMenuAliasId, updateRichMenuAliasRequest, )).body; + } + + /** + * Update rich menu alias. + * This method includes HttpInfo object to return additional information. + * @param richMenuAliasId The rich menu alias ID you want to update. + * @param updateRichMenuAliasRequest + * + * @see Documentation + */ + public async updateRichMenuAliasWithHttpInfo(richMenuAliasId: string, updateRichMenuAliasRequest: UpdateRichMenuAliasRequest, ) : Promise> { + + + + + const params = updateRichMenuAliasRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/richmenu/alias/{richMenuAliasId}" + + .replace("{richMenuAliasId}", String(richMenuAliasId)) + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Validate message objects of a broadcast message + * @param validateMessageRequest + * + * @see Documentation + */ + public async validateBroadcast(validateMessageRequest: ValidateMessageRequest, ) : Promise { + return (await this.validateBroadcastWithHttpInfo(validateMessageRequest, )).body; + } + + /** + * Validate message objects of a broadcast message. + * This method includes HttpInfo object to return additional information. + * @param validateMessageRequest + * + * @see Documentation + */ + public async validateBroadcastWithHttpInfo(validateMessageRequest: ValidateMessageRequest, ) : Promise> { + + + + + const params = validateMessageRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/message/validate/broadcast" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Validate message objects of a multicast message + * @param validateMessageRequest + * + * @see Documentation + */ + public async validateMulticast(validateMessageRequest: ValidateMessageRequest, ) : Promise { + return (await this.validateMulticastWithHttpInfo(validateMessageRequest, )).body; + } + + /** + * Validate message objects of a multicast message. + * This method includes HttpInfo object to return additional information. + * @param validateMessageRequest + * + * @see Documentation + */ + public async validateMulticastWithHttpInfo(validateMessageRequest: ValidateMessageRequest, ) : Promise> { + + + + + const params = validateMessageRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/message/validate/multicast" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Validate message objects of a narrowcast message + * @param validateMessageRequest + * + * @see Documentation + */ + public async validateNarrowcast(validateMessageRequest: ValidateMessageRequest, ) : Promise { + return (await this.validateNarrowcastWithHttpInfo(validateMessageRequest, )).body; + } + + /** + * Validate message objects of a narrowcast message. + * This method includes HttpInfo object to return additional information. + * @param validateMessageRequest + * + * @see Documentation + */ + public async validateNarrowcastWithHttpInfo(validateMessageRequest: ValidateMessageRequest, ) : Promise> { + + + + + const params = validateMessageRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/message/validate/narrowcast" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Validate message objects of a push message + * @param validateMessageRequest + * + * @see Documentation + */ + public async validatePush(validateMessageRequest: ValidateMessageRequest, ) : Promise { + return (await this.validatePushWithHttpInfo(validateMessageRequest, )).body; + } + + /** + * Validate message objects of a push message. + * This method includes HttpInfo object to return additional information. + * @param validateMessageRequest + * + * @see Documentation + */ + public async validatePushWithHttpInfo(validateMessageRequest: ValidateMessageRequest, ) : Promise> { + + + + + const params = validateMessageRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/message/validate/push" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Validate message objects of a reply message + * @param validateMessageRequest + * + * @see Documentation + */ + public async validateReply(validateMessageRequest: ValidateMessageRequest, ) : Promise { + return (await this.validateReplyWithHttpInfo(validateMessageRequest, )).body; + } + + /** + * Validate message objects of a reply message. + * This method includes HttpInfo object to return additional information. + * @param validateMessageRequest + * + * @see Documentation + */ + public async validateReplyWithHttpInfo(validateMessageRequest: ValidateMessageRequest, ) : Promise> { + + + + + const params = validateMessageRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/message/validate/reply" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Validate a request body of the Replace or unlink the linked rich menus in batches endpoint. + * @param richMenuBatchRequest + * + * @see Documentation + */ + public async validateRichMenuBatchRequest(richMenuBatchRequest: RichMenuBatchRequest, ) : Promise { + return (await this.validateRichMenuBatchRequestWithHttpInfo(richMenuBatchRequest, )).body; + } + + /** + * Validate a request body of the Replace or unlink the linked rich menus in batches endpoint.. + * This method includes HttpInfo object to return additional information. + * @param richMenuBatchRequest + * + * @see Documentation + */ + public async validateRichMenuBatchRequestWithHttpInfo(richMenuBatchRequest: RichMenuBatchRequest, ) : Promise> { + + + + + const params = richMenuBatchRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/richmenu/validate/batch" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Validate rich menu object + * @param richMenuRequest + * + * @see Documentation + */ + public async validateRichMenuObject(richMenuRequest: RichMenuRequest, ) : Promise { + return (await this.validateRichMenuObjectWithHttpInfo(richMenuRequest, )).body; + } + + /** + * Validate rich menu object. + * This method includes HttpInfo object to return additional information. + * @param richMenuRequest + * + * @see Documentation + */ + public async validateRichMenuObjectWithHttpInfo(richMenuRequest: RichMenuRequest, ) : Promise> { + + + + + const params = richMenuRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/richmenu/validate" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } - const res = await this.httpClient.post("/v2/bot/richmenu/validate", params); - return { httpResponse: res, body: await res.json() }; - } } diff --git a/lib/messaging-api/model/action.ts b/lib/messaging-api/model/action.ts index 8b6a98c35..284b0d120 100644 --- a/lib/messaging-api/model/action.ts +++ b/lib/messaging-api/model/action.ts @@ -10,46 +10,61 @@ * Do not edit the class manually. */ -import { CameraAction } from "./models"; -import { CameraRollAction } from "./models"; -import { ClipboardAction } from "./models"; -import { DatetimePickerAction } from "./models"; -import { LocationAction } from "./models"; -import { MessageAction } from "./models"; -import { PostbackAction } from "./models"; -import { RichMenuSwitchAction } from "./models"; -import { URIAction } from "./models"; + + + + + + import { CameraAction } from './models.js'; + import { CameraRollAction } from './models.js'; + import { ClipboardAction } from './models.js'; + import { DatetimePickerAction } from './models.js'; + import { LocationAction } from './models.js'; + import { MessageAction } from './models.js'; + import { PostbackAction } from './models.js'; + import { RichMenuSwitchAction } from './models.js'; + import { URIAction } from './models.js'; + export type Action = - | CameraAction // camera - | CameraRollAction // cameraRoll - | ClipboardAction // clipboard - | DatetimePickerAction // datetimepicker - | LocationAction // location - | MessageAction // message - | PostbackAction // postback - | RichMenuSwitchAction // richmenuswitch - | URIAction // uri - | UnknownAction; + | CameraAction // camera + | CameraRollAction // cameraRoll + | ClipboardAction // clipboard + | DatetimePickerAction // datetimepicker + | LocationAction // location + | MessageAction // message + | PostbackAction // postback + | RichMenuSwitchAction // richmenuswitch + | URIAction // uri + | UnknownAction +; export type UnknownAction = ActionBase & { - [key: string]: unknown; + [key: string]: unknown; }; - + /** * Action */ -export type ActionBase = { - /** - * Type of action - * - * @see type Documentation - */ - type?: string /**/; - /** - * Label for the action. - * - * @see label Documentation - */ - label?: string /**/; -}; +export type ActionBase = { + /** + * Type of action + * + * @see type Documentation + */ + 'type'?: string/**/; + /** + * Label for the action. + * + * @see label Documentation + */ + 'label'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/ageDemographic.ts b/lib/messaging-api/model/ageDemographic.ts index f99b905fa..0e2b52aaa 100644 --- a/lib/messaging-api/model/ageDemographic.ts +++ b/lib/messaging-api/model/ageDemographic.ts @@ -10,12 +10,25 @@ * Do not edit the class manually. */ -export type AgeDemographic = - | "age_15" - | "age_20" - | "age_25" - | "age_30" - | "age_35" - | "age_40" - | "age_45" - | "age_50"; + + + + + + + + + export type AgeDemographic = + 'age_15' + | 'age_20' + | 'age_25' + | 'age_30' + | 'age_35' + | 'age_40' + | 'age_45' + | 'age_50' + +; + + + diff --git a/lib/messaging-api/model/ageDemographicFilter.ts b/lib/messaging-api/model/ageDemographicFilter.ts index 983d33aa5..c5617270a 100644 --- a/lib/messaging-api/model/ageDemographicFilter.ts +++ b/lib/messaging-api/model/ageDemographicFilter.ts @@ -10,19 +10,34 @@ * Do not edit the class manually. */ -import { AgeDemographic } from "./ageDemographic"; -import { DemographicFilter } from "./demographicFilter"; - -import { DemographicFilterBase } from "./models"; - -export type AgeDemographicFilter = DemographicFilterBase & { - type: "age"; - /** - */ - gte?: AgeDemographic /**/; - /** - */ - lt?: AgeDemographic /**/; -}; - -export namespace AgeDemographicFilter {} + + + import { AgeDemographic } from './ageDemographic.js';import { DemographicFilter } from './demographicFilter.js'; + + +import { DemographicFilterBase } from './models.js'; + + +export type AgeDemographicFilter = DemographicFilterBase & { +type: "age", + /** + */ + 'gte'?: AgeDemographic/**/; + /** + */ + 'lt'?: AgeDemographic/**/; + +} + + + +export namespace AgeDemographicFilter { + + + +} + + + + + diff --git a/lib/messaging-api/model/altUri.ts b/lib/messaging-api/model/altUri.ts index 34b9b4075..8b400c940 100644 --- a/lib/messaging-api/model/altUri.ts +++ b/lib/messaging-api/model/altUri.ts @@ -10,8 +10,21 @@ * Do not edit the class manually. */ -export type AltUri = { - /** - */ - desktop?: string /**/; -}; + + + + + +export type AltUri = { + /** + */ + 'desktop'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/appTypeDemographic.ts b/lib/messaging-api/model/appTypeDemographic.ts index 266f86559..cbbdf97ae 100644 --- a/lib/messaging-api/model/appTypeDemographic.ts +++ b/lib/messaging-api/model/appTypeDemographic.ts @@ -10,4 +10,19 @@ * Do not edit the class manually. */ -export type AppTypeDemographic = "ios" | "android"; + + + + + + + + + export type AppTypeDemographic = + 'ios' + | 'android' + +; + + + diff --git a/lib/messaging-api/model/appTypeDemographicFilter.ts b/lib/messaging-api/model/appTypeDemographicFilter.ts index f2cd486ae..9f69486ee 100644 --- a/lib/messaging-api/model/appTypeDemographicFilter.ts +++ b/lib/messaging-api/model/appTypeDemographicFilter.ts @@ -10,14 +10,25 @@ * Do not edit the class manually. */ -import { AppTypeDemographic } from "./appTypeDemographic"; -import { DemographicFilter } from "./demographicFilter"; -import { DemographicFilterBase } from "./models"; -export type AppTypeDemographicFilter = DemographicFilterBase & { - type: "appType"; - /** - */ - oneOf?: Array /**/; -}; + import { AppTypeDemographic } from './appTypeDemographic.js';import { DemographicFilter } from './demographicFilter.js'; + + +import { DemographicFilterBase } from './models.js'; + + +export type AppTypeDemographicFilter = DemographicFilterBase & { +type: "appType", + /** + */ + 'oneOf'?: Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/areaDemographic.ts b/lib/messaging-api/model/areaDemographic.ts index 28495f3a2..389f4e1b1 100644 --- a/lib/messaging-api/model/areaDemographic.ts +++ b/lib/messaging-api/model/areaDemographic.ts @@ -10,93 +10,106 @@ * Do not edit the class manually. */ -export type AreaDemographic = - | "jp_01" - | "jp_02" - | "jp_03" - | "jp_04" - | "jp_05" - | "jp_06" - | "jp_07" - | "jp_08" - | "jp_09" - | "jp_10" - | "jp_11" - | "jp_12" - | "jp_13" - | "jp_14" - | "jp_15" - | "jp_16" - | "jp_17" - | "jp_18" - | "jp_19" - | "jp_20" - | "jp_21" - | "jp_22" - | "jp_23" - | "jp_24" - | "jp_25" - | "jp_26" - | "jp_27" - | "jp_28" - | "jp_29" - | "jp_30" - | "jp_31" - | "jp_32" - | "jp_33" - | "jp_34" - | "jp_35" - | "jp_36" - | "jp_37" - | "jp_38" - | "jp_39" - | "jp_40" - | "jp_41" - | "jp_42" - | "jp_43" - | "jp_44" - | "jp_45" - | "jp_46" - | "jp_47" - | "tw_01" - | "tw_02" - | "tw_03" - | "tw_04" - | "tw_05" - | "tw_06" - | "tw_07" - | "tw_08" - | "tw_09" - | "tw_10" - | "tw_11" - | "tw_12" - | "tw_13" - | "tw_14" - | "tw_15" - | "tw_16" - | "tw_17" - | "tw_18" - | "tw_19" - | "tw_20" - | "tw_21" - | "tw_22" - | "th_01" - | "th_02" - | "th_03" - | "th_04" - | "th_05" - | "th_06" - | "th_07" - | "th_08" - | "id_01" - | "id_02" - | "id_03" - | "id_04" - | "id_05" - | "id_06" - | "id_07" - | "id_08" - | "id_09" - | "id_10" - | "id_11" - | "id_12"; + + + + + + + + + export type AreaDemographic = + 'jp_01' + | 'jp_02' + | 'jp_03' + | 'jp_04' + | 'jp_05' + | 'jp_06' + | 'jp_07' + | 'jp_08' + | 'jp_09' + | 'jp_10' + | 'jp_11' + | 'jp_12' + | 'jp_13' + | 'jp_14' + | 'jp_15' + | 'jp_16' + | 'jp_17' + | 'jp_18' + | 'jp_19' + | 'jp_20' + | 'jp_21' + | 'jp_22' + | 'jp_23' + | 'jp_24' + | 'jp_25' + | 'jp_26' + | 'jp_27' + | 'jp_28' + | 'jp_29' + | 'jp_30' + | 'jp_31' + | 'jp_32' + | 'jp_33' + | 'jp_34' + | 'jp_35' + | 'jp_36' + | 'jp_37' + | 'jp_38' + | 'jp_39' + | 'jp_40' + | 'jp_41' + | 'jp_42' + | 'jp_43' + | 'jp_44' + | 'jp_45' + | 'jp_46' + | 'jp_47' + | 'tw_01' + | 'tw_02' + | 'tw_03' + | 'tw_04' + | 'tw_05' + | 'tw_06' + | 'tw_07' + | 'tw_08' + | 'tw_09' + | 'tw_10' + | 'tw_11' + | 'tw_12' + | 'tw_13' + | 'tw_14' + | 'tw_15' + | 'tw_16' + | 'tw_17' + | 'tw_18' + | 'tw_19' + | 'tw_20' + | 'tw_21' + | 'tw_22' + | 'th_01' + | 'th_02' + | 'th_03' + | 'th_04' + | 'th_05' + | 'th_06' + | 'th_07' + | 'th_08' + | 'id_01' + | 'id_02' + | 'id_03' + | 'id_04' + | 'id_05' + | 'id_06' + | 'id_07' + | 'id_08' + | 'id_09' + | 'id_10' + | 'id_11' + | 'id_12' + +; + + + diff --git a/lib/messaging-api/model/areaDemographicFilter.ts b/lib/messaging-api/model/areaDemographicFilter.ts index 5fd608295..27fa3e890 100644 --- a/lib/messaging-api/model/areaDemographicFilter.ts +++ b/lib/messaging-api/model/areaDemographicFilter.ts @@ -10,14 +10,25 @@ * Do not edit the class manually. */ -import { AreaDemographic } from "./areaDemographic"; -import { DemographicFilter } from "./demographicFilter"; -import { DemographicFilterBase } from "./models"; -export type AreaDemographicFilter = DemographicFilterBase & { - type: "area"; - /** - */ - oneOf?: Array /**/; -}; + import { AreaDemographic } from './areaDemographic.js';import { DemographicFilter } from './demographicFilter.js'; + + +import { DemographicFilterBase } from './models.js'; + + +export type AreaDemographicFilter = DemographicFilterBase & { +type: "area", + /** + */ + 'oneOf'?: Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/audienceMatchMessagesRequest.ts b/lib/messaging-api/model/audienceMatchMessagesRequest.ts index fd56fa7ce..95109572d 100644 --- a/lib/messaging-api/model/audienceMatchMessagesRequest.ts +++ b/lib/messaging-api/model/audienceMatchMessagesRequest.ts @@ -10,25 +10,36 @@ * Do not edit the class manually. */ -import { Message } from "./message"; - -export type AudienceMatchMessagesRequest = { - /** - * Destination of the message (A value obtained by hashing the telephone number, which is another value normalized to E.164 format, with SHA256). - * - * @see messages Documentation - */ - messages: Array /**/; - /** - * Message to send. - * - * @see to Documentation - */ - to: Array /**/; - /** - * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. - * - * @see notificationDisabled Documentation - */ - notificationDisabled?: boolean /* = false*/; -}; + + + import { Message } from './message.js'; + + +export type AudienceMatchMessagesRequest = { + /** + * Destination of the message (A value obtained by hashing the telephone number, which is another value normalized to E.164 format, with SHA256). + * + * @see messages Documentation + */ + 'messages': Array/**/; + /** + * Message to send. + * + * @see to Documentation + */ + 'to': Array/**/; + /** + * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. + * + * @see notificationDisabled Documentation + */ + 'notificationDisabled'?: boolean/* = false*/; + +} + + + + + + + diff --git a/lib/messaging-api/model/audienceRecipient.ts b/lib/messaging-api/model/audienceRecipient.ts index 9881f4ddd..5b95331c2 100644 --- a/lib/messaging-api/model/audienceRecipient.ts +++ b/lib/messaging-api/model/audienceRecipient.ts @@ -10,13 +10,25 @@ * Do not edit the class manually. */ -import { Recipient } from "./recipient"; -import { RecipientBase } from "./models"; -export type AudienceRecipient = RecipientBase & { - type: "audience"; - /** - */ - audienceGroupId?: number /**/; -}; + import { Recipient } from './recipient.js'; + + +import { RecipientBase } from './models.js'; + + +export type AudienceRecipient = RecipientBase & { +type: "audience", + /** + */ + 'audienceGroupId'?: number/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/audioMessage.ts b/lib/messaging-api/model/audioMessage.ts index 1c624f6e1..79f51a0b9 100644 --- a/lib/messaging-api/model/audioMessage.ts +++ b/lib/messaging-api/model/audioMessage.ts @@ -10,22 +10,32 @@ * Do not edit the class manually. */ -import { Message } from "./message"; -import { QuickReply } from "./quickReply"; -import { Sender } from "./sender"; - -import { MessageBase } from "./models"; - -export type AudioMessage = MessageBase & { - type: "audio"; - /** - * - * @see originalContentUrl Documentation - */ - originalContentUrl: string /**/; - /** - * - * @see duration Documentation - */ - duration: number /**/; -}; + + + import { Message } from './message.js';import { QuickReply } from './quickReply.js';import { Sender } from './sender.js'; + + +import { MessageBase } from './models.js'; + + +export type AudioMessage = MessageBase & { +type: "audio", + /** + * + * @see originalContentUrl Documentation + */ + 'originalContentUrl': string/**/; + /** + * + * @see duration Documentation + */ + 'duration': number/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/botInfoResponse.ts b/lib/messaging-api/model/botInfoResponse.ts index 2bb148fbb..29cb54039 100644 --- a/lib/messaging-api/model/botInfoResponse.ts +++ b/lib/messaging-api/model/botInfoResponse.ts @@ -10,53 +10,83 @@ * Do not edit the class manually. */ -export type BotInfoResponse = { - /** - * Bot\'s user ID - * - * @see userId Documentation - */ - userId: string /**/; - /** - * Bot\'s basic ID - * - * @see basicId Documentation - */ - basicId: string /**/; - /** - * Bot\'s premium ID. Not included in the response if the premium ID isn\'t set. - * - * @see premiumId Documentation - */ - premiumId?: string /**/; - /** - * Bot\'s display name - * - * @see displayName Documentation - */ - displayName: string /**/; - /** - * Profile image URL. `https` image URL. Not included in the response if the bot doesn\'t have a profile image. - * - * @see pictureUrl Documentation - */ - pictureUrl?: string /**/; - /** - * Chat settings set in the LINE Official Account Manager. One of: `chat`: Chat is set to \"On\". `bot`: Chat is set to \"Off\". - * - * @see chatMode Documentation - */ - chatMode: BotInfoResponse.ChatModeEnum /**/; - /** - * Automatic read setting for messages. If the chat is set to \"Off\", auto is returned. If the chat is set to \"On\", manual is returned. `auto`: Auto read setting is enabled. `manual`: Auto read setting is disabled. - * - * @see markAsReadMode Documentation - */ - markAsReadMode: BotInfoResponse.MarkAsReadModeEnum /**/; -}; -export namespace BotInfoResponse { - export type ChatModeEnum = "chat" | "bot"; - export type MarkAsReadModeEnum = "auto" | "manual"; + + + +export type BotInfoResponse = { + /** + * Bot\'s user ID + * + * @see userId Documentation + */ + 'userId': string/**/; + /** + * Bot\'s basic ID + * + * @see basicId Documentation + */ + 'basicId': string/**/; + /** + * Bot\'s premium ID. Not included in the response if the premium ID isn\'t set. + * + * @see premiumId Documentation + */ + 'premiumId'?: string/**/; + /** + * Bot\'s display name + * + * @see displayName Documentation + */ + 'displayName': string/**/; + /** + * Profile image URL. `https` image URL. Not included in the response if the bot doesn\'t have a profile image. + * + * @see pictureUrl Documentation + */ + 'pictureUrl'?: string/**/; + /** + * Chat settings set in the LINE Official Account Manager. One of: `chat`: Chat is set to \"On\". `bot`: Chat is set to \"Off\". + * + * @see chatMode Documentation + */ + 'chatMode': BotInfoResponse.ChatModeEnum/**/; + /** + * Automatic read setting for messages. If the chat is set to \"Off\", auto is returned. If the chat is set to \"On\", manual is returned. `auto`: Auto read setting is enabled. `manual`: Auto read setting is disabled. + * + * @see markAsReadMode Documentation + */ + 'markAsReadMode': BotInfoResponse.MarkAsReadModeEnum/**/; + +} + + + +export namespace BotInfoResponse { + + + + + + export type ChatModeEnum = + 'chat' + | 'bot' + + + ; + + export type MarkAsReadModeEnum = + 'auto' + | 'manual' + + + ; + + } + + + + + diff --git a/lib/messaging-api/model/broadcastRequest.ts b/lib/messaging-api/model/broadcastRequest.ts index 698542eb3..6d1bbe422 100644 --- a/lib/messaging-api/model/broadcastRequest.ts +++ b/lib/messaging-api/model/broadcastRequest.ts @@ -10,19 +10,30 @@ * Do not edit the class manually. */ -import { Message } from "./message"; - -export type BroadcastRequest = { - /** - * List of Message objects. - * - * @see messages Documentation - */ - messages: Array /**/; - /** - * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. - * - * @see notificationDisabled Documentation - */ - notificationDisabled?: boolean /* = false*/; -}; + + + import { Message } from './message.js'; + + +export type BroadcastRequest = { + /** + * List of Message objects. + * + * @see messages Documentation + */ + 'messages': Array/**/; + /** + * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. + * + * @see notificationDisabled Documentation + */ + 'notificationDisabled'?: boolean/* = false*/; + +} + + + + + + + diff --git a/lib/messaging-api/model/buttonsTemplate.ts b/lib/messaging-api/model/buttonsTemplate.ts index d593923b4..c1159e4cb 100644 --- a/lib/messaging-api/model/buttonsTemplate.ts +++ b/lib/messaging-api/model/buttonsTemplate.ts @@ -10,35 +10,46 @@ * Do not edit the class manually. */ -import { Action } from "./action"; -import { Template } from "./template"; - -import { TemplateBase } from "./models"; - -export type ButtonsTemplate = TemplateBase & { - type: "buttons"; - /** - */ - thumbnailImageUrl?: string /**/; - /** - */ - imageAspectRatio?: string /**/; - /** - */ - imageSize?: string /**/; - /** - */ - imageBackgroundColor?: string /**/; - /** - */ - title?: string /**/; - /** - */ - text: string /**/; - /** - */ - defaultAction?: Action /**/; - /** - */ - actions: Array /**/; -}; + + + import { Action } from './action.js';import { Template } from './template.js'; + + +import { TemplateBase } from './models.js'; + + +export type ButtonsTemplate = TemplateBase & { +type: "buttons", + /** + */ + 'thumbnailImageUrl'?: string/**/; + /** + */ + 'imageAspectRatio'?: string/**/; + /** + */ + 'imageSize'?: string/**/; + /** + */ + 'imageBackgroundColor'?: string/**/; + /** + */ + 'title'?: string/**/; + /** + */ + 'text': string/**/; + /** + */ + 'defaultAction'?: Action/**/; + /** + */ + 'actions': Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/cameraAction.ts b/lib/messaging-api/model/cameraAction.ts index 66ea11744..44928462d 100644 --- a/lib/messaging-api/model/cameraAction.ts +++ b/lib/messaging-api/model/cameraAction.ts @@ -10,10 +10,22 @@ * Do not edit the class manually. */ -import { Action } from "./action"; -import { ActionBase } from "./models"; -export type CameraAction = ActionBase & { - type: "camera"; -}; + import { Action } from './action.js'; + + +import { ActionBase } from './models.js'; + + +export type CameraAction = ActionBase & { +type: "camera", + +} + + + + + + + diff --git a/lib/messaging-api/model/cameraRollAction.ts b/lib/messaging-api/model/cameraRollAction.ts index 34cd5e8f7..34c1fdba5 100644 --- a/lib/messaging-api/model/cameraRollAction.ts +++ b/lib/messaging-api/model/cameraRollAction.ts @@ -10,10 +10,22 @@ * Do not edit the class manually. */ -import { Action } from "./action"; -import { ActionBase } from "./models"; -export type CameraRollAction = ActionBase & { - type: "cameraRoll"; -}; + import { Action } from './action.js'; + + +import { ActionBase } from './models.js'; + + +export type CameraRollAction = ActionBase & { +type: "cameraRoll", + +} + + + + + + + diff --git a/lib/messaging-api/model/carouselColumn.ts b/lib/messaging-api/model/carouselColumn.ts index a667a3ae8..0e642f721 100644 --- a/lib/messaging-api/model/carouselColumn.ts +++ b/lib/messaging-api/model/carouselColumn.ts @@ -10,28 +10,39 @@ * Do not edit the class manually. */ -import { Action } from "./action"; + + import { Action } from './action.js'; + + /** * Column object for carousel template. */ -export type CarouselColumn = { - /** - */ - thumbnailImageUrl?: string /**/; - /** - */ - imageBackgroundColor?: string /**/; - /** - */ - title?: string /**/; - /** - */ - text: string /**/; - /** - */ - defaultAction?: Action /**/; - /** - */ - actions: Array /**/; -}; +export type CarouselColumn = { + /** + */ + 'thumbnailImageUrl'?: string/**/; + /** + */ + 'imageBackgroundColor'?: string/**/; + /** + */ + 'title'?: string/**/; + /** + */ + 'text': string/**/; + /** + */ + 'defaultAction'?: Action/**/; + /** + */ + 'actions': Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/carouselTemplate.ts b/lib/messaging-api/model/carouselTemplate.ts index 4d199bada..aa35adf86 100644 --- a/lib/messaging-api/model/carouselTemplate.ts +++ b/lib/messaging-api/model/carouselTemplate.ts @@ -10,20 +10,31 @@ * Do not edit the class manually. */ -import { CarouselColumn } from "./carouselColumn"; -import { Template } from "./template"; - -import { TemplateBase } from "./models"; - -export type CarouselTemplate = TemplateBase & { - type: "carousel"; - /** - */ - columns: Array /**/; - /** - */ - imageAspectRatio?: string /**/; - /** - */ - imageSize?: string /**/; -}; + + + import { CarouselColumn } from './carouselColumn.js';import { Template } from './template.js'; + + +import { TemplateBase } from './models.js'; + + +export type CarouselTemplate = TemplateBase & { +type: "carousel", + /** + */ + 'columns': Array/**/; + /** + */ + 'imageAspectRatio'?: string/**/; + /** + */ + 'imageSize'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/chatReference.ts b/lib/messaging-api/model/chatReference.ts index a86e8903a..b6bc07d60 100644 --- a/lib/messaging-api/model/chatReference.ts +++ b/lib/messaging-api/model/chatReference.ts @@ -10,14 +10,27 @@ * Do not edit the class manually. */ + + + + + /** * Chat reference */ -export type ChatReference = { - /** - * The target user ID - * - * @see userId Documentation - */ - userId: string /**/; -}; +export type ChatReference = { + /** + * The target user ID + * + * @see userId Documentation + */ + 'userId': string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/clipboardAction.ts b/lib/messaging-api/model/clipboardAction.ts index d5361cbf8..22eb8b607 100644 --- a/lib/messaging-api/model/clipboardAction.ts +++ b/lib/messaging-api/model/clipboardAction.ts @@ -10,16 +10,28 @@ * Do not edit the class manually. */ -import { Action } from "./action"; - -import { ActionBase } from "./models"; - -export type ClipboardAction = ActionBase & { - type: "clipboard"; - /** - * Text that is copied to the clipboard. Max character limit: 1000 - * - * @see clipboardText Documentation - */ - clipboardText: string /**/; -}; + + + import { Action } from './action.js'; + + +import { ActionBase } from './models.js'; + + +export type ClipboardAction = ActionBase & { +type: "clipboard", + /** + * Text that is copied to the clipboard. Max character limit: 1000 + * + * @see clipboardText Documentation + */ + 'clipboardText': string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/clipboardImagemapAction.ts b/lib/messaging-api/model/clipboardImagemapAction.ts index b3ce632ec..8f933c037 100644 --- a/lib/messaging-api/model/clipboardImagemapAction.ts +++ b/lib/messaging-api/model/clipboardImagemapAction.ts @@ -10,22 +10,33 @@ * Do not edit the class manually. */ -import { ImagemapAction } from "./imagemapAction"; -import { ImagemapArea } from "./imagemapArea"; - -import { ImagemapActionBase } from "./models"; - -export type ClipboardImagemapAction = ImagemapActionBase & { - type: "clipboard"; - /** - * Text that is copied to the clipboard. Max character limit: 1000 - * - * @see clipboardText Documentation - */ - clipboardText: string /**/; - /** - * - * @see label Documentation - */ - label?: string /**/; -}; + + + import { ImagemapAction } from './imagemapAction.js';import { ImagemapArea } from './imagemapArea.js'; + + +import { ImagemapActionBase } from './models.js'; + + +export type ClipboardImagemapAction = ImagemapActionBase & { +type: "clipboard", + /** + * Text that is copied to the clipboard. Max character limit: 1000 + * + * @see clipboardText Documentation + */ + 'clipboardText': string/**/; + /** + * + * @see label Documentation + */ + 'label'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/confirmTemplate.ts b/lib/messaging-api/model/confirmTemplate.ts index 94ef258a7..ee9b9a860 100644 --- a/lib/messaging-api/model/confirmTemplate.ts +++ b/lib/messaging-api/model/confirmTemplate.ts @@ -10,17 +10,28 @@ * Do not edit the class manually. */ -import { Action } from "./action"; -import { Template } from "./template"; - -import { TemplateBase } from "./models"; - -export type ConfirmTemplate = TemplateBase & { - type: "confirm"; - /** - */ - text: string /**/; - /** - */ - actions: Array /**/; -}; + + + import { Action } from './action.js';import { Template } from './template.js'; + + +import { TemplateBase } from './models.js'; + + +export type ConfirmTemplate = TemplateBase & { +type: "confirm", + /** + */ + 'text': string/**/; + /** + */ + 'actions': Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/createRichMenuAliasRequest.ts b/lib/messaging-api/model/createRichMenuAliasRequest.ts index 21f92f16b..230c7185b 100644 --- a/lib/messaging-api/model/createRichMenuAliasRequest.ts +++ b/lib/messaging-api/model/createRichMenuAliasRequest.ts @@ -10,17 +10,30 @@ * Do not edit the class manually. */ -export type CreateRichMenuAliasRequest = { - /** - * Rich menu alias ID, which can be any ID, unique for each channel. - * - * @see richMenuAliasId Documentation - */ - richMenuAliasId: string /**/; - /** - * The rich menu ID to be associated with the rich menu alias. - * - * @see richMenuId Documentation - */ - richMenuId: string /**/; -}; + + + + + +export type CreateRichMenuAliasRequest = { + /** + * Rich menu alias ID, which can be any ID, unique for each channel. + * + * @see richMenuAliasId Documentation + */ + 'richMenuAliasId': string/**/; + /** + * The rich menu ID to be associated with the rich menu alias. + * + * @see richMenuId Documentation + */ + 'richMenuId': string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/datetimePickerAction.ts b/lib/messaging-api/model/datetimePickerAction.ts index 92130914a..e4ce4d83b 100644 --- a/lib/messaging-api/model/datetimePickerAction.ts +++ b/lib/messaging-api/model/datetimePickerAction.ts @@ -10,39 +10,63 @@ * Do not edit the class manually. */ -import { Action } from "./action"; - -import { ActionBase } from "./models"; - -export type DatetimePickerAction = ActionBase & { - type: "datetimepicker"; - /** - * - * @see data Documentation - */ - data?: string /**/; - /** - * - * @see mode Documentation - */ - mode?: DatetimePickerAction.ModeEnum /**/; - /** - * - * @see initial Documentation - */ - initial?: string /**/; - /** - * - * @see max Documentation - */ - max?: string /**/; - /** - * - * @see min Documentation - */ - min?: string /**/; -}; + + import { Action } from './action.js'; + + +import { ActionBase } from './models.js'; + + +export type DatetimePickerAction = ActionBase & { +type: "datetimepicker", + /** + * + * @see data Documentation + */ + 'data'?: string/**/; + /** + * + * @see mode Documentation + */ + 'mode'?: DatetimePickerAction.ModeEnum/**/; + /** + * + * @see initial Documentation + */ + 'initial'?: string/**/; + /** + * + * @see max Documentation + */ + 'max'?: string/**/; + /** + * + * @see min Documentation + */ + 'min'?: string/**/; + +} + + + export namespace DatetimePickerAction { - export type ModeEnum = "date" | "time" | "datetime"; + + export type ModeEnum = + 'date' + | 'time' + | 'datetime' + + + ; + + + + + } + + + + + diff --git a/lib/messaging-api/model/demographicFilter.ts b/lib/messaging-api/model/demographicFilter.ts index 63502a869..f76886ce7 100644 --- a/lib/messaging-api/model/demographicFilter.ts +++ b/lib/messaging-api/model/demographicFilter.ts @@ -10,32 +10,47 @@ * Do not edit the class manually. */ -import { AgeDemographicFilter } from "./models"; -import { AppTypeDemographicFilter } from "./models"; -import { AreaDemographicFilter } from "./models"; -import { GenderDemographicFilter } from "./models"; -import { OperatorDemographicFilter } from "./models"; -import { SubscriptionPeriodDemographicFilter } from "./models"; + + + + + + import { AgeDemographicFilter } from './models.js'; + import { AppTypeDemographicFilter } from './models.js'; + import { AreaDemographicFilter } from './models.js'; + import { GenderDemographicFilter } from './models.js'; + import { OperatorDemographicFilter } from './models.js'; + import { SubscriptionPeriodDemographicFilter } from './models.js'; + export type DemographicFilter = - | AgeDemographicFilter // age - | AppTypeDemographicFilter // appType - | AreaDemographicFilter // area - | GenderDemographicFilter // gender - | OperatorDemographicFilter // operator - | SubscriptionPeriodDemographicFilter // subscriptionPeriod - | UnknownDemographicFilter; + | AgeDemographicFilter // age + | AppTypeDemographicFilter // appType + | AreaDemographicFilter // area + | GenderDemographicFilter // gender + | OperatorDemographicFilter // operator + | SubscriptionPeriodDemographicFilter // subscriptionPeriod + | UnknownDemographicFilter +; export type UnknownDemographicFilter = DemographicFilterBase & { - [key: string]: unknown; + [key: string]: unknown; }; - + /** * Demographic filter */ -export type DemographicFilterBase = { - /** - * Type of demographic filter - */ - type?: string /**/; -}; +export type DemographicFilterBase = { + /** + * Type of demographic filter + */ + 'type'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/emoji.ts b/lib/messaging-api/model/emoji.ts index 7bd8dfaed..a66e2aa48 100644 --- a/lib/messaging-api/model/emoji.ts +++ b/lib/messaging-api/model/emoji.ts @@ -10,14 +10,27 @@ * Do not edit the class manually. */ -export type Emoji = { - /** - */ - index?: number /**/; - /** - */ - productId?: string /**/; - /** - */ - emojiId?: string /**/; -}; + + + + + +export type Emoji = { + /** + */ + 'index'?: number/**/; + /** + */ + 'productId'?: string/**/; + /** + */ + 'emojiId'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/errorDetail.ts b/lib/messaging-api/model/errorDetail.ts index 8def5ece3..107413406 100644 --- a/lib/messaging-api/model/errorDetail.ts +++ b/lib/messaging-api/model/errorDetail.ts @@ -10,13 +10,26 @@ * Do not edit the class manually. */ -export type ErrorDetail = { - /** - * Details of the error. Not included in the response under certain situations. - */ - message?: string /**/; - /** - * Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations. - */ - property?: string /**/; -}; + + + + + +export type ErrorDetail = { + /** + * Details of the error. Not included in the response under certain situations. + */ + 'message'?: string/**/; + /** + * Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations. + */ + 'property'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/errorResponse.ts b/lib/messaging-api/model/errorResponse.ts index 897443ce9..20071488c 100644 --- a/lib/messaging-api/model/errorResponse.ts +++ b/lib/messaging-api/model/errorResponse.ts @@ -10,26 +10,36 @@ * Do not edit the class manually. */ -import { ErrorDetail } from "./errorDetail"; -import { SentMessage } from "./sentMessage"; - -export type ErrorResponse = { - /** - * Message containing information about the error. - * - * @see message Documentation - */ - message: string /**/; - /** - * An array of error details. If the array is empty, this property will not be included in the response. - * - * @see details Documentation - */ - details?: Array /**/; - /** - * Array of sent messages. - * - * @see sentMessages Documentation - */ - sentMessages?: Array /**/; -}; + + + import { ErrorDetail } from './errorDetail.js';import { SentMessage } from './sentMessage.js'; + + +export type ErrorResponse = { + /** + * Message containing information about the error. + * + * @see message Documentation + */ + 'message': string/**/; + /** + * An array of error details. If the array is empty, this property will not be included in the response. + * + * @see details Documentation + */ + 'details'?: Array/**/; + /** + * Array of sent messages. + * + * @see sentMessages Documentation + */ + 'sentMessages'?: Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/filter.ts b/lib/messaging-api/model/filter.ts index cc7376520..eaa04602c 100644 --- a/lib/messaging-api/model/filter.ts +++ b/lib/messaging-api/model/filter.ts @@ -10,13 +10,24 @@ * Do not edit the class manually. */ -import { DemographicFilter } from "./demographicFilter"; + + import { DemographicFilter } from './demographicFilter.js'; + + /** * Filter for narrowcast */ -export type Filter = { - /** - */ - demographic?: DemographicFilter /**/; -}; +export type Filter = { + /** + */ + 'demographic'?: DemographicFilter/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/flexBlockStyle.ts b/lib/messaging-api/model/flexBlockStyle.ts index 14f581065..f3bafd3ab 100644 --- a/lib/messaging-api/model/flexBlockStyle.ts +++ b/lib/messaging-api/model/flexBlockStyle.ts @@ -10,14 +10,27 @@ * Do not edit the class manually. */ -export type FlexBlockStyle = { - /** - */ - backgroundColor?: string /**/; - /** - */ - separator?: boolean /**/; - /** - */ - separatorColor?: string /**/; -}; + + + + + +export type FlexBlockStyle = { + /** + */ + 'backgroundColor'?: string/**/; + /** + */ + 'separator'?: boolean/**/; + /** + */ + 'separatorColor'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/flexBox.ts b/lib/messaging-api/model/flexBox.ts index f5fefa259..a81358a6d 100644 --- a/lib/messaging-api/model/flexBox.ts +++ b/lib/messaging-api/model/flexBox.ts @@ -10,109 +10,164 @@ * Do not edit the class manually. */ -import { Action } from "./action"; -import { FlexBoxBackground } from "./flexBoxBackground"; -import { FlexComponent } from "./flexComponent"; -import { FlexComponentBase } from "./models"; -export type FlexBox = FlexComponentBase & { - type: "box"; - /** - */ - layout: FlexBox.LayoutEnum /**/; - /** - */ - flex?: number /**/; - /** - */ - contents: Array /**/; - /** - */ - spacing?: string /**/; - /** - */ - margin?: string /**/; - /** - */ - position?: FlexBox.PositionEnum /**/; - /** - */ - offsetTop?: string /**/; - /** - */ - offsetBottom?: string /**/; - /** - */ - offsetStart?: string /**/; - /** - */ - offsetEnd?: string /**/; - /** - */ - backgroundColor?: string /**/; - /** - */ - borderColor?: string /**/; - /** - */ - borderWidth?: string /**/; - /** - */ - cornerRadius?: string /**/; - /** - */ - width?: string /**/; - /** - */ - maxWidth?: string /**/; - /** - */ - height?: string /**/; - /** - */ - maxHeight?: string /**/; - /** - */ - paddingAll?: string /**/; - /** - */ - paddingTop?: string /**/; - /** - */ - paddingBottom?: string /**/; - /** - */ - paddingStart?: string /**/; - /** - */ - paddingEnd?: string /**/; - /** - */ - action?: Action /**/; - /** - */ - justifyContent?: FlexBox.JustifyContentEnum /**/; - /** - */ - alignItems?: FlexBox.AlignItemsEnum /**/; - /** - */ - background?: FlexBoxBackground /**/; -}; + import { Action } from './action.js';import { FlexBoxBackground } from './flexBoxBackground.js';import { FlexComponent } from './flexComponent.js'; + +import { FlexComponentBase } from './models.js'; + + +export type FlexBox = FlexComponentBase & { +type: "box", + /** + */ + 'layout': FlexBox.LayoutEnum/**/; + /** + */ + 'flex'?: number/**/; + /** + */ + 'contents': Array/**/; + /** + */ + 'spacing'?: string/**/; + /** + */ + 'margin'?: string/**/; + /** + */ + 'position'?: FlexBox.PositionEnum/**/; + /** + */ + 'offsetTop'?: string/**/; + /** + */ + 'offsetBottom'?: string/**/; + /** + */ + 'offsetStart'?: string/**/; + /** + */ + 'offsetEnd'?: string/**/; + /** + */ + 'backgroundColor'?: string/**/; + /** + */ + 'borderColor'?: string/**/; + /** + */ + 'borderWidth'?: string/**/; + /** + */ + 'cornerRadius'?: string/**/; + /** + */ + 'width'?: string/**/; + /** + */ + 'maxWidth'?: string/**/; + /** + */ + 'height'?: string/**/; + /** + */ + 'maxHeight'?: string/**/; + /** + */ + 'paddingAll'?: string/**/; + /** + */ + 'paddingTop'?: string/**/; + /** + */ + 'paddingBottom'?: string/**/; + /** + */ + 'paddingStart'?: string/**/; + /** + */ + 'paddingEnd'?: string/**/; + /** + */ + 'action'?: Action/**/; + /** + */ + 'justifyContent'?: FlexBox.JustifyContentEnum/**/; + /** + */ + 'alignItems'?: FlexBox.AlignItemsEnum/**/; + /** + */ + 'background'?: FlexBoxBackground/**/; + +} + + + export namespace FlexBox { - export type LayoutEnum = "horizontal" | "vertical" | "baseline"; + export type LayoutEnum = + 'horizontal' + | 'vertical' + | 'baseline' + + + ; + + + + + + export type PositionEnum = + 'relative' + | 'absolute' + + + ; + + + + + + + + + + + + + + + + + + + + export type JustifyContentEnum = + 'center' + | 'flex-start' + | 'flex-end' + | 'space-between' + | 'space-around' + | 'space-evenly' + + + ; + + export type AlignItemsEnum = + 'center' + | 'flex-start' + | 'flex-end' + + + ; + + + +} + - export type PositionEnum = "relative" | "absolute"; + - export type JustifyContentEnum = - | "center" - | "flex-start" - | "flex-end" - | "space-between" - | "space-around" - | "space-evenly"; - export type AlignItemsEnum = "center" | "flex-start" | "flex-end"; -} diff --git a/lib/messaging-api/model/flexBoxBackground.ts b/lib/messaging-api/model/flexBoxBackground.ts index d3a9ae4be..6191d4b8e 100644 --- a/lib/messaging-api/model/flexBoxBackground.ts +++ b/lib/messaging-api/model/flexBoxBackground.ts @@ -10,18 +10,33 @@ * Do not edit the class manually. */ -import { FlexBoxLinearGradient } from "./models"; + + + + + + import { FlexBoxLinearGradient } from './models.js'; + export type FlexBoxBackground = - | FlexBoxLinearGradient // linearGradient - | UnknownFlexBoxBackground; + | FlexBoxLinearGradient // linearGradient + | UnknownFlexBoxBackground +; export type UnknownFlexBoxBackground = FlexBoxBackgroundBase & { - [key: string]: unknown; + [key: string]: unknown; }; + +export type FlexBoxBackgroundBase = { + /** + */ + 'type': string/**/; + +} + + + + + + -export type FlexBoxBackgroundBase = { - /** - */ - type: string /**/; -}; diff --git a/lib/messaging-api/model/flexBoxBorderWidth.ts b/lib/messaging-api/model/flexBoxBorderWidth.ts index 97f4e060b..1e2bab891 100644 --- a/lib/messaging-api/model/flexBoxBorderWidth.ts +++ b/lib/messaging-api/model/flexBoxBorderWidth.ts @@ -10,14 +10,26 @@ * Do not edit the class manually. */ + + + + + /** - * Width of box border. This is only for `borderWidth` in FlexBox. A value of none means that borders are not rendered; the other values are listed in order of increasing width. + * Width of box border. This is only for `borderWidth` in FlexBox. A value of none means that borders are not rendered; the other values are listed in order of increasing width. */ -export type FlexBoxBorderWidth = - | "none" - | "light" - | "normal" - | "medium" - | "semi-bold" - | "bold"; + + + export type FlexBoxBorderWidth = + 'none' + | 'light' + | 'normal' + | 'medium' + | 'semi-bold' + | 'bold' + +; + + + diff --git a/lib/messaging-api/model/flexBoxCornerRadius.ts b/lib/messaging-api/model/flexBoxCornerRadius.ts index 3c54206a9..41a8d3663 100644 --- a/lib/messaging-api/model/flexBoxCornerRadius.ts +++ b/lib/messaging-api/model/flexBoxCornerRadius.ts @@ -10,15 +10,27 @@ * Do not edit the class manually. */ + + + + + /** - * Radius at the time of rounding the corners of the box. This is only for `cornerRadius` in FlexBox. A value of none means that corners are not rounded; the other values are listed in order of increasing radius. + * Radius at the time of rounding the corners of the box. This is only for `cornerRadius` in FlexBox. A value of none means that corners are not rounded; the other values are listed in order of increasing radius. */ -export type FlexBoxCornerRadius = - | "none" - | "xs" - | "sm" - | "md" - | "lg" - | "xl" - | "xxl"; + + + export type FlexBoxCornerRadius = + 'none' + | 'xs' + | 'sm' + | 'md' + | 'lg' + | 'xl' + | 'xxl' + +; + + + diff --git a/lib/messaging-api/model/flexBoxLinearGradient.ts b/lib/messaging-api/model/flexBoxLinearGradient.ts index 57f15af24..a2b300c4d 100644 --- a/lib/messaging-api/model/flexBoxLinearGradient.ts +++ b/lib/messaging-api/model/flexBoxLinearGradient.ts @@ -10,25 +10,37 @@ * Do not edit the class manually. */ -import { FlexBoxBackground } from "./flexBoxBackground"; - -import { FlexBoxBackgroundBase } from "./models"; - -export type FlexBoxLinearGradient = FlexBoxBackgroundBase & { - type: "linearGradient"; - /** - */ - angle?: string /**/; - /** - */ - startColor?: string /**/; - /** - */ - endColor?: string /**/; - /** - */ - centerColor?: string /**/; - /** - */ - centerPosition?: string /**/; -}; + + + import { FlexBoxBackground } from './flexBoxBackground.js'; + + +import { FlexBoxBackgroundBase } from './models.js'; + + +export type FlexBoxLinearGradient = FlexBoxBackgroundBase & { +type: "linearGradient", + /** + */ + 'angle'?: string/**/; + /** + */ + 'startColor'?: string/**/; + /** + */ + 'endColor'?: string/**/; + /** + */ + 'centerColor'?: string/**/; + /** + */ + 'centerPosition'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/flexBoxPadding.ts b/lib/messaging-api/model/flexBoxPadding.ts index eb6865b1c..30c45ef6c 100644 --- a/lib/messaging-api/model/flexBoxPadding.ts +++ b/lib/messaging-api/model/flexBoxPadding.ts @@ -10,8 +10,27 @@ * Do not edit the class manually. */ + + + + + /** - * Padding can be specified in pixels, percentage (to the parent box width) or with a keyword. FlexBoxPadding just provides only keywords. + * Padding can be specified in pixels, percentage (to the parent box width) or with a keyword. FlexBoxPadding just provides only keywords. */ -export type FlexBoxPadding = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl"; + + + export type FlexBoxPadding = + 'none' + | 'xs' + | 'sm' + | 'md' + | 'lg' + | 'xl' + | 'xxl' + +; + + + diff --git a/lib/messaging-api/model/flexBoxSpacing.ts b/lib/messaging-api/model/flexBoxSpacing.ts index 24c6263bc..92a519ac7 100644 --- a/lib/messaging-api/model/flexBoxSpacing.ts +++ b/lib/messaging-api/model/flexBoxSpacing.ts @@ -10,8 +10,27 @@ * Do not edit the class manually. */ + + + + + /** - * You can specify the minimum space between two components with the `spacing` property of the parent box component, in pixels or with a keyword. FlexBoxSpacing just provides only keywords. + * You can specify the minimum space between two components with the `spacing` property of the parent box component, in pixels or with a keyword. FlexBoxSpacing just provides only keywords. */ -export type FlexBoxSpacing = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl"; + + + export type FlexBoxSpacing = + 'none' + | 'xs' + | 'sm' + | 'md' + | 'lg' + | 'xl' + | 'xxl' + +; + + + diff --git a/lib/messaging-api/model/flexBubble.ts b/lib/messaging-api/model/flexBubble.ts index 191dc1fb9..74849e426 100644 --- a/lib/messaging-api/model/flexBubble.ts +++ b/lib/messaging-api/model/flexBubble.ts @@ -10,51 +10,75 @@ * Do not edit the class manually. */ -import { Action } from "./action"; -import { FlexBox } from "./flexBox"; -import { FlexBubbleStyles } from "./flexBubbleStyles"; -import { FlexComponent } from "./flexComponent"; -import { FlexContainer } from "./flexContainer"; - -import { FlexContainerBase } from "./models"; - -export type FlexBubble = FlexContainerBase & { - type: "bubble"; - /** - */ - direction?: FlexBubble.DirectionEnum /**/; - /** - */ - styles?: FlexBubbleStyles /**/; - /** - */ - header?: FlexBox /**/; - /** - */ - hero?: FlexComponent /**/; - /** - */ - body?: FlexBox /**/; - /** - */ - footer?: FlexBox /**/; - /** - */ - size?: FlexBubble.SizeEnum /**/; - /** - */ - action?: Action /**/; -}; + + import { Action } from './action.js';import { FlexBox } from './flexBox.js';import { FlexBubbleStyles } from './flexBubbleStyles.js';import { FlexComponent } from './flexComponent.js';import { FlexContainer } from './flexContainer.js'; + + +import { FlexContainerBase } from './models.js'; + + +export type FlexBubble = FlexContainerBase & { +type: "bubble", + /** + */ + 'direction'?: FlexBubble.DirectionEnum/**/; + /** + */ + 'styles'?: FlexBubbleStyles/**/; + /** + */ + 'header'?: FlexBox/**/; + /** + */ + 'hero'?: FlexComponent/**/; + /** + */ + 'body'?: FlexBox/**/; + /** + */ + 'footer'?: FlexBox/**/; + /** + */ + 'size'?: FlexBubble.SizeEnum/**/; + /** + */ + 'action'?: Action/**/; + +} + + + export namespace FlexBubble { - export type DirectionEnum = "ltr" | "rtl"; - - export type SizeEnum = - | "nano" - | "micro" - | "deca" - | "hecto" - | "kilo" - | "mega" - | "giga"; + export type DirectionEnum = + 'ltr' + | 'rtl' + + + ; + + + + + + + export type SizeEnum = + 'nano' + | 'micro' + | 'deca' + | 'hecto' + | 'kilo' + | 'mega' + | 'giga' + + + ; + + + } + + + + + diff --git a/lib/messaging-api/model/flexBubbleStyles.ts b/lib/messaging-api/model/flexBubbleStyles.ts index b09c5d4e9..e58b5c9c1 100644 --- a/lib/messaging-api/model/flexBubbleStyles.ts +++ b/lib/messaging-api/model/flexBubbleStyles.ts @@ -10,19 +10,30 @@ * Do not edit the class manually. */ -import { FlexBlockStyle } from "./flexBlockStyle"; - -export type FlexBubbleStyles = { - /** - */ - header?: FlexBlockStyle /**/; - /** - */ - hero?: FlexBlockStyle /**/; - /** - */ - body?: FlexBlockStyle /**/; - /** - */ - footer?: FlexBlockStyle /**/; -}; + + + import { FlexBlockStyle } from './flexBlockStyle.js'; + + +export type FlexBubbleStyles = { + /** + */ + 'header'?: FlexBlockStyle/**/; + /** + */ + 'hero'?: FlexBlockStyle/**/; + /** + */ + 'body'?: FlexBlockStyle/**/; + /** + */ + 'footer'?: FlexBlockStyle/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/flexButton.ts b/lib/messaging-api/model/flexButton.ts index c87ec37e6..915064cd9 100644 --- a/lib/messaging-api/model/flexButton.ts +++ b/lib/messaging-api/model/flexButton.ts @@ -10,65 +10,113 @@ * Do not edit the class manually. */ -import { Action } from "./action"; -import { FlexComponent } from "./flexComponent"; -import { FlexComponentBase } from "./models"; -export type FlexButton = FlexComponentBase & { - type: "button"; - /** - */ - flex?: number /**/; - /** - */ - color?: string /**/; - /** - */ - style?: FlexButton.StyleEnum /**/; - /** - */ - action: Action /**/; - /** - */ - gravity?: FlexButton.GravityEnum /**/; - /** - */ - margin?: string /**/; - /** - */ - position?: FlexButton.PositionEnum /**/; - /** - */ - offsetTop?: string /**/; - /** - */ - offsetBottom?: string /**/; - /** - */ - offsetStart?: string /**/; - /** - */ - offsetEnd?: string /**/; - /** - */ - height?: FlexButton.HeightEnum /**/; - /** - */ - adjustMode?: FlexButton.AdjustModeEnum /**/; - /** - */ - scaling?: boolean /**/; -}; + import { Action } from './action.js';import { FlexComponent } from './flexComponent.js'; -export namespace FlexButton { - export type StyleEnum = "primary" | "secondary" | "link"; + +import { FlexComponentBase } from './models.js'; + + +export type FlexButton = FlexComponentBase & { +type: "button", + /** + */ + 'flex'?: number/**/; + /** + */ + 'color'?: string/**/; + /** + */ + 'style'?: FlexButton.StyleEnum/**/; + /** + */ + 'action': Action/**/; + /** + */ + 'gravity'?: FlexButton.GravityEnum/**/; + /** + */ + 'margin'?: string/**/; + /** + */ + 'position'?: FlexButton.PositionEnum/**/; + /** + */ + 'offsetTop'?: string/**/; + /** + */ + 'offsetBottom'?: string/**/; + /** + */ + 'offsetStart'?: string/**/; + /** + */ + 'offsetEnd'?: string/**/; + /** + */ + 'height'?: FlexButton.HeightEnum/**/; + /** + */ + 'adjustMode'?: FlexButton.AdjustModeEnum/**/; + /** + */ + 'scaling'?: boolean/**/; + +} + - export type GravityEnum = "top" | "bottom" | "center"; + +export namespace FlexButton { + + + export type StyleEnum = + 'primary' + | 'secondary' + | 'link' + + + ; + + + export type GravityEnum = + 'top' + | 'bottom' + | 'center' + + + ; + + + export type PositionEnum = + 'relative' + | 'absolute' + + + ; + + + + + + export type HeightEnum = + 'md' + | 'sm' + + + ; + + export type AdjustModeEnum = + 'shrink-to-fit' + + + ; + + + +} + - export type PositionEnum = "relative" | "absolute"; + - export type HeightEnum = "md" | "sm"; - export type AdjustModeEnum = "shrink-to-fit"; -} diff --git a/lib/messaging-api/model/flexCarousel.ts b/lib/messaging-api/model/flexCarousel.ts index 250c31235..6889596de 100644 --- a/lib/messaging-api/model/flexCarousel.ts +++ b/lib/messaging-api/model/flexCarousel.ts @@ -10,14 +10,25 @@ * Do not edit the class manually. */ -import { FlexBubble } from "./flexBubble"; -import { FlexContainer } from "./flexContainer"; -import { FlexContainerBase } from "./models"; -export type FlexCarousel = FlexContainerBase & { - type: "carousel"; - /** - */ - contents: Array /**/; -}; + import { FlexBubble } from './flexBubble.js';import { FlexContainer } from './flexContainer.js'; + + +import { FlexContainerBase } from './models.js'; + + +export type FlexCarousel = FlexContainerBase & { +type: "carousel", + /** + */ + 'contents': Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/flexComponent.ts b/lib/messaging-api/model/flexComponent.ts index e24a841e8..1f7003593 100644 --- a/lib/messaging-api/model/flexComponent.ts +++ b/lib/messaging-api/model/flexComponent.ts @@ -10,34 +10,49 @@ * Do not edit the class manually. */ -import { FlexBox } from "./models"; -import { FlexButton } from "./models"; -import { FlexFiller } from "./models"; -import { FlexIcon } from "./models"; -import { FlexImage } from "./models"; -import { FlexSeparator } from "./models"; -import { FlexSpan } from "./models"; -import { FlexText } from "./models"; -import { FlexVideo } from "./models"; + + + + + + import { FlexBox } from './models.js'; + import { FlexButton } from './models.js'; + import { FlexFiller } from './models.js'; + import { FlexIcon } from './models.js'; + import { FlexImage } from './models.js'; + import { FlexSeparator } from './models.js'; + import { FlexSpan } from './models.js'; + import { FlexText } from './models.js'; + import { FlexVideo } from './models.js'; + export type FlexComponent = - | FlexBox // box - | FlexButton // button - | FlexFiller // filler - | FlexIcon // icon - | FlexImage // image - | FlexSeparator // separator - | FlexSpan // span - | FlexText // text - | FlexVideo // video - | UnknownFlexComponent; + | FlexBox // box + | FlexButton // button + | FlexFiller // filler + | FlexIcon // icon + | FlexImage // image + | FlexSeparator // separator + | FlexSpan // span + | FlexText // text + | FlexVideo // video + | UnknownFlexComponent +; export type UnknownFlexComponent = FlexComponentBase & { - [key: string]: unknown; + [key: string]: unknown; }; + +export type FlexComponentBase = { + /** + */ + 'type': string/**/; + +} + + + + + + -export type FlexComponentBase = { - /** - */ - type: string /**/; -}; diff --git a/lib/messaging-api/model/flexContainer.ts b/lib/messaging-api/model/flexContainer.ts index 59d276208..becb9a047 100644 --- a/lib/messaging-api/model/flexContainer.ts +++ b/lib/messaging-api/model/flexContainer.ts @@ -10,20 +10,35 @@ * Do not edit the class manually. */ -import { FlexBubble } from "./models"; -import { FlexCarousel } from "./models"; + + + + + + import { FlexBubble } from './models.js'; + import { FlexCarousel } from './models.js'; + export type FlexContainer = - | FlexBubble // bubble - | FlexCarousel // carousel - | UnknownFlexContainer; + | FlexBubble // bubble + | FlexCarousel // carousel + | UnknownFlexContainer +; export type UnknownFlexContainer = FlexContainerBase & { - [key: string]: unknown; + [key: string]: unknown; }; + +export type FlexContainerBase = { + /** + */ + 'type': string/**/; + +} + + + + + + -export type FlexContainerBase = { - /** - */ - type: string /**/; -}; diff --git a/lib/messaging-api/model/flexFiller.ts b/lib/messaging-api/model/flexFiller.ts index f043221da..c66a46d91 100644 --- a/lib/messaging-api/model/flexFiller.ts +++ b/lib/messaging-api/model/flexFiller.ts @@ -10,13 +10,25 @@ * Do not edit the class manually. */ -import { FlexComponent } from "./flexComponent"; -import { FlexComponentBase } from "./models"; -export type FlexFiller = FlexComponentBase & { - type: "filler"; - /** - */ - flex?: number /**/; -}; + import { FlexComponent } from './flexComponent.js'; + + +import { FlexComponentBase } from './models.js'; + + +export type FlexFiller = FlexComponentBase & { +type: "filler", + /** + */ + 'flex'?: number/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/flexIcon.ts b/lib/messaging-api/model/flexIcon.ts index 90f988cce..777262805 100644 --- a/lib/messaging-api/model/flexIcon.ts +++ b/lib/messaging-api/model/flexIcon.ts @@ -10,64 +10,92 @@ * Do not edit the class manually. */ -import { FlexComponent } from "./flexComponent"; -import { FlexComponentBase } from "./models"; -export type FlexIcon = FlexComponentBase & { - type: "icon"; - /** - * - * @see url Documentation - */ - url: string /**/; - /** - * - * @see size Documentation - */ - size?: string /**/; - /** - * - * @see aspectRatio Documentation - */ - aspectRatio?: string /**/; - /** - * - * @see margin Documentation - */ - margin?: string /**/; - /** - * - * @see position Documentation - */ - position?: FlexIcon.PositionEnum /**/; - /** - * - * @see offsetTop Documentation - */ - offsetTop?: string /**/; - /** - * - * @see offsetBottom Documentation - */ - offsetBottom?: string /**/; - /** - * - * @see offsetStart Documentation - */ - offsetStart?: string /**/; - /** - * - * @see offsetEnd Documentation - */ - offsetEnd?: string /**/; - /** - * - * @see scaling Documentation - */ - scaling?: boolean /**/; -}; + import { FlexComponent } from './flexComponent.js'; + +import { FlexComponentBase } from './models.js'; + + +export type FlexIcon = FlexComponentBase & { +type: "icon", + /** + * + * @see url Documentation + */ + 'url': string/**/; + /** + * + * @see size Documentation + */ + 'size'?: string/**/; + /** + * + * @see aspectRatio Documentation + */ + 'aspectRatio'?: string/**/; + /** + * + * @see margin Documentation + */ + 'margin'?: string/**/; + /** + * + * @see position Documentation + */ + 'position'?: FlexIcon.PositionEnum/**/; + /** + * + * @see offsetTop Documentation + */ + 'offsetTop'?: string/**/; + /** + * + * @see offsetBottom Documentation + */ + 'offsetBottom'?: string/**/; + /** + * + * @see offsetStart Documentation + */ + 'offsetStart'?: string/**/; + /** + * + * @see offsetEnd Documentation + */ + 'offsetEnd'?: string/**/; + /** + * + * @see scaling Documentation + */ + 'scaling'?: boolean/**/; + +} + + + export namespace FlexIcon { - export type PositionEnum = "relative" | "absolute"; + + + + + export type PositionEnum = + 'relative' + | 'absolute' + + + ; + + + + + + + } + + + + + diff --git a/lib/messaging-api/model/flexIconSize.ts b/lib/messaging-api/model/flexIconSize.ts index 5c6310e04..af0daeafb 100644 --- a/lib/messaging-api/model/flexIconSize.ts +++ b/lib/messaging-api/model/flexIconSize.ts @@ -10,18 +10,30 @@ * Do not edit the class manually. */ + + + + + /** - * You can set the width of an Flex icon component with the `size` property, in pixels, as a percentage, or with a keyword. FlexIconSize just provides only keywords. + * You can set the width of an Flex icon component with the `size` property, in pixels, as a percentage, or with a keyword. FlexIconSize just provides only keywords. */ -export type FlexIconSize = - | "xxs" - | "xs" - | "sm" - | "md" - | "lg" - | "xl" - | "xxl" - | "3xl" - | "4xl" - | "5xl"; + + + export type FlexIconSize = + 'xxs' + | 'xs' + | 'sm' + | 'md' + | 'lg' + | 'xl' + | 'xxl' + | '3xl' + | '4xl' + | '5xl' + +; + + + diff --git a/lib/messaging-api/model/flexImage.ts b/lib/messaging-api/model/flexImage.ts index b72187390..e33879f26 100644 --- a/lib/messaging-api/model/flexImage.ts +++ b/lib/messaging-api/model/flexImage.ts @@ -10,116 +10,163 @@ * Do not edit the class manually. */ -import { Action } from "./action"; -import { FlexComponent } from "./flexComponent"; -import { FlexComponentBase } from "./models"; -export type FlexImage = FlexComponentBase & { - type: "image"; - /** - * Image URL (Max character limit: 2000) Protocol: HTTPS (TLS 1.2 or later) Image format: JPEG or PNG Maximum image size: 1024×1024 pixels Maximum file size: 10 MB (300 KB when the animated property is true) - * - * @see url Documentation - */ - url: string /**/; - /** - * The ratio of the width or height of this component within the parent box. - * - * @see flex Documentation - */ - flex?: number /**/; - /** - * The minimum amount of space to include before this component in its parent container. - * - * @see margin Documentation - */ - margin?: string /**/; - /** - * Reference for offsetTop, offsetBottom, offsetStart, and offsetEnd. Specify one of the following values: `relative`: Use the previous box as reference. `absolute`: Use the top left of parent element as reference. The default value is relative. - * - * @see position Documentation - */ - position?: FlexImage.PositionEnum /**/; - /** - * Offset. - * - * @see offsetTop Documentation - */ - offsetTop?: string /**/; - /** - * Offset. - * - * @see offsetBottom Documentation - */ - offsetBottom?: string /**/; - /** - * Offset. - * - * @see offsetStart Documentation - */ - offsetStart?: string /**/; - /** - * Offset. - * - * @see offsetEnd Documentation - */ - offsetEnd?: string /**/; - /** - * Alignment style in horizontal direction. - * - * @see align Documentation - */ - align?: FlexImage.AlignEnum /**/; - /** - * Alignment style in vertical direction. - * - * @see gravity Documentation - */ - gravity?: FlexImage.GravityEnum /**/; - /** - * The maximum image width. This is md by default. - * - * @see size Documentation - */ - size?: string /* = 'md'*/; - /** - * Aspect ratio of the image. `{width}:{height}` format. Specify the value of `{width}` and `{height}` in the range from `1` to `100000`. However, you cannot set `{height}` to a value that is more than three times the value of `{width}`. The default value is `1:1`. - * - * @see aspectRatio Documentation - */ - aspectRatio?: string /**/; - /** - * The display style of the image if the aspect ratio of the image and that specified by the aspectRatio property do not match. - * - * @see aspectMode Documentation - */ - aspectMode?: FlexImage.AspectModeEnum /**/; - /** - * Background color of the image. Use a hexadecimal color code. - * - * @see backgroundColor Documentation - */ - backgroundColor?: string /**/; - /** - * - * @see action Documentation - */ - action?: Action /**/; - /** - * When this is `true`, an animated image (APNG) plays. You can specify a value of true up to 10 images in a single message. You can\'t send messages that exceed this limit. This is `false` by default. Animated images larger than 300 KB aren\'t played back. - * - * @see animated Documentation - */ - animated?: boolean /* = false*/; -}; + import { Action } from './action.js';import { FlexComponent } from './flexComponent.js'; + +import { FlexComponentBase } from './models.js'; + + +export type FlexImage = FlexComponentBase & { +type: "image", + /** + * Image URL (Max character limit: 2000) Protocol: HTTPS (TLS 1.2 or later) Image format: JPEG or PNG Maximum image size: 1024×1024 pixels Maximum file size: 10 MB (300 KB when the animated property is true) + * + * @see url Documentation + */ + 'url': string/**/; + /** + * The ratio of the width or height of this component within the parent box. + * + * @see flex Documentation + */ + 'flex'?: number/**/; + /** + * The minimum amount of space to include before this component in its parent container. + * + * @see margin Documentation + */ + 'margin'?: string/**/; + /** + * Reference for offsetTop, offsetBottom, offsetStart, and offsetEnd. Specify one of the following values: `relative`: Use the previous box as reference. `absolute`: Use the top left of parent element as reference. The default value is relative. + * + * @see position Documentation + */ + 'position'?: FlexImage.PositionEnum/**/; + /** + * Offset. + * + * @see offsetTop Documentation + */ + 'offsetTop'?: string/**/; + /** + * Offset. + * + * @see offsetBottom Documentation + */ + 'offsetBottom'?: string/**/; + /** + * Offset. + * + * @see offsetStart Documentation + */ + 'offsetStart'?: string/**/; + /** + * Offset. + * + * @see offsetEnd Documentation + */ + 'offsetEnd'?: string/**/; + /** + * Alignment style in horizontal direction. + * + * @see align Documentation + */ + 'align'?: FlexImage.AlignEnum/**/; + /** + * Alignment style in vertical direction. + * + * @see gravity Documentation + */ + 'gravity'?: FlexImage.GravityEnum/**/; + /** + * The maximum image width. This is md by default. + * + * @see size Documentation + */ + 'size'?: string/* = 'md'*/; + /** + * Aspect ratio of the image. `{width}:{height}` format. Specify the value of `{width}` and `{height}` in the range from `1` to `100000`. However, you cannot set `{height}` to a value that is more than three times the value of `{width}`. The default value is `1:1`. + * + * @see aspectRatio Documentation + */ + 'aspectRatio'?: string/**/; + /** + * The display style of the image if the aspect ratio of the image and that specified by the aspectRatio property do not match. + * + * @see aspectMode Documentation + */ + 'aspectMode'?: FlexImage.AspectModeEnum/**/; + /** + * Background color of the image. Use a hexadecimal color code. + * + * @see backgroundColor Documentation + */ + 'backgroundColor'?: string/**/; + /** + * + * @see action Documentation + */ + 'action'?: Action/**/; + /** + * When this is `true`, an animated image (APNG) plays. You can specify a value of true up to 10 images in a single message. You can\'t send messages that exceed this limit. This is `false` by default. Animated images larger than 300 KB aren\'t played back. + * + * @see animated Documentation + */ + 'animated'?: boolean/* = false*/; + +} + + + export namespace FlexImage { - export type PositionEnum = "relative" | "absolute"; + + + + export type PositionEnum = + 'relative' + | 'absolute' + + + ; + + + + + + export type AlignEnum = + 'start' + | 'end' + | 'center' + + + ; + + export type GravityEnum = + 'top' + | 'bottom' + | 'center' + + + ; + + + + export type AspectModeEnum = + 'fit' + | 'cover' + + + ; + + + + + +} + - export type AlignEnum = "start" | "end" | "center"; + - export type GravityEnum = "top" | "bottom" | "center"; - export type AspectModeEnum = "fit" | "cover"; -} diff --git a/lib/messaging-api/model/flexImageSize.ts b/lib/messaging-api/model/flexImageSize.ts index bfa6cad4a..ff47fc0ae 100644 --- a/lib/messaging-api/model/flexImageSize.ts +++ b/lib/messaging-api/model/flexImageSize.ts @@ -10,19 +10,31 @@ * Do not edit the class manually. */ + + + + + /** - * You can set the width of an Flex image component with the `size` property, in pixels, as a percentage, or with a keyword. FlexImageSize just provides only keywords. + * You can set the width of an Flex image component with the `size` property, in pixels, as a percentage, or with a keyword. FlexImageSize just provides only keywords. */ -export type FlexImageSize = - | "xxs" - | "xs" - | "sm" - | "md" - | "lg" - | "xl" - | "xxl" - | "3xl" - | "4xl" - | "5xl" - | "full"; + + + export type FlexImageSize = + 'xxs' + | 'xs' + | 'sm' + | 'md' + | 'lg' + | 'xl' + | 'xxl' + | '3xl' + | '4xl' + | '5xl' + | 'full' + +; + + + diff --git a/lib/messaging-api/model/flexMargin.ts b/lib/messaging-api/model/flexMargin.ts index caad5a150..84c53fc33 100644 --- a/lib/messaging-api/model/flexMargin.ts +++ b/lib/messaging-api/model/flexMargin.ts @@ -10,8 +10,27 @@ * Do not edit the class manually. */ + + + + + /** - * You can specify the minimum space before a child component with the `margin` property of the child component, in pixels or with a keyword. FlexMargin just provides only keywords. + * You can specify the minimum space before a child component with the `margin` property of the child component, in pixels or with a keyword. FlexMargin just provides only keywords. */ -export type FlexMargin = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl"; + + + export type FlexMargin = + 'none' + | 'xs' + | 'sm' + | 'md' + | 'lg' + | 'xl' + | 'xxl' + +; + + + diff --git a/lib/messaging-api/model/flexMessage.ts b/lib/messaging-api/model/flexMessage.ts index bbff35570..c37c21a84 100644 --- a/lib/messaging-api/model/flexMessage.ts +++ b/lib/messaging-api/model/flexMessage.ts @@ -10,23 +10,32 @@ * Do not edit the class manually. */ -import { FlexContainer } from "./flexContainer"; -import { Message } from "./message"; -import { QuickReply } from "./quickReply"; -import { Sender } from "./sender"; - -import { MessageBase } from "./models"; - -export type FlexMessage = MessageBase & { - type: "flex"; - /** - * - * @see altText Documentation - */ - altText: string /**/; - /** - * - * @see contents Documentation - */ - contents: FlexContainer /**/; -}; + + + import { FlexContainer } from './flexContainer.js';import { Message } from './message.js';import { QuickReply } from './quickReply.js';import { Sender } from './sender.js'; + + +import { MessageBase } from './models.js'; + + +export type FlexMessage = MessageBase & { +type: "flex", + /** + * + * @see altText Documentation + */ + 'altText': string/**/; + /** + * + * @see contents Documentation + */ + 'contents': FlexContainer/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/flexOffset.ts b/lib/messaging-api/model/flexOffset.ts index 131da8c2f..080c78580 100644 --- a/lib/messaging-api/model/flexOffset.ts +++ b/lib/messaging-api/model/flexOffset.ts @@ -10,8 +10,27 @@ * Do not edit the class manually. */ + + + + + /** - * You can specify the offset of a component with the `offset*` property, in pixels or with a keyword. You can also specify the percentage to the box width for `offsetStart` and `offsetEnd` and to the box height for `offsetTop` and `offsetBottom`. FlexOffset just provides only keywords. + * You can specify the offset of a component with the `offset*` property, in pixels or with a keyword. You can also specify the percentage to the box width for `offsetStart` and `offsetEnd` and to the box height for `offsetTop` and `offsetBottom`. FlexOffset just provides only keywords. */ -export type FlexOffset = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl"; + + + export type FlexOffset = + 'none' + | 'xs' + | 'sm' + | 'md' + | 'lg' + | 'xl' + | 'xxl' + +; + + + diff --git a/lib/messaging-api/model/flexSeparator.ts b/lib/messaging-api/model/flexSeparator.ts index 289fdfdbc..8f8a7421c 100644 --- a/lib/messaging-api/model/flexSeparator.ts +++ b/lib/messaging-api/model/flexSeparator.ts @@ -10,16 +10,28 @@ * Do not edit the class manually. */ -import { FlexComponent } from "./flexComponent"; - -import { FlexComponentBase } from "./models"; - -export type FlexSeparator = FlexComponentBase & { - type: "separator"; - /** - */ - margin?: string /**/; - /** - */ - color?: string /**/; -}; + + + import { FlexComponent } from './flexComponent.js'; + + +import { FlexComponentBase } from './models.js'; + + +export type FlexSeparator = FlexComponentBase & { +type: "separator", + /** + */ + 'margin'?: string/**/; + /** + */ + 'color'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/flexSpan.ts b/lib/messaging-api/model/flexSpan.ts index a88440bd6..007d8d71a 100644 --- a/lib/messaging-api/model/flexSpan.ts +++ b/lib/messaging-api/model/flexSpan.ts @@ -10,36 +10,69 @@ * Do not edit the class manually. */ -import { FlexComponent } from "./flexComponent"; - -import { FlexComponentBase } from "./models"; - -export type FlexSpan = FlexComponentBase & { - type: "span"; - /** - */ - text?: string /**/; - /** - */ - size?: string /**/; - /** - */ - color?: string /**/; - /** - */ - weight?: FlexSpan.WeightEnum /**/; - /** - */ - style?: FlexSpan.StyleEnum /**/; - /** - */ - decoration?: FlexSpan.DecorationEnum /**/; -}; -export namespace FlexSpan { - export type WeightEnum = "regular" | "bold"; - export type StyleEnum = "normal" | "italic"; + import { FlexComponent } from './flexComponent.js'; + + +import { FlexComponentBase } from './models.js'; + + +export type FlexSpan = FlexComponentBase & { +type: "span", + /** + */ + 'text'?: string/**/; + /** + */ + 'size'?: string/**/; + /** + */ + 'color'?: string/**/; + /** + */ + 'weight'?: FlexSpan.WeightEnum/**/; + /** + */ + 'style'?: FlexSpan.StyleEnum/**/; + /** + */ + 'decoration'?: FlexSpan.DecorationEnum/**/; + +} + - export type DecorationEnum = "none" | "underline" | "line-through"; + +export namespace FlexSpan { + + + + export type WeightEnum = + 'regular' + | 'bold' + + + ; + + export type StyleEnum = + 'normal' + | 'italic' + + + ; + + export type DecorationEnum = + 'none' + | 'underline' + | 'line-through' + + + ; + + } + + + + + diff --git a/lib/messaging-api/model/flexSpanSize.ts b/lib/messaging-api/model/flexSpanSize.ts index 929dea396..f9713a278 100644 --- a/lib/messaging-api/model/flexSpanSize.ts +++ b/lib/messaging-api/model/flexSpanSize.ts @@ -10,18 +10,30 @@ * Do not edit the class manually. */ + + + + + /** - * Font size in the `size` property of the Flex span component. You can specify the size in pixels or with a keyword. FlexSpanSize just provides only keywords. + * Font size in the `size` property of the Flex span component. You can specify the size in pixels or with a keyword. FlexSpanSize just provides only keywords. */ -export type FlexSpanSize = - | "xxs" - | "xs" - | "sm" - | "md" - | "lg" - | "xl" - | "xxl" - | "3xl" - | "4xl" - | "5xl"; + + + export type FlexSpanSize = + 'xxs' + | 'xs' + | 'sm' + | 'md' + | 'lg' + | 'xl' + | 'xxl' + | '3xl' + | '4xl' + | '5xl' + +; + + + diff --git a/lib/messaging-api/model/flexText.ts b/lib/messaging-api/model/flexText.ts index a139fdd4d..f6825418d 100644 --- a/lib/messaging-api/model/flexText.ts +++ b/lib/messaging-api/model/flexText.ts @@ -10,94 +10,158 @@ * Do not edit the class manually. */ -import { Action } from "./action"; -import { FlexComponent } from "./flexComponent"; -import { FlexSpan } from "./flexSpan"; -import { FlexComponentBase } from "./models"; -export type FlexText = FlexComponentBase & { - type: "text"; - /** - */ - flex?: number /**/; - /** - */ - text?: string /**/; - /** - */ - size?: string /**/; - /** - */ - align?: FlexText.AlignEnum /**/; - /** - */ - gravity?: FlexText.GravityEnum /**/; - /** - */ - color?: string /**/; - /** - */ - weight?: FlexText.WeightEnum /**/; - /** - */ - style?: FlexText.StyleEnum /**/; - /** - */ - decoration?: FlexText.DecorationEnum /**/; - /** - */ - wrap?: boolean /**/; - /** - */ - lineSpacing?: string /**/; - /** - */ - margin?: string /**/; - /** - */ - position?: FlexText.PositionEnum /**/; - /** - */ - offsetTop?: string /**/; - /** - */ - offsetBottom?: string /**/; - /** - */ - offsetStart?: string /**/; - /** - */ - offsetEnd?: string /**/; - /** - */ - action?: Action /**/; - /** - */ - maxLines?: number /**/; - /** - */ - contents?: Array /**/; - /** - */ - adjustMode?: FlexText.AdjustModeEnum /**/; - /** - */ - scaling?: boolean /**/; -}; + import { Action } from './action.js';import { FlexComponent } from './flexComponent.js';import { FlexSpan } from './flexSpan.js'; -export namespace FlexText { - export type AlignEnum = "start" | "end" | "center"; - - export type GravityEnum = "top" | "bottom" | "center"; + +import { FlexComponentBase } from './models.js'; - export type WeightEnum = "regular" | "bold"; + +export type FlexText = FlexComponentBase & { +type: "text", + /** + */ + 'flex'?: number/**/; + /** + */ + 'text'?: string/**/; + /** + */ + 'size'?: string/**/; + /** + */ + 'align'?: FlexText.AlignEnum/**/; + /** + */ + 'gravity'?: FlexText.GravityEnum/**/; + /** + */ + 'color'?: string/**/; + /** + */ + 'weight'?: FlexText.WeightEnum/**/; + /** + */ + 'style'?: FlexText.StyleEnum/**/; + /** + */ + 'decoration'?: FlexText.DecorationEnum/**/; + /** + */ + 'wrap'?: boolean/**/; + /** + */ + 'lineSpacing'?: string/**/; + /** + */ + 'margin'?: string/**/; + /** + */ + 'position'?: FlexText.PositionEnum/**/; + /** + */ + 'offsetTop'?: string/**/; + /** + */ + 'offsetBottom'?: string/**/; + /** + */ + 'offsetStart'?: string/**/; + /** + */ + 'offsetEnd'?: string/**/; + /** + */ + 'action'?: Action/**/; + /** + */ + 'maxLines'?: number/**/; + /** + */ + 'contents'?: Array/**/; + /** + */ + 'adjustMode'?: FlexText.AdjustModeEnum/**/; + /** + */ + 'scaling'?: boolean/**/; + +} + - export type StyleEnum = "normal" | "italic"; + +export namespace FlexText { + + + + export type AlignEnum = + 'start' + | 'end' + | 'center' + + + ; + + export type GravityEnum = + 'top' + | 'bottom' + | 'center' + + + ; + + + export type WeightEnum = + 'regular' + | 'bold' + + + ; + + export type StyleEnum = + 'normal' + | 'italic' + + + ; + + export type DecorationEnum = + 'none' + | 'underline' + | 'line-through' + + + ; + + + + + export type PositionEnum = + 'relative' + | 'absolute' + + + ; + + + + + + + + + export type AdjustModeEnum = + 'shrink-to-fit' + + + ; + + + +} + - export type DecorationEnum = "none" | "underline" | "line-through"; + - export type PositionEnum = "relative" | "absolute"; - export type AdjustModeEnum = "shrink-to-fit"; -} diff --git a/lib/messaging-api/model/flexTextFontSize.ts b/lib/messaging-api/model/flexTextFontSize.ts index defc5ddd9..43d8e0f02 100644 --- a/lib/messaging-api/model/flexTextFontSize.ts +++ b/lib/messaging-api/model/flexTextFontSize.ts @@ -10,18 +10,30 @@ * Do not edit the class manually. */ + + + + + /** - * Font size in the `size` property of the Flex text component. You can specify the size in pixels or with a keyword. FlexTextFontSize just provides only keywords. + * Font size in the `size` property of the Flex text component. You can specify the size in pixels or with a keyword. FlexTextFontSize just provides only keywords. */ -export type FlexTextFontSize = - | "xxs" - | "xs" - | "sm" - | "md" - | "lg" - | "xl" - | "xxl" - | "3xl" - | "4xl" - | "5xl"; + + + export type FlexTextFontSize = + 'xxs' + | 'xs' + | 'sm' + | 'md' + | 'lg' + | 'xl' + | 'xxl' + | '3xl' + | '4xl' + | '5xl' + +; + + + diff --git a/lib/messaging-api/model/flexVideo.ts b/lib/messaging-api/model/flexVideo.ts index 79e310ca7..96bf7d540 100644 --- a/lib/messaging-api/model/flexVideo.ts +++ b/lib/messaging-api/model/flexVideo.ts @@ -10,26 +10,37 @@ * Do not edit the class manually. */ -import { Action } from "./action"; -import { FlexComponent } from "./flexComponent"; - -import { FlexComponentBase } from "./models"; - -export type FlexVideo = FlexComponentBase & { - type: "video"; - /** - */ - url: string /**/; - /** - */ - previewUrl: string /**/; - /** - */ - altContent: FlexComponent /**/; - /** - */ - aspectRatio?: string /**/; - /** - */ - action?: Action /**/; -}; + + + import { Action } from './action.js';import { FlexComponent } from './flexComponent.js'; + + +import { FlexComponentBase } from './models.js'; + + +export type FlexVideo = FlexComponentBase & { +type: "video", + /** + */ + 'url': string/**/; + /** + */ + 'previewUrl': string/**/; + /** + */ + 'altContent': FlexComponent/**/; + /** + */ + 'aspectRatio'?: string/**/; + /** + */ + 'action'?: Action/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/genderDemographic.ts b/lib/messaging-api/model/genderDemographic.ts index 53d1c737f..a7826ee0d 100644 --- a/lib/messaging-api/model/genderDemographic.ts +++ b/lib/messaging-api/model/genderDemographic.ts @@ -10,4 +10,19 @@ * Do not edit the class manually. */ -export type GenderDemographic = "male" | "female"; + + + + + + + + + export type GenderDemographic = + 'male' + | 'female' + +; + + + diff --git a/lib/messaging-api/model/genderDemographicFilter.ts b/lib/messaging-api/model/genderDemographicFilter.ts index 324fd1a5e..9f2deb5c8 100644 --- a/lib/messaging-api/model/genderDemographicFilter.ts +++ b/lib/messaging-api/model/genderDemographicFilter.ts @@ -10,14 +10,25 @@ * Do not edit the class manually. */ -import { DemographicFilter } from "./demographicFilter"; -import { GenderDemographic } from "./genderDemographic"; -import { DemographicFilterBase } from "./models"; -export type GenderDemographicFilter = DemographicFilterBase & { - type: "gender"; - /** - */ - oneOf?: Array /**/; -}; + import { DemographicFilter } from './demographicFilter.js';import { GenderDemographic } from './genderDemographic.js'; + + +import { DemographicFilterBase } from './models.js'; + + +export type GenderDemographicFilter = DemographicFilterBase & { +type: "gender", + /** + */ + 'oneOf'?: Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/getAggregationUnitNameListResponse.ts b/lib/messaging-api/model/getAggregationUnitNameListResponse.ts index e01651737..c76407945 100644 --- a/lib/messaging-api/model/getAggregationUnitNameListResponse.ts +++ b/lib/messaging-api/model/getAggregationUnitNameListResponse.ts @@ -10,17 +10,30 @@ * Do not edit the class manually. */ -export type GetAggregationUnitNameListResponse = { - /** - * An array of strings indicating the names of aggregation units used this month. - * - * @see customAggregationUnits Documentation - */ - customAggregationUnits: Array /**/; - /** - * A continuation token to get the next array of unit names. Returned only when there are remaining aggregation units that weren\'t returned in customAggregationUnits in the original request. - * - * @see next Documentation - */ - next?: string /**/; -}; + + + + + +export type GetAggregationUnitNameListResponse = { + /** + * An array of strings indicating the names of aggregation units used this month. + * + * @see customAggregationUnits Documentation + */ + 'customAggregationUnits': Array/**/; + /** + * A continuation token to get the next array of unit names. Returned only when there are remaining aggregation units that weren\'t returned in customAggregationUnits in the original request. + * + * @see next Documentation + */ + 'next'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/getAggregationUnitUsageResponse.ts b/lib/messaging-api/model/getAggregationUnitUsageResponse.ts index ccf70f3a3..ed6184306 100644 --- a/lib/messaging-api/model/getAggregationUnitUsageResponse.ts +++ b/lib/messaging-api/model/getAggregationUnitUsageResponse.ts @@ -10,11 +10,24 @@ * Do not edit the class manually. */ -export type GetAggregationUnitUsageResponse = { - /** - * Number of aggregation units used this month. - * - * @see numOfCustomAggregationUnits Documentation - */ - numOfCustomAggregationUnits: number /**/; -}; + + + + + +export type GetAggregationUnitUsageResponse = { + /** + * Number of aggregation units used this month. + * + * @see numOfCustomAggregationUnits Documentation + */ + 'numOfCustomAggregationUnits': number/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/getFollowersResponse.ts b/lib/messaging-api/model/getFollowersResponse.ts index 063a77bfe..6425218c6 100644 --- a/lib/messaging-api/model/getFollowersResponse.ts +++ b/lib/messaging-api/model/getFollowersResponse.ts @@ -10,17 +10,30 @@ * Do not edit the class manually. */ -export type GetFollowersResponse = { - /** - * An array of strings indicating user IDs of users that have added the LINE Official Account as a friend. Only users of LINE for iOS and LINE for Android are included in `userIds`. - * - * @see userIds Documentation - */ - userIds: Array /**/; - /** - * A continuation token to get the next array of user IDs. Returned only when there are remaining user IDs that weren\'t returned in `userIds` in the original request. The number of user IDs in the `userIds` element doesn\'t have to reach the maximum number specified by `limit` for the `next` property to be included in the response. - * - * @see next Documentation - */ - next?: string /**/; -}; + + + + + +export type GetFollowersResponse = { + /** + * An array of strings indicating user IDs of users that have added the LINE Official Account as a friend. Only users of LINE for iOS and LINE for Android are included in `userIds`. + * + * @see userIds Documentation + */ + 'userIds': Array/**/; + /** + * A continuation token to get the next array of user IDs. Returned only when there are remaining user IDs that weren\'t returned in `userIds` in the original request. The number of user IDs in the `userIds` element doesn\'t have to reach the maximum number specified by `limit` for the `next` property to be included in the response. + * + * @see next Documentation + */ + 'next'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/getMessageContentTranscodingResponse.ts b/lib/messaging-api/model/getMessageContentTranscodingResponse.ts index 36c60c2ee..2ac6bf60c 100644 --- a/lib/messaging-api/model/getMessageContentTranscodingResponse.ts +++ b/lib/messaging-api/model/getMessageContentTranscodingResponse.ts @@ -10,18 +10,39 @@ * Do not edit the class manually. */ + + + + + /** * Transcoding response */ -export type GetMessageContentTranscodingResponse = { - /** - * The preparation status. One of: `processing`: Preparing to get content. `succeeded`: Ready to get the content. You can get the content sent by users. `failed`: Failed to prepare to get the content. - * - * @see status Documentation - */ - status: GetMessageContentTranscodingResponse.StatusEnum /**/; -}; +export type GetMessageContentTranscodingResponse = { + /** + * The preparation status. One of: `processing`: Preparing to get content. `succeeded`: Ready to get the content. You can get the content sent by users. `failed`: Failed to prepare to get the content. + * + * @see status Documentation + */ + 'status': GetMessageContentTranscodingResponse.StatusEnum/**/; + +} + + export namespace GetMessageContentTranscodingResponse { - export type StatusEnum = "processing" | "succeeded" | "failed"; + export type StatusEnum = + 'processing' + | 'succeeded' + | 'failed' + + + ; + + } + + + + + diff --git a/lib/messaging-api/model/getWebhookEndpointResponse.ts b/lib/messaging-api/model/getWebhookEndpointResponse.ts index c6251eb19..0db279eb0 100644 --- a/lib/messaging-api/model/getWebhookEndpointResponse.ts +++ b/lib/messaging-api/model/getWebhookEndpointResponse.ts @@ -10,17 +10,30 @@ * Do not edit the class manually. */ -export type GetWebhookEndpointResponse = { - /** - * Webhook URL - * - * @see endpoint Documentation - */ - endpoint: string /**/; - /** - * Webhook usage status. Send a webhook event from the LINE Platform to the webhook URL only if enabled. `true`: Webhook usage is enabled. `false`: Webhook usage is disabled. - * - * @see active Documentation - */ - active: boolean /**/; -}; + + + + + +export type GetWebhookEndpointResponse = { + /** + * Webhook URL + * + * @see endpoint Documentation + */ + 'endpoint': string/**/; + /** + * Webhook usage status. Send a webhook event from the LINE Platform to the webhook URL only if enabled. `true`: Webhook usage is enabled. `false`: Webhook usage is disabled. + * + * @see active Documentation + */ + 'active': boolean/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/groupMemberCountResponse.ts b/lib/messaging-api/model/groupMemberCountResponse.ts index 5e2186190..be23efc0a 100644 --- a/lib/messaging-api/model/groupMemberCountResponse.ts +++ b/lib/messaging-api/model/groupMemberCountResponse.ts @@ -10,11 +10,24 @@ * Do not edit the class manually. */ -export type GroupMemberCountResponse = { - /** - * The count of members in the group chat. The number returned excludes the LINE Official Account. - * - * @see count Documentation - */ - count: number /**/; -}; + + + + + +export type GroupMemberCountResponse = { + /** + * The count of members in the group chat. The number returned excludes the LINE Official Account. + * + * @see count Documentation + */ + 'count': number/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/groupSummaryResponse.ts b/lib/messaging-api/model/groupSummaryResponse.ts index e7ad4a669..3ad770b0b 100644 --- a/lib/messaging-api/model/groupSummaryResponse.ts +++ b/lib/messaging-api/model/groupSummaryResponse.ts @@ -10,23 +10,36 @@ * Do not edit the class manually. */ -export type GroupSummaryResponse = { - /** - * Group ID - * - * @see groupId Documentation - */ - groupId: string /**/; - /** - * Group name - * - * @see groupName Documentation - */ - groupName: string /**/; - /** - * Group icon URL. Not included in the response if the user doesn\'t set a group profile icon. - * - * @see pictureUrl Documentation - */ - pictureUrl?: string /**/; -}; + + + + + +export type GroupSummaryResponse = { + /** + * Group ID + * + * @see groupId Documentation + */ + 'groupId': string/**/; + /** + * Group name + * + * @see groupName Documentation + */ + 'groupName': string/**/; + /** + * Group icon URL. Not included in the response if the user doesn\'t set a group profile icon. + * + * @see pictureUrl Documentation + */ + 'pictureUrl'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/groupUserProfileResponse.ts b/lib/messaging-api/model/groupUserProfileResponse.ts index 88db449bd..49a6d1925 100644 --- a/lib/messaging-api/model/groupUserProfileResponse.ts +++ b/lib/messaging-api/model/groupUserProfileResponse.ts @@ -10,23 +10,36 @@ * Do not edit the class manually. */ -export type GroupUserProfileResponse = { - /** - * User\'s display name - * - * @see displayName Documentation - */ - displayName: string /**/; - /** - * User ID - * - * @see userId Documentation - */ - userId: string /**/; - /** - * Profile image URL. `https` image URL. Not included in the response if the user doesn\'t have a profile image. - * - * @see pictureUrl Documentation - */ - pictureUrl?: string /**/; -}; + + + + + +export type GroupUserProfileResponse = { + /** + * User\'s display name + * + * @see displayName Documentation + */ + 'displayName': string/**/; + /** + * User ID + * + * @see userId Documentation + */ + 'userId': string/**/; + /** + * Profile image URL. `https` image URL. Not included in the response if the user doesn\'t have a profile image. + * + * @see pictureUrl Documentation + */ + 'pictureUrl'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/imageCarouselColumn.ts b/lib/messaging-api/model/imageCarouselColumn.ts index aae74c566..9db934d26 100644 --- a/lib/messaging-api/model/imageCarouselColumn.ts +++ b/lib/messaging-api/model/imageCarouselColumn.ts @@ -10,13 +10,24 @@ * Do not edit the class manually. */ -import { Action } from "./action"; - -export type ImageCarouselColumn = { - /** - */ - imageUrl: string /**/; - /** - */ - action: Action /**/; -}; + + + import { Action } from './action.js'; + + +export type ImageCarouselColumn = { + /** + */ + 'imageUrl': string/**/; + /** + */ + 'action': Action/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/imageCarouselTemplate.ts b/lib/messaging-api/model/imageCarouselTemplate.ts index e8133919f..05e710bec 100644 --- a/lib/messaging-api/model/imageCarouselTemplate.ts +++ b/lib/messaging-api/model/imageCarouselTemplate.ts @@ -10,14 +10,25 @@ * Do not edit the class manually. */ -import { ImageCarouselColumn } from "./imageCarouselColumn"; -import { Template } from "./template"; -import { TemplateBase } from "./models"; -export type ImageCarouselTemplate = TemplateBase & { - type: "image_carousel"; - /** - */ - columns: Array /**/; -}; + import { ImageCarouselColumn } from './imageCarouselColumn.js';import { Template } from './template.js'; + + +import { TemplateBase } from './models.js'; + + +export type ImageCarouselTemplate = TemplateBase & { +type: "image_carousel", + /** + */ + 'columns': Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/imageMessage.ts b/lib/messaging-api/model/imageMessage.ts index e1c23c2ad..745c49a4a 100644 --- a/lib/messaging-api/model/imageMessage.ts +++ b/lib/messaging-api/model/imageMessage.ts @@ -10,22 +10,32 @@ * Do not edit the class manually. */ -import { Message } from "./message"; -import { QuickReply } from "./quickReply"; -import { Sender } from "./sender"; - -import { MessageBase } from "./models"; - -export type ImageMessage = MessageBase & { - type: "image"; - /** - * - * @see originalContentUrl Documentation - */ - originalContentUrl: string /**/; - /** - * - * @see previewImageUrl Documentation - */ - previewImageUrl: string /**/; -}; + + + import { Message } from './message.js';import { QuickReply } from './quickReply.js';import { Sender } from './sender.js'; + + +import { MessageBase } from './models.js'; + + +export type ImageMessage = MessageBase & { +type: "image", + /** + * + * @see originalContentUrl Documentation + */ + 'originalContentUrl': string/**/; + /** + * + * @see previewImageUrl Documentation + */ + 'previewImageUrl': string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/imagemapAction.ts b/lib/messaging-api/model/imagemapAction.ts index 96a58384d..811137720 100644 --- a/lib/messaging-api/model/imagemapAction.ts +++ b/lib/messaging-api/model/imagemapAction.ts @@ -10,31 +10,44 @@ * Do not edit the class manually. */ -import { ImagemapArea } from "./imagemapArea"; -import { ClipboardImagemapAction } from "./models"; -import { MessageImagemapAction } from "./models"; -import { URIImagemapAction } from "./models"; + + import { ImagemapArea } from './imagemapArea.js'; + + + import { ClipboardImagemapAction } from './models.js'; + import { MessageImagemapAction } from './models.js'; + import { URIImagemapAction } from './models.js'; + export type ImagemapAction = - | ClipboardImagemapAction // clipboard - | MessageImagemapAction // message - | URIImagemapAction // uri - | UnknownImagemapAction; + | ClipboardImagemapAction // clipboard + | MessageImagemapAction // message + | URIImagemapAction // uri + | UnknownImagemapAction +; export type UnknownImagemapAction = ImagemapActionBase & { - [key: string]: unknown; + [key: string]: unknown; }; + +export type ImagemapActionBase = { + /** + * + * @see type Documentation + */ + 'type': string/**/; + /** + * + * @see area Documentation + */ + 'area': ImagemapArea/**/; + +} + + + + + + -export type ImagemapActionBase = { - /** - * - * @see type Documentation - */ - type: string /**/; - /** - * - * @see area Documentation - */ - area: ImagemapArea /**/; -}; diff --git a/lib/messaging-api/model/imagemapArea.ts b/lib/messaging-api/model/imagemapArea.ts index 6c341b826..346949180 100644 --- a/lib/messaging-api/model/imagemapArea.ts +++ b/lib/messaging-api/model/imagemapArea.ts @@ -10,17 +10,30 @@ * Do not edit the class manually. */ -export type ImagemapArea = { - /** - */ - x: number /**/; - /** - */ - y: number /**/; - /** - */ - width: number /**/; - /** - */ - height: number /**/; -}; + + + + + +export type ImagemapArea = { + /** + */ + 'x': number/**/; + /** + */ + 'y': number/**/; + /** + */ + 'width': number/**/; + /** + */ + 'height': number/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/imagemapBaseSize.ts b/lib/messaging-api/model/imagemapBaseSize.ts index 8e39d8309..07b57cc79 100644 --- a/lib/messaging-api/model/imagemapBaseSize.ts +++ b/lib/messaging-api/model/imagemapBaseSize.ts @@ -10,11 +10,24 @@ * Do not edit the class manually. */ -export type ImagemapBaseSize = { - /** - */ - height: number /**/; - /** - */ - width: number /**/; -}; + + + + + +export type ImagemapBaseSize = { + /** + */ + 'height': number/**/; + /** + */ + 'width': number/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/imagemapExternalLink.ts b/lib/messaging-api/model/imagemapExternalLink.ts index 559cd0d01..779263da0 100644 --- a/lib/messaging-api/model/imagemapExternalLink.ts +++ b/lib/messaging-api/model/imagemapExternalLink.ts @@ -10,11 +10,24 @@ * Do not edit the class manually. */ -export type ImagemapExternalLink = { - /** - */ - linkUri?: string /**/; - /** - */ - label?: string /**/; -}; + + + + + +export type ImagemapExternalLink = { + /** + */ + 'linkUri'?: string/**/; + /** + */ + 'label'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/imagemapMessage.ts b/lib/messaging-api/model/imagemapMessage.ts index f7ff7f51d..ab2c9e0d4 100644 --- a/lib/messaging-api/model/imagemapMessage.ts +++ b/lib/messaging-api/model/imagemapMessage.ts @@ -10,40 +10,47 @@ * Do not edit the class manually. */ -import { ImagemapAction } from "./imagemapAction"; -import { ImagemapBaseSize } from "./imagemapBaseSize"; -import { ImagemapVideo } from "./imagemapVideo"; -import { Message } from "./message"; -import { QuickReply } from "./quickReply"; -import { Sender } from "./sender"; - -import { MessageBase } from "./models"; - -export type ImagemapMessage = MessageBase & { - type: "imagemap"; - /** - * - * @see baseUrl Documentation - */ - baseUrl: string /**/; - /** - * - * @see altText Documentation - */ - altText: string /**/; - /** - * - * @see baseSize Documentation - */ - baseSize: ImagemapBaseSize /**/; - /** - * - * @see actions Documentation - */ - actions: Array /**/; - /** - * - * @see video Documentation - */ - video?: ImagemapVideo /**/; -}; + + + import { ImagemapAction } from './imagemapAction.js';import { ImagemapBaseSize } from './imagemapBaseSize.js';import { ImagemapVideo } from './imagemapVideo.js';import { Message } from './message.js';import { QuickReply } from './quickReply.js';import { Sender } from './sender.js'; + + +import { MessageBase } from './models.js'; + + +export type ImagemapMessage = MessageBase & { +type: "imagemap", + /** + * + * @see baseUrl Documentation + */ + 'baseUrl': string/**/; + /** + * + * @see altText Documentation + */ + 'altText': string/**/; + /** + * + * @see baseSize Documentation + */ + 'baseSize': ImagemapBaseSize/**/; + /** + * + * @see actions Documentation + */ + 'actions': Array/**/; + /** + * + * @see video Documentation + */ + 'video'?: ImagemapVideo/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/imagemapVideo.ts b/lib/messaging-api/model/imagemapVideo.ts index 7d7c330a8..4ae87cc8a 100644 --- a/lib/messaging-api/model/imagemapVideo.ts +++ b/lib/messaging-api/model/imagemapVideo.ts @@ -10,20 +10,30 @@ * Do not edit the class manually. */ -import { ImagemapArea } from "./imagemapArea"; -import { ImagemapExternalLink } from "./imagemapExternalLink"; - -export type ImagemapVideo = { - /** - */ - originalContentUrl?: string /**/; - /** - */ - previewImageUrl?: string /**/; - /** - */ - area?: ImagemapArea /**/; - /** - */ - externalLink?: ImagemapExternalLink /**/; -}; + + + import { ImagemapArea } from './imagemapArea.js';import { ImagemapExternalLink } from './imagemapExternalLink.js'; + + +export type ImagemapVideo = { + /** + */ + 'originalContentUrl'?: string/**/; + /** + */ + 'previewImageUrl'?: string/**/; + /** + */ + 'area'?: ImagemapArea/**/; + /** + */ + 'externalLink'?: ImagemapExternalLink/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/issueLinkTokenResponse.ts b/lib/messaging-api/model/issueLinkTokenResponse.ts index 09fc115d4..c4c506a1e 100644 --- a/lib/messaging-api/model/issueLinkTokenResponse.ts +++ b/lib/messaging-api/model/issueLinkTokenResponse.ts @@ -10,11 +10,24 @@ * Do not edit the class manually. */ -export type IssueLinkTokenResponse = { - /** - * Link token. Link tokens are valid for 10 minutes and can only be used once. - * - * @see linkToken Documentation - */ - linkToken: string /**/; -}; + + + + + +export type IssueLinkTokenResponse = { + /** + * Link token. Link tokens are valid for 10 minutes and can only be used once. + * + * @see linkToken Documentation + */ + 'linkToken': string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/limit.ts b/lib/messaging-api/model/limit.ts index 64fe9d0e1..5e866ff35 100644 --- a/lib/messaging-api/model/limit.ts +++ b/lib/messaging-api/model/limit.ts @@ -10,20 +10,33 @@ * Do not edit the class manually. */ + + + + + /** * Limit of the Narrowcast */ -export type Limit = { - /** - * The maximum number of narrowcast messages to send. Use this parameter to limit the number of narrowcast messages sent. The recipients will be chosen at random. - * - * @see max Documentation - */ - max?: number /**/; - /** - * If true, the message will be sent within the maximum number of deliverable messages. The default value is `false`. Targets will be selected at random. - * - * @see upToRemainingQuota Documentation - */ - upToRemainingQuota?: boolean /* = false*/; -}; +export type Limit = { + /** + * The maximum number of narrowcast messages to send. Use this parameter to limit the number of narrowcast messages sent. The recipients will be chosen at random. + * + * @see max Documentation + */ + 'max'?: number/**/; + /** + * If true, the message will be sent within the maximum number of deliverable messages. The default value is `false`. Targets will be selected at random. + * + * @see upToRemainingQuota Documentation + */ + 'upToRemainingQuota'?: boolean/* = false*/; + +} + + + + + + + diff --git a/lib/messaging-api/model/locationAction.ts b/lib/messaging-api/model/locationAction.ts index 17102320f..5b1c894f0 100644 --- a/lib/messaging-api/model/locationAction.ts +++ b/lib/messaging-api/model/locationAction.ts @@ -10,10 +10,22 @@ * Do not edit the class manually. */ -import { Action } from "./action"; -import { ActionBase } from "./models"; -export type LocationAction = ActionBase & { - type: "location"; -}; + import { Action } from './action.js'; + + +import { ActionBase } from './models.js'; + + +export type LocationAction = ActionBase & { +type: "location", + +} + + + + + + + diff --git a/lib/messaging-api/model/locationMessage.ts b/lib/messaging-api/model/locationMessage.ts index 4c4d7dd21..0c82ba9b0 100644 --- a/lib/messaging-api/model/locationMessage.ts +++ b/lib/messaging-api/model/locationMessage.ts @@ -10,32 +10,42 @@ * Do not edit the class manually. */ -import { Message } from "./message"; -import { QuickReply } from "./quickReply"; -import { Sender } from "./sender"; - -import { MessageBase } from "./models"; - -export type LocationMessage = MessageBase & { - type: "location"; - /** - * - * @see title Documentation - */ - title: string /**/; - /** - * - * @see address Documentation - */ - address: string /**/; - /** - * - * @see latitude Documentation - */ - latitude: number /**/; - /** - * - * @see longitude Documentation - */ - longitude: number /**/; -}; + + + import { Message } from './message.js';import { QuickReply } from './quickReply.js';import { Sender } from './sender.js'; + + +import { MessageBase } from './models.js'; + + +export type LocationMessage = MessageBase & { +type: "location", + /** + * + * @see title Documentation + */ + 'title': string/**/; + /** + * + * @see address Documentation + */ + 'address': string/**/; + /** + * + * @see latitude Documentation + */ + 'latitude': number/**/; + /** + * + * @see longitude Documentation + */ + 'longitude': number/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/markMessagesAsReadRequest.ts b/lib/messaging-api/model/markMessagesAsReadRequest.ts index de556a8f1..d577f04ff 100644 --- a/lib/messaging-api/model/markMessagesAsReadRequest.ts +++ b/lib/messaging-api/model/markMessagesAsReadRequest.ts @@ -10,12 +10,23 @@ * Do not edit the class manually. */ -import { ChatReference } from "./chatReference"; - -export type MarkMessagesAsReadRequest = { - /** - * - * @see chat Documentation - */ - chat: ChatReference /**/; -}; + + + import { ChatReference } from './chatReference.js'; + + +export type MarkMessagesAsReadRequest = { + /** + * + * @see chat Documentation + */ + 'chat': ChatReference/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/membersIdsResponse.ts b/lib/messaging-api/model/membersIdsResponse.ts index f785d4d9d..c3e835884 100644 --- a/lib/messaging-api/model/membersIdsResponse.ts +++ b/lib/messaging-api/model/membersIdsResponse.ts @@ -10,13 +10,26 @@ * Do not edit the class manually. */ -export type MembersIdsResponse = { - /** - * List of user IDs of members in the group chat. Only users of LINE for iOS and LINE for Android are included in `memberIds`. - */ - memberIds: Array /**/; - /** - * A continuation token to get the next array of user IDs of the members in the group chat. Returned only when there are remaining user IDs that were not returned in `memberIds` in the original request. - */ - next?: string /**/; -}; + + + + + +export type MembersIdsResponse = { + /** + * List of user IDs of members in the group chat. Only users of LINE for iOS and LINE for Android are included in `memberIds`. + */ + 'memberIds': Array/**/; + /** + * A continuation token to get the next array of user IDs of the members in the group chat. Returned only when there are remaining user IDs that were not returned in `memberIds` in the original request. + */ + 'next'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/message.ts b/lib/messaging-api/model/message.ts index 55dadd8b3..112ff61ce 100644 --- a/lib/messaging-api/model/message.ts +++ b/lib/messaging-api/model/message.ts @@ -10,50 +10,62 @@ * Do not edit the class manually. */ -import { QuickReply } from "./quickReply"; -import { Sender } from "./sender"; - -import { AudioMessage } from "./models"; -import { FlexMessage } from "./models"; -import { ImageMessage } from "./models"; -import { ImagemapMessage } from "./models"; -import { LocationMessage } from "./models"; -import { StickerMessage } from "./models"; -import { TemplateMessage } from "./models"; -import { TextMessage } from "./models"; -import { VideoMessage } from "./models"; + + + import { QuickReply } from './quickReply.js';import { Sender } from './sender.js'; + + + import { AudioMessage } from './models.js'; + import { FlexMessage } from './models.js'; + import { ImageMessage } from './models.js'; + import { ImagemapMessage } from './models.js'; + import { LocationMessage } from './models.js'; + import { StickerMessage } from './models.js'; + import { TemplateMessage } from './models.js'; + import { TextMessage } from './models.js'; + import { VideoMessage } from './models.js'; + export type Message = - | AudioMessage // audio - | FlexMessage // flex - | ImageMessage // image - | ImagemapMessage // imagemap - | LocationMessage // location - | StickerMessage // sticker - | TemplateMessage // template - | TextMessage // text - | VideoMessage // video - | UnknownMessage; + | AudioMessage // audio + | FlexMessage // flex + | ImageMessage // image + | ImagemapMessage // imagemap + | LocationMessage // location + | StickerMessage // sticker + | TemplateMessage // template + | TextMessage // text + | VideoMessage // video + | UnknownMessage +; export type UnknownMessage = MessageBase & { - [key: string]: unknown; + [key: string]: unknown; }; + +export type MessageBase = { + /** + * Type of message + * + * @see type Documentation + */ + 'type': string/**/; + /** + * + * @see quickReply Documentation + */ + 'quickReply'?: QuickReply/**/; + /** + * + * @see sender Documentation + */ + 'sender'?: Sender/**/; + +} + + + + + + -export type MessageBase = { - /** - * Type of message - * - * @see type Documentation - */ - type: string /**/; - /** - * - * @see quickReply Documentation - */ - quickReply?: QuickReply /**/; - /** - * - * @see sender Documentation - */ - sender?: Sender /**/; -}; diff --git a/lib/messaging-api/model/messageAction.ts b/lib/messaging-api/model/messageAction.ts index 38c907cc8..550f993c1 100644 --- a/lib/messaging-api/model/messageAction.ts +++ b/lib/messaging-api/model/messageAction.ts @@ -10,13 +10,25 @@ * Do not edit the class manually. */ -import { Action } from "./action"; -import { ActionBase } from "./models"; -export type MessageAction = ActionBase & { - type: "message"; - /** - */ - text?: string /**/; -}; + import { Action } from './action.js'; + + +import { ActionBase } from './models.js'; + + +export type MessageAction = ActionBase & { +type: "message", + /** + */ + 'text'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/messageImagemapAction.ts b/lib/messaging-api/model/messageImagemapAction.ts index aa668c3a8..2d7d4cf7a 100644 --- a/lib/messaging-api/model/messageImagemapAction.ts +++ b/lib/messaging-api/model/messageImagemapAction.ts @@ -10,17 +10,28 @@ * Do not edit the class manually. */ -import { ImagemapAction } from "./imagemapAction"; -import { ImagemapArea } from "./imagemapArea"; - -import { ImagemapActionBase } from "./models"; - -export type MessageImagemapAction = ImagemapActionBase & { - type: "message"; - /** - */ - text: string /**/; - /** - */ - label?: string /**/; -}; + + + import { ImagemapAction } from './imagemapAction.js';import { ImagemapArea } from './imagemapArea.js'; + + +import { ImagemapActionBase } from './models.js'; + + +export type MessageImagemapAction = ImagemapActionBase & { +type: "message", + /** + */ + 'text': string/**/; + /** + */ + 'label'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/messageQuotaResponse.ts b/lib/messaging-api/model/messageQuotaResponse.ts index c4e08df9c..976c44503 100644 --- a/lib/messaging-api/model/messageQuotaResponse.ts +++ b/lib/messaging-api/model/messageQuotaResponse.ts @@ -10,20 +10,35 @@ * Do not edit the class manually. */ -import { QuotaType } from "./quotaType"; - -export type MessageQuotaResponse = { - /** - * - * @see type Documentation - */ - type: QuotaType /**/; - /** - * The target limit for sending messages in the current month. This property is returned when the `type` property has a value of `limited`. - * - * @see value Documentation - */ - value?: number /**/; -}; - -export namespace MessageQuotaResponse {} + + + import { QuotaType } from './quotaType.js'; + + +export type MessageQuotaResponse = { + /** + * + * @see type Documentation + */ + 'type': QuotaType/**/; + /** + * The target limit for sending messages in the current month. This property is returned when the `type` property has a value of `limited`. + * + * @see value Documentation + */ + 'value'?: number/**/; + +} + + + +export namespace MessageQuotaResponse { + + + +} + + + + + diff --git a/lib/messaging-api/model/models.ts b/lib/messaging-api/model/models.ts index 6b4a3bc0f..395c0e2cf 100644 --- a/lib/messaging-api/model/models.ts +++ b/lib/messaging-api/model/models.ts @@ -1,144 +1,2 @@ -export * from "./action"; -export * from "./ageDemographic"; -export * from "./ageDemographicFilter"; -export * from "./altUri"; -export * from "./appTypeDemographic"; -export * from "./appTypeDemographicFilter"; -export * from "./areaDemographic"; -export * from "./areaDemographicFilter"; -export * from "./audienceMatchMessagesRequest"; -export * from "./audienceRecipient"; -export * from "./audioMessage"; -export * from "./botInfoResponse"; -export * from "./broadcastRequest"; -export * from "./buttonsTemplate"; -export * from "./cameraAction"; -export * from "./cameraRollAction"; -export * from "./carouselColumn"; -export * from "./carouselTemplate"; -export * from "./chatReference"; -export * from "./clipboardAction"; -export * from "./clipboardImagemapAction"; -export * from "./confirmTemplate"; -export * from "./createRichMenuAliasRequest"; -export * from "./datetimePickerAction"; -export * from "./demographicFilter"; -export * from "./emoji"; -export * from "./errorDetail"; -export * from "./errorResponse"; -export * from "./filter"; -export * from "./flexBlockStyle"; -export * from "./flexBox"; -export * from "./flexBoxBackground"; -export * from "./flexBoxBorderWidth"; -export * from "./flexBoxCornerRadius"; -export * from "./flexBoxLinearGradient"; -export * from "./flexBoxPadding"; -export * from "./flexBoxSpacing"; -export * from "./flexBubble"; -export * from "./flexBubbleStyles"; -export * from "./flexButton"; -export * from "./flexCarousel"; -export * from "./flexComponent"; -export * from "./flexContainer"; -export * from "./flexFiller"; -export * from "./flexIcon"; -export * from "./flexIconSize"; -export * from "./flexImage"; -export * from "./flexImageSize"; -export * from "./flexMargin"; -export * from "./flexMessage"; -export * from "./flexOffset"; -export * from "./flexSeparator"; -export * from "./flexSpan"; -export * from "./flexSpanSize"; -export * from "./flexText"; -export * from "./flexTextFontSize"; -export * from "./flexVideo"; -export * from "./genderDemographic"; -export * from "./genderDemographicFilter"; -export * from "./getAggregationUnitNameListResponse"; -export * from "./getAggregationUnitUsageResponse"; -export * from "./getFollowersResponse"; -export * from "./getMessageContentTranscodingResponse"; -export * from "./getWebhookEndpointResponse"; -export * from "./groupMemberCountResponse"; -export * from "./groupSummaryResponse"; -export * from "./groupUserProfileResponse"; -export * from "./imageCarouselColumn"; -export * from "./imageCarouselTemplate"; -export * from "./imageMessage"; -export * from "./imagemapAction"; -export * from "./imagemapArea"; -export * from "./imagemapBaseSize"; -export * from "./imagemapExternalLink"; -export * from "./imagemapMessage"; -export * from "./imagemapVideo"; -export * from "./issueLinkTokenResponse"; -export * from "./limit"; -export * from "./locationAction"; -export * from "./locationMessage"; -export * from "./markMessagesAsReadRequest"; -export * from "./membersIdsResponse"; -export * from "./message"; -export * from "./messageAction"; -export * from "./messageImagemapAction"; -export * from "./messageQuotaResponse"; -export * from "./multicastRequest"; -export * from "./narrowcastProgressResponse"; -export * from "./narrowcastRequest"; -export * from "./numberOfMessagesResponse"; -export * from "./operatorDemographicFilter"; -export * from "./operatorRecipient"; -export * from "./pnpMessagesRequest"; -export * from "./postbackAction"; -export * from "./pushMessageRequest"; -export * from "./pushMessageResponse"; -export * from "./quickReply"; -export * from "./quickReplyItem"; -export * from "./quotaConsumptionResponse"; -export * from "./quotaType"; -export * from "./recipient"; -export * from "./redeliveryRecipient"; -export * from "./replyMessageRequest"; -export * from "./replyMessageResponse"; -export * from "./richMenuAliasListResponse"; -export * from "./richMenuAliasResponse"; -export * from "./richMenuArea"; -export * from "./richMenuBatchLinkOperation"; -export * from "./richMenuBatchOperation"; -export * from "./richMenuBatchProgressPhase"; -export * from "./richMenuBatchProgressResponse"; -export * from "./richMenuBatchRequest"; -export * from "./richMenuBatchUnlinkAllOperation"; -export * from "./richMenuBatchUnlinkOperation"; -export * from "./richMenuBounds"; -export * from "./richMenuBulkLinkRequest"; -export * from "./richMenuBulkUnlinkRequest"; -export * from "./richMenuIdResponse"; -export * from "./richMenuListResponse"; -export * from "./richMenuRequest"; -export * from "./richMenuResponse"; -export * from "./richMenuSize"; -export * from "./richMenuSwitchAction"; -export * from "./roomMemberCountResponse"; -export * from "./roomUserProfileResponse"; -export * from "./sender"; -export * from "./sentMessage"; -export * from "./setWebhookEndpointRequest"; -export * from "./stickerMessage"; -export * from "./subscriptionPeriodDemographic"; -export * from "./subscriptionPeriodDemographicFilter"; -export * from "./template"; -export * from "./templateImageAspectRatio"; -export * from "./templateImageSize"; -export * from "./templateMessage"; -export * from "./testWebhookEndpointRequest"; -export * from "./testWebhookEndpointResponse"; -export * from "./textMessage"; -export * from "./uRIAction"; -export * from "./uRIImagemapAction"; -export * from "./updateRichMenuAliasRequest"; -export * from "./userProfileResponse"; -export * from "./validateMessageRequest"; -export * from "./videoMessage"; + +export * from './action.js';export * from './ageDemographic.js';export * from './ageDemographicFilter.js';export * from './altUri.js';export * from './appTypeDemographic.js';export * from './appTypeDemographicFilter.js';export * from './areaDemographic.js';export * from './areaDemographicFilter.js';export * from './audienceMatchMessagesRequest.js';export * from './audienceRecipient.js';export * from './audioMessage.js';export * from './botInfoResponse.js';export * from './broadcastRequest.js';export * from './buttonsTemplate.js';export * from './cameraAction.js';export * from './cameraRollAction.js';export * from './carouselColumn.js';export * from './carouselTemplate.js';export * from './chatReference.js';export * from './clipboardAction.js';export * from './clipboardImagemapAction.js';export * from './confirmTemplate.js';export * from './createRichMenuAliasRequest.js';export * from './datetimePickerAction.js';export * from './demographicFilter.js';export * from './emoji.js';export * from './errorDetail.js';export * from './errorResponse.js';export * from './filter.js';export * from './flexBlockStyle.js';export * from './flexBox.js';export * from './flexBoxBackground.js';export * from './flexBoxBorderWidth.js';export * from './flexBoxCornerRadius.js';export * from './flexBoxLinearGradient.js';export * from './flexBoxPadding.js';export * from './flexBoxSpacing.js';export * from './flexBubble.js';export * from './flexBubbleStyles.js';export * from './flexButton.js';export * from './flexCarousel.js';export * from './flexComponent.js';export * from './flexContainer.js';export * from './flexFiller.js';export * from './flexIcon.js';export * from './flexIconSize.js';export * from './flexImage.js';export * from './flexImageSize.js';export * from './flexMargin.js';export * from './flexMessage.js';export * from './flexOffset.js';export * from './flexSeparator.js';export * from './flexSpan.js';export * from './flexSpanSize.js';export * from './flexText.js';export * from './flexTextFontSize.js';export * from './flexVideo.js';export * from './genderDemographic.js';export * from './genderDemographicFilter.js';export * from './getAggregationUnitNameListResponse.js';export * from './getAggregationUnitUsageResponse.js';export * from './getFollowersResponse.js';export * from './getMessageContentTranscodingResponse.js';export * from './getWebhookEndpointResponse.js';export * from './groupMemberCountResponse.js';export * from './groupSummaryResponse.js';export * from './groupUserProfileResponse.js';export * from './imageCarouselColumn.js';export * from './imageCarouselTemplate.js';export * from './imageMessage.js';export * from './imagemapAction.js';export * from './imagemapArea.js';export * from './imagemapBaseSize.js';export * from './imagemapExternalLink.js';export * from './imagemapMessage.js';export * from './imagemapVideo.js';export * from './issueLinkTokenResponse.js';export * from './limit.js';export * from './locationAction.js';export * from './locationMessage.js';export * from './markMessagesAsReadRequest.js';export * from './membersIdsResponse.js';export * from './message.js';export * from './messageAction.js';export * from './messageImagemapAction.js';export * from './messageQuotaResponse.js';export * from './multicastRequest.js';export * from './narrowcastProgressResponse.js';export * from './narrowcastRequest.js';export * from './numberOfMessagesResponse.js';export * from './operatorDemographicFilter.js';export * from './operatorRecipient.js';export * from './pnpMessagesRequest.js';export * from './postbackAction.js';export * from './pushMessageRequest.js';export * from './pushMessageResponse.js';export * from './quickReply.js';export * from './quickReplyItem.js';export * from './quotaConsumptionResponse.js';export * from './quotaType.js';export * from './recipient.js';export * from './redeliveryRecipient.js';export * from './replyMessageRequest.js';export * from './replyMessageResponse.js';export * from './richMenuAliasListResponse.js';export * from './richMenuAliasResponse.js';export * from './richMenuArea.js';export * from './richMenuBatchLinkOperation.js';export * from './richMenuBatchOperation.js';export * from './richMenuBatchProgressPhase.js';export * from './richMenuBatchProgressResponse.js';export * from './richMenuBatchRequest.js';export * from './richMenuBatchUnlinkAllOperation.js';export * from './richMenuBatchUnlinkOperation.js';export * from './richMenuBounds.js';export * from './richMenuBulkLinkRequest.js';export * from './richMenuBulkUnlinkRequest.js';export * from './richMenuIdResponse.js';export * from './richMenuListResponse.js';export * from './richMenuRequest.js';export * from './richMenuResponse.js';export * from './richMenuSize.js';export * from './richMenuSwitchAction.js';export * from './roomMemberCountResponse.js';export * from './roomUserProfileResponse.js';export * from './sender.js';export * from './sentMessage.js';export * from './setWebhookEndpointRequest.js';export * from './stickerMessage.js';export * from './subscriptionPeriodDemographic.js';export * from './subscriptionPeriodDemographicFilter.js';export * from './template.js';export * from './templateImageAspectRatio.js';export * from './templateImageSize.js';export * from './templateMessage.js';export * from './testWebhookEndpointRequest.js';export * from './testWebhookEndpointResponse.js';export * from './textMessage.js';export * from './uRIAction.js';export * from './uRIImagemapAction.js';export * from './updateRichMenuAliasRequest.js';export * from './userProfileResponse.js';export * from './validateMessageRequest.js';export * from './videoMessage.js'; diff --git a/lib/messaging-api/model/multicastRequest.ts b/lib/messaging-api/model/multicastRequest.ts index c09a695c9..6743dbc33 100644 --- a/lib/messaging-api/model/multicastRequest.ts +++ b/lib/messaging-api/model/multicastRequest.ts @@ -10,31 +10,42 @@ * Do not edit the class manually. */ -import { Message } from "./message"; - -export type MulticastRequest = { - /** - * Messages to send - * - * @see messages Documentation - */ - messages: Array /**/; - /** - * Array of user IDs. Use userId values which are returned in webhook event objects. Do not use LINE IDs found on LINE. - * - * @see to Documentation - */ - to: Array /**/; - /** - * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. - * - * @see notificationDisabled Documentation - */ - notificationDisabled?: boolean /* = false*/; - /** - * Name of aggregation unit. Case-sensitive. - * - * @see customAggregationUnits Documentation - */ - customAggregationUnits?: Array /**/; -}; + + + import { Message } from './message.js'; + + +export type MulticastRequest = { + /** + * Messages to send + * + * @see messages Documentation + */ + 'messages': Array/**/; + /** + * Array of user IDs. Use userId values which are returned in webhook event objects. Do not use LINE IDs found on LINE. + * + * @see to Documentation + */ + 'to': Array/**/; + /** + * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. + * + * @see notificationDisabled Documentation + */ + 'notificationDisabled'?: boolean/* = false*/; + /** + * Name of aggregation unit. Case-sensitive. + * + * @see customAggregationUnits Documentation + */ + 'customAggregationUnits'?: Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/narrowcastProgressResponse.ts b/lib/messaging-api/model/narrowcastProgressResponse.ts index e9b162ffb..a79c6c0f0 100644 --- a/lib/messaging-api/model/narrowcastProgressResponse.ts +++ b/lib/messaging-api/model/narrowcastProgressResponse.ts @@ -10,57 +10,86 @@ * Do not edit the class manually. */ -export type NarrowcastProgressResponse = { - /** - * The current status. One of: `waiting`: Messages are not yet ready to be sent. They are currently being filtered or processed in some way. `sending`: Messages are currently being sent. `succeeded`: Messages were sent successfully. This may not mean the messages were successfully received. `failed`: Messages failed to be sent. Use the failedDescription property to find the cause of the failure. - * - * @see phase Documentation - */ - phase: NarrowcastProgressResponse.PhaseEnum /**/; - /** - * The number of users who successfully received the message. - * - * @see successCount Documentation - */ - successCount?: number /**/; - /** - * The number of users who failed to send the message. - * - * @see failureCount Documentation - */ - failureCount?: number /**/; - /** - * The number of intended recipients of the message. - * - * @see targetCount Documentation - */ - targetCount?: number /**/; - /** - * The reason the message failed to be sent. This is only included with a `phase` property value of `failed`. - * - * @see failedDescription Documentation - */ - failedDescription?: string /**/; - /** - * Error summary. This is only included with a phase property value of failed. One of: `1`: An internal error occurred. `2`: An error occurred because there weren\'t enough recipients. `3`: A conflict error of requests occurs because a request that has already been accepted is retried. - * - * @see errorCode Documentation - */ - errorCode?: number /**/; - /** - * Narrowcast message request accepted time in milliseconds. Format: ISO 8601 (e.g. 2020-12-03T10:15:30.121Z) Timezone: UTC - * - * @see acceptedTime Documentation - */ - acceptedTime: Date /**/; - /** - * Processing of narrowcast message request completion time in milliseconds. Returned when the phase property is succeeded or failed. Format: ISO 8601 (e.g. 2020-12-03T10:15:30.121Z) Timezone: UTC - * - * @see completedTime Documentation - */ - completedTime?: Date /**/; -}; + + + + +export type NarrowcastProgressResponse = { + /** + * The current status. One of: `waiting`: Messages are not yet ready to be sent. They are currently being filtered or processed in some way. `sending`: Messages are currently being sent. `succeeded`: Messages were sent successfully. This may not mean the messages were successfully received. `failed`: Messages failed to be sent. Use the failedDescription property to find the cause of the failure. + * + * @see phase Documentation + */ + 'phase': NarrowcastProgressResponse.PhaseEnum/**/; + /** + * The number of users who successfully received the message. + * + * @see successCount Documentation + */ + 'successCount'?: number/**/; + /** + * The number of users who failed to send the message. + * + * @see failureCount Documentation + */ + 'failureCount'?: number/**/; + /** + * The number of intended recipients of the message. + * + * @see targetCount Documentation + */ + 'targetCount'?: number/**/; + /** + * The reason the message failed to be sent. This is only included with a `phase` property value of `failed`. + * + * @see failedDescription Documentation + */ + 'failedDescription'?: string/**/; + /** + * Error summary. This is only included with a phase property value of failed. One of: `1`: An internal error occurred. `2`: An error occurred because there weren\'t enough recipients. `3`: A conflict error of requests occurs because a request that has already been accepted is retried. + * + * @see errorCode Documentation + */ + 'errorCode'?: number/**/; + /** + * Narrowcast message request accepted time in milliseconds. Format: ISO 8601 (e.g. 2020-12-03T10:15:30.121Z) Timezone: UTC + * + * @see acceptedTime Documentation + */ + 'acceptedTime': Date/**/; + /** + * Processing of narrowcast message request completion time in milliseconds. Returned when the phase property is succeeded or failed. Format: ISO 8601 (e.g. 2020-12-03T10:15:30.121Z) Timezone: UTC + * + * @see completedTime Documentation + */ + 'completedTime'?: Date/**/; + +} + + + export namespace NarrowcastProgressResponse { - export type PhaseEnum = "waiting" | "sending" | "succeeded" | "failed"; + export type PhaseEnum = + 'waiting' + | 'sending' + | 'succeeded' + | 'failed' + + + ; + + + + + + + + + } + + + + + diff --git a/lib/messaging-api/model/narrowcastRequest.ts b/lib/messaging-api/model/narrowcastRequest.ts index 6bca5f02d..44d356ae2 100644 --- a/lib/messaging-api/model/narrowcastRequest.ts +++ b/lib/messaging-api/model/narrowcastRequest.ts @@ -10,37 +10,45 @@ * Do not edit the class manually. */ -import { Filter } from "./filter"; -import { Limit } from "./limit"; -import { Message } from "./message"; -import { Recipient } from "./recipient"; - -export type NarrowcastRequest = { - /** - * List of Message objects. - * - * @see messages Documentation - */ - messages: Array /**/; - /** - * - * @see recipient Documentation - */ - recipient?: Recipient /**/; - /** - * - * @see filter Documentation - */ - filter?: Filter /**/; - /** - * - * @see limit Documentation - */ - limit?: Limit /**/; - /** - * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. - * - * @see notificationDisabled Documentation - */ - notificationDisabled?: boolean /* = false*/; -}; + + + import { Filter } from './filter.js';import { Limit } from './limit.js';import { Message } from './message.js';import { Recipient } from './recipient.js'; + + +export type NarrowcastRequest = { + /** + * List of Message objects. + * + * @see messages Documentation + */ + 'messages': Array/**/; + /** + * + * @see recipient Documentation + */ + 'recipient'?: Recipient/**/; + /** + * + * @see filter Documentation + */ + 'filter'?: Filter/**/; + /** + * + * @see limit Documentation + */ + 'limit'?: Limit/**/; + /** + * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. + * + * @see notificationDisabled Documentation + */ + 'notificationDisabled'?: boolean/* = false*/; + +} + + + + + + + diff --git a/lib/messaging-api/model/numberOfMessagesResponse.ts b/lib/messaging-api/model/numberOfMessagesResponse.ts index f54f3b915..57d6f9050 100644 --- a/lib/messaging-api/model/numberOfMessagesResponse.ts +++ b/lib/messaging-api/model/numberOfMessagesResponse.ts @@ -10,21 +10,40 @@ * Do not edit the class manually. */ -export type NumberOfMessagesResponse = { - /** - * Aggregation process status. One of: `ready`: The number of messages can be obtained. `unready`: We haven\'t finished calculating the number of sent messages for the specified in date. For example, this property is returned when the delivery date or a future date is specified. Calculation usually takes about a day. `unavailable_for_privacy`: The total number of messages on the specified day is less than 20. `out_of_service`: The specified date is earlier than the date on which we first started calculating sent messages (March 31, 2018). - */ - status: NumberOfMessagesResponse.StatusEnum /**/; - /** - * The number of messages delivered using the phone number on the date specified in `date`. The response has this property only when the value of `status` is `ready`. - */ - success?: number /**/; -}; + + + + +export type NumberOfMessagesResponse = { + /** + * Aggregation process status. One of: `ready`: The number of messages can be obtained. `unready`: We haven\'t finished calculating the number of sent messages for the specified in date. For example, this property is returned when the delivery date or a future date is specified. Calculation usually takes about a day. `unavailable_for_privacy`: The total number of messages on the specified day is less than 20. `out_of_service`: The specified date is earlier than the date on which we first started calculating sent messages (March 31, 2018). + */ + 'status': NumberOfMessagesResponse.StatusEnum/**/; + /** + * The number of messages delivered using the phone number on the date specified in `date`. The response has this property only when the value of `status` is `ready`. + */ + 'success'?: number/**/; + +} + + + export namespace NumberOfMessagesResponse { - export type StatusEnum = - | "ready" - | "unready" - | "unavailable_for_privacy" - | "out_of_service"; + export type StatusEnum = + 'ready' + | 'unready' + | 'unavailable_for_privacy' + | 'out_of_service' + + + ; + + + } + + + + + diff --git a/lib/messaging-api/model/operatorDemographicFilter.ts b/lib/messaging-api/model/operatorDemographicFilter.ts index 48bf6121a..416972925 100644 --- a/lib/messaging-api/model/operatorDemographicFilter.ts +++ b/lib/messaging-api/model/operatorDemographicFilter.ts @@ -10,19 +10,31 @@ * Do not edit the class manually. */ -import { DemographicFilter } from "./demographicFilter"; - -import { DemographicFilterBase } from "./models"; - -export type OperatorDemographicFilter = DemographicFilterBase & { - type: "operator"; - /** - */ - and?: Array /**/; - /** - */ - or?: Array /**/; - /** - */ - not?: DemographicFilter /**/; -}; + + + import { DemographicFilter } from './demographicFilter.js'; + + +import { DemographicFilterBase } from './models.js'; + + +export type OperatorDemographicFilter = DemographicFilterBase & { +type: "operator", + /** + */ + 'and'?: Array/**/; + /** + */ + 'or'?: Array/**/; + /** + */ + 'not'?: DemographicFilter/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/operatorRecipient.ts b/lib/messaging-api/model/operatorRecipient.ts index 0e3db9c8b..9cadf408d 100644 --- a/lib/messaging-api/model/operatorRecipient.ts +++ b/lib/messaging-api/model/operatorRecipient.ts @@ -10,21 +10,33 @@ * Do not edit the class manually. */ -import { Recipient } from "./recipient"; - -import { RecipientBase } from "./models"; - -export type OperatorRecipient = RecipientBase & { - type: "operator"; - /** - * Create a new recipient object by taking the logical conjunction (AND) of the specified array of recipient objects. - */ - and?: Array /**/; - /** - * Create a new recipient object by taking the logical disjunction (OR) of the specified array of recipient objects. - */ - or?: Array /**/; - /** - */ - not?: Recipient /**/; -}; + + + import { Recipient } from './recipient.js'; + + +import { RecipientBase } from './models.js'; + + +export type OperatorRecipient = RecipientBase & { +type: "operator", + /** + * Create a new recipient object by taking the logical conjunction (AND) of the specified array of recipient objects. + */ + 'and'?: Array/**/; + /** + * Create a new recipient object by taking the logical disjunction (OR) of the specified array of recipient objects. + */ + 'or'?: Array/**/; + /** + */ + 'not'?: Recipient/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/pnpMessagesRequest.ts b/lib/messaging-api/model/pnpMessagesRequest.ts index da6e5c4c7..b6c67b2e5 100644 --- a/lib/messaging-api/model/pnpMessagesRequest.ts +++ b/lib/messaging-api/model/pnpMessagesRequest.ts @@ -10,25 +10,36 @@ * Do not edit the class manually. */ -import { Message } from "./message"; - -export type PnpMessagesRequest = { - /** - * Message to be sent. - * - * @see messages Documentation - */ - messages: Array /**/; - /** - * Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256. - * - * @see to Documentation - */ - to: string /**/; - /** - * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. - * - * @see notificationDisabled Documentation - */ - notificationDisabled?: boolean /* = false*/; -}; + + + import { Message } from './message.js'; + + +export type PnpMessagesRequest = { + /** + * Message to be sent. + * + * @see messages Documentation + */ + 'messages': Array/**/; + /** + * Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256. + * + * @see to Documentation + */ + 'to': string/**/; + /** + * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. + * + * @see notificationDisabled Documentation + */ + 'notificationDisabled'?: boolean/* = false*/; + +} + + + + + + + diff --git a/lib/messaging-api/model/postbackAction.ts b/lib/messaging-api/model/postbackAction.ts index 0cd73cdbe..9e5923609 100644 --- a/lib/messaging-api/model/postbackAction.ts +++ b/lib/messaging-api/model/postbackAction.ts @@ -10,33 +10,54 @@ * Do not edit the class manually. */ -import { Action } from "./action"; - -import { ActionBase } from "./models"; - -export type PostbackAction = ActionBase & { - type: "postback"; - /** - */ - data?: string /**/; - /** - */ - displayText?: string /**/; - /** - */ - text?: string /**/; - /** - */ - inputOption?: PostbackAction.InputOptionEnum /**/; - /** - */ - fillInText?: string /**/; -}; + + import { Action } from './action.js'; + + +import { ActionBase } from './models.js'; + + +export type PostbackAction = ActionBase & { +type: "postback", + /** + */ + 'data'?: string/**/; + /** + */ + 'displayText'?: string/**/; + /** + */ + 'text'?: string/**/; + /** + */ + 'inputOption'?: PostbackAction.InputOptionEnum/**/; + /** + */ + 'fillInText'?: string/**/; + +} + + + export namespace PostbackAction { - export type InputOptionEnum = - | "closeRichMenu" - | "openRichMenu" - | "openKeyboard" - | "openVoice"; + + + + export type InputOptionEnum = + 'closeRichMenu' + | 'openRichMenu' + | 'openKeyboard' + | 'openVoice' + + + ; + + + } + + + + + diff --git a/lib/messaging-api/model/pushMessageRequest.ts b/lib/messaging-api/model/pushMessageRequest.ts index 2c9a64d45..82dd8ba49 100644 --- a/lib/messaging-api/model/pushMessageRequest.ts +++ b/lib/messaging-api/model/pushMessageRequest.ts @@ -10,31 +10,42 @@ * Do not edit the class manually. */ -import { Message } from "./message"; - -export type PushMessageRequest = { - /** - * ID of the receiver. - * - * @see to Documentation - */ - to: string /**/; - /** - * List of Message objects. - * - * @see messages Documentation - */ - messages: Array /**/; - /** - * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. - * - * @see notificationDisabled Documentation - */ - notificationDisabled?: boolean /* = false*/; - /** - * List of aggregation unit name. Case-sensitive. This functions can only be used by corporate users who have submitted the required applications. - * - * @see customAggregationUnits Documentation - */ - customAggregationUnits?: Array /**/; -}; + + + import { Message } from './message.js'; + + +export type PushMessageRequest = { + /** + * ID of the receiver. + * + * @see to Documentation + */ + 'to': string/**/; + /** + * List of Message objects. + * + * @see messages Documentation + */ + 'messages': Array/**/; + /** + * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. + * + * @see notificationDisabled Documentation + */ + 'notificationDisabled'?: boolean/* = false*/; + /** + * List of aggregation unit name. Case-sensitive. This functions can only be used by corporate users who have submitted the required applications. + * + * @see customAggregationUnits Documentation + */ + 'customAggregationUnits'?: Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/pushMessageResponse.ts b/lib/messaging-api/model/pushMessageResponse.ts index 3e9769cae..636325757 100644 --- a/lib/messaging-api/model/pushMessageResponse.ts +++ b/lib/messaging-api/model/pushMessageResponse.ts @@ -10,13 +10,24 @@ * Do not edit the class manually. */ -import { SentMessage } from "./sentMessage"; - -export type PushMessageResponse = { - /** - * Array of sent messages. - * - * @see sentMessages Documentation - */ - sentMessages: Array /**/; -}; + + + import { SentMessage } from './sentMessage.js'; + + +export type PushMessageResponse = { + /** + * Array of sent messages. + * + * @see sentMessages Documentation + */ + 'sentMessages': Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/quickReply.ts b/lib/messaging-api/model/quickReply.ts index 3b48a0c70..0ff99ffca 100644 --- a/lib/messaging-api/model/quickReply.ts +++ b/lib/messaging-api/model/quickReply.ts @@ -10,16 +10,27 @@ * Do not edit the class manually. */ -import { QuickReplyItem } from "./quickReplyItem"; + + import { QuickReplyItem } from './quickReplyItem.js'; + + /** * Quick reply */ -export type QuickReply = { - /** - * Quick reply button objects. - * - * @see items Documentation - */ - items?: Array /**/; -}; +export type QuickReply = { + /** + * Quick reply button objects. + * + * @see items Documentation + */ + 'items'?: Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/quickReplyItem.ts b/lib/messaging-api/model/quickReplyItem.ts index a4e593aa5..2806924ea 100644 --- a/lib/messaging-api/model/quickReplyItem.ts +++ b/lib/messaging-api/model/quickReplyItem.ts @@ -10,24 +10,35 @@ * Do not edit the class manually. */ -import { Action } from "./action"; - -export type QuickReplyItem = { - /** - * URL of the icon that is displayed at the beginning of the button - * - * @see imageUrl Documentation - */ - imageUrl?: string /**/; - /** - * - * @see action Documentation - */ - action?: Action /**/; - /** - * `action` - * - * @see type Documentation - */ - type?: string /* = 'action'*/; -}; + + + import { Action } from './action.js'; + + +export type QuickReplyItem = { + /** + * URL of the icon that is displayed at the beginning of the button + * + * @see imageUrl Documentation + */ + 'imageUrl'?: string/**/; + /** + * + * @see action Documentation + */ + 'action'?: Action/**/; + /** + * `action` + * + * @see type Documentation + */ + 'type'?: string/* = 'action'*/; + +} + + + + + + + diff --git a/lib/messaging-api/model/quotaConsumptionResponse.ts b/lib/messaging-api/model/quotaConsumptionResponse.ts index 9b61b9cb4..c595b618b 100644 --- a/lib/messaging-api/model/quotaConsumptionResponse.ts +++ b/lib/messaging-api/model/quotaConsumptionResponse.ts @@ -10,11 +10,24 @@ * Do not edit the class manually. */ -export type QuotaConsumptionResponse = { - /** - * The number of sent messages in the current month - * - * @see totalUsage Documentation - */ - totalUsage: number /**/; -}; + + + + + +export type QuotaConsumptionResponse = { + /** + * The number of sent messages in the current month + * + * @see totalUsage Documentation + */ + 'totalUsage': number/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/quotaType.ts b/lib/messaging-api/model/quotaType.ts index b37203198..317f8c837 100644 --- a/lib/messaging-api/model/quotaType.ts +++ b/lib/messaging-api/model/quotaType.ts @@ -10,8 +10,22 @@ * Do not edit the class manually. */ + + + + + /** * One of the following values to indicate whether a target limit is set or not. */ -export type QuotaType = "none" | "limited"; + + + export type QuotaType = + 'none' + | 'limited' + +; + + + diff --git a/lib/messaging-api/model/recipient.ts b/lib/messaging-api/model/recipient.ts index 9d9b9bb6c..254b55ead 100644 --- a/lib/messaging-api/model/recipient.ts +++ b/lib/messaging-api/model/recipient.ts @@ -10,26 +10,41 @@ * Do not edit the class manually. */ -import { AudienceRecipient } from "./models"; -import { OperatorRecipient } from "./models"; -import { RedeliveryRecipient } from "./models"; + + + + + + import { AudienceRecipient } from './models.js'; + import { OperatorRecipient } from './models.js'; + import { RedeliveryRecipient } from './models.js'; + export type Recipient = - | AudienceRecipient // audience - | OperatorRecipient // operator - | RedeliveryRecipient // redelivery - | UnknownRecipient; + | AudienceRecipient // audience + | OperatorRecipient // operator + | RedeliveryRecipient // redelivery + | UnknownRecipient +; export type UnknownRecipient = RecipientBase & { - [key: string]: unknown; + [key: string]: unknown; }; - + /** * Recipient */ -export type RecipientBase = { - /** - * Type of recipient - */ - type?: string /**/; -}; +export type RecipientBase = { + /** + * Type of recipient + */ + 'type'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/redeliveryRecipient.ts b/lib/messaging-api/model/redeliveryRecipient.ts index 009b442ae..45c1d8794 100644 --- a/lib/messaging-api/model/redeliveryRecipient.ts +++ b/lib/messaging-api/model/redeliveryRecipient.ts @@ -10,13 +10,25 @@ * Do not edit the class manually. */ -import { Recipient } from "./recipient"; -import { RecipientBase } from "./models"; -export type RedeliveryRecipient = RecipientBase & { - type: "redelivery"; - /** - */ - requestId?: string /**/; -}; + import { Recipient } from './recipient.js'; + + +import { RecipientBase } from './models.js'; + + +export type RedeliveryRecipient = RecipientBase & { +type: "redelivery", + /** + */ + 'requestId'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/replyMessageRequest.ts b/lib/messaging-api/model/replyMessageRequest.ts index 83a97f5d2..f69c7a051 100644 --- a/lib/messaging-api/model/replyMessageRequest.ts +++ b/lib/messaging-api/model/replyMessageRequest.ts @@ -10,25 +10,36 @@ * Do not edit the class manually. */ -import { Message } from "./message"; - -export type ReplyMessageRequest = { - /** - * replyToken received via webhook. - * - * @see replyToken Documentation - */ - replyToken: string /**/; - /** - * List of messages. - * - * @see messages Documentation - */ - messages: Array /**/; - /** - * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. - * - * @see notificationDisabled Documentation - */ - notificationDisabled?: boolean /* = false*/; -}; + + + import { Message } from './message.js'; + + +export type ReplyMessageRequest = { + /** + * replyToken received via webhook. + * + * @see replyToken Documentation + */ + 'replyToken': string/**/; + /** + * List of messages. + * + * @see messages Documentation + */ + 'messages': Array/**/; + /** + * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. + * + * @see notificationDisabled Documentation + */ + 'notificationDisabled'?: boolean/* = false*/; + +} + + + + + + + diff --git a/lib/messaging-api/model/replyMessageResponse.ts b/lib/messaging-api/model/replyMessageResponse.ts index 37d6cbfce..d88a895e5 100644 --- a/lib/messaging-api/model/replyMessageResponse.ts +++ b/lib/messaging-api/model/replyMessageResponse.ts @@ -10,13 +10,24 @@ * Do not edit the class manually. */ -import { SentMessage } from "./sentMessage"; - -export type ReplyMessageResponse = { - /** - * Array of sent messages. - * - * @see sentMessages Documentation - */ - sentMessages: Array /**/; -}; + + + import { SentMessage } from './sentMessage.js'; + + +export type ReplyMessageResponse = { + /** + * Array of sent messages. + * + * @see sentMessages Documentation + */ + 'sentMessages': Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuAliasListResponse.ts b/lib/messaging-api/model/richMenuAliasListResponse.ts index bf42acbb9..4e564fddc 100644 --- a/lib/messaging-api/model/richMenuAliasListResponse.ts +++ b/lib/messaging-api/model/richMenuAliasListResponse.ts @@ -10,13 +10,24 @@ * Do not edit the class manually. */ -import { RichMenuAliasResponse } from "./richMenuAliasResponse"; - -export type RichMenuAliasListResponse = { - /** - * Rich menu aliases. - * - * @see aliases Documentation - */ - aliases: Array /**/; -}; + + + import { RichMenuAliasResponse } from './richMenuAliasResponse.js'; + + +export type RichMenuAliasListResponse = { + /** + * Rich menu aliases. + * + * @see aliases Documentation + */ + 'aliases': Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuAliasResponse.ts b/lib/messaging-api/model/richMenuAliasResponse.ts index 6e88a1f42..5793f901e 100644 --- a/lib/messaging-api/model/richMenuAliasResponse.ts +++ b/lib/messaging-api/model/richMenuAliasResponse.ts @@ -10,13 +10,26 @@ * Do not edit the class manually. */ -export type RichMenuAliasResponse = { - /** - * Rich menu alias ID. - */ - richMenuAliasId: string /**/; - /** - * The rich menu ID associated with the rich menu alias. - */ - richMenuId: string /**/; -}; + + + + + +export type RichMenuAliasResponse = { + /** + * Rich menu alias ID. + */ + 'richMenuAliasId': string/**/; + /** + * The rich menu ID associated with the rich menu alias. + */ + 'richMenuId': string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuArea.ts b/lib/messaging-api/model/richMenuArea.ts index d1a0a06b1..5446bf64b 100644 --- a/lib/messaging-api/model/richMenuArea.ts +++ b/lib/messaging-api/model/richMenuArea.ts @@ -10,17 +10,27 @@ * Do not edit the class manually. */ -import { Action } from "./action"; -import { RichMenuBounds } from "./richMenuBounds"; + + import { Action } from './action.js';import { RichMenuBounds } from './richMenuBounds.js'; + + /** * Rich menu area */ -export type RichMenuArea = { - /** - */ - bounds?: RichMenuBounds /**/; - /** - */ - action?: Action /**/; -}; +export type RichMenuArea = { + /** + */ + 'bounds'?: RichMenuBounds/**/; + /** + */ + 'action'?: Action/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuBatchLinkOperation.ts b/lib/messaging-api/model/richMenuBatchLinkOperation.ts index cd432fa8c..1b27c4554 100644 --- a/lib/messaging-api/model/richMenuBatchLinkOperation.ts +++ b/lib/messaging-api/model/richMenuBatchLinkOperation.ts @@ -10,19 +10,31 @@ * Do not edit the class manually. */ -import { RichMenuBatchOperation } from "./richMenuBatchOperation"; + + import { RichMenuBatchOperation } from './richMenuBatchOperation.js'; + + /** * Replace the rich menu with the rich menu specified in the `to` property for all users linked to the rich menu specified in the `from` property. */ -import { RichMenuBatchOperationBase } from "./models"; - -export type RichMenuBatchLinkOperation = RichMenuBatchOperationBase & { - type: "link"; - /** - */ - from: string /**/; - /** - */ - to: string /**/; -}; +import { RichMenuBatchOperationBase } from './models.js'; + + +export type RichMenuBatchLinkOperation = RichMenuBatchOperationBase & { +type: "link", + /** + */ + 'from': string/**/; + /** + */ + 'to': string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuBatchOperation.ts b/lib/messaging-api/model/richMenuBatchOperation.ts index 8ca767c29..b9a9b5e9e 100644 --- a/lib/messaging-api/model/richMenuBatchOperation.ts +++ b/lib/messaging-api/model/richMenuBatchOperation.ts @@ -10,28 +10,43 @@ * Do not edit the class manually. */ -import { RichMenuBatchLinkOperation } from "./models"; -import { RichMenuBatchUnlinkOperation } from "./models"; -import { RichMenuBatchUnlinkAllOperation } from "./models"; + + + + + + import { RichMenuBatchLinkOperation } from './models.js'; + import { RichMenuBatchUnlinkOperation } from './models.js'; + import { RichMenuBatchUnlinkAllOperation } from './models.js'; + export type RichMenuBatchOperation = - | RichMenuBatchLinkOperation // link - | RichMenuBatchUnlinkOperation // unlink - | RichMenuBatchUnlinkAllOperation // unlinkAll - | UnknownRichMenuBatchOperation; + | RichMenuBatchLinkOperation // link + | RichMenuBatchUnlinkOperation // unlink + | RichMenuBatchUnlinkAllOperation // unlinkAll + | UnknownRichMenuBatchOperation +; export type UnknownRichMenuBatchOperation = RichMenuBatchOperationBase & { - [key: string]: unknown; + [key: string]: unknown; }; - + /** * Rich menu operation object represents the batch operation to the rich menu linked to the user. */ -export type RichMenuBatchOperationBase = { - /** - * The type of operation to the rich menu linked to the user. One of link, unlink, or unlinkAll. - * - * @see type Documentation - */ - type: string /**/; -}; +export type RichMenuBatchOperationBase = { + /** + * The type of operation to the rich menu linked to the user. One of link, unlink, or unlinkAll. + * + * @see type Documentation + */ + 'type': string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuBatchProgressPhase.ts b/lib/messaging-api/model/richMenuBatchProgressPhase.ts index d204b9947..bcd0938d4 100644 --- a/lib/messaging-api/model/richMenuBatchProgressPhase.ts +++ b/lib/messaging-api/model/richMenuBatchProgressPhase.ts @@ -10,8 +10,23 @@ * Do not edit the class manually. */ + + + + + /** - * The current status. One of: `ongoing`: Rich menu batch control is in progress. `succeeded`: Rich menu batch control is complete. `failed`: Rich menu batch control failed. This means that the rich menu for one or more users couldn\'t be controlled. There may also be users whose operations have been successfully completed. + * The current status. One of: `ongoing`: Rich menu batch control is in progress. `succeeded`: Rich menu batch control is complete. `failed`: Rich menu batch control failed. This means that the rich menu for one or more users couldn\'t be controlled. There may also be users whose operations have been successfully completed. */ -export type RichMenuBatchProgressPhase = "ongoing" | "succeeded" | "failed"; + + + export type RichMenuBatchProgressPhase = + 'ongoing' + | 'succeeded' + | 'failed' + +; + + + diff --git a/lib/messaging-api/model/richMenuBatchProgressResponse.ts b/lib/messaging-api/model/richMenuBatchProgressResponse.ts index 1963bf81e..ea3706848 100644 --- a/lib/messaging-api/model/richMenuBatchProgressResponse.ts +++ b/lib/messaging-api/model/richMenuBatchProgressResponse.ts @@ -10,26 +10,42 @@ * Do not edit the class manually. */ -import { RichMenuBatchProgressPhase } from "./richMenuBatchProgressPhase"; - -export type RichMenuBatchProgressResponse = { - /** - * - * @see phase Documentation - */ - phase: RichMenuBatchProgressPhase /**/; - /** - * The accepted time in milliseconds of the request of batch control the rich menu. Format: ISO 8601 (e.g. 2023-06-08T10:15:30.121Z) Timezone: UTC - * - * @see acceptedTime Documentation - */ - acceptedTime: Date /**/; - /** - * The completed time in milliseconds of rich menu batch control. Returned when the phase property is succeeded or failed. Format: ISO 8601 (e.g. 2023-06-08T10:15:30.121Z) Timezone: UTC - * - * @see completedTime Documentation - */ - completedTime?: Date /**/; -}; - -export namespace RichMenuBatchProgressResponse {} + + + import { RichMenuBatchProgressPhase } from './richMenuBatchProgressPhase.js'; + + +export type RichMenuBatchProgressResponse = { + /** + * + * @see phase Documentation + */ + 'phase': RichMenuBatchProgressPhase/**/; + /** + * The accepted time in milliseconds of the request of batch control the rich menu. Format: ISO 8601 (e.g. 2023-06-08T10:15:30.121Z) Timezone: UTC + * + * @see acceptedTime Documentation + */ + 'acceptedTime': Date/**/; + /** + * The completed time in milliseconds of rich menu batch control. Returned when the phase property is succeeded or failed. Format: ISO 8601 (e.g. 2023-06-08T10:15:30.121Z) Timezone: UTC + * + * @see completedTime Documentation + */ + 'completedTime'?: Date/**/; + +} + + + +export namespace RichMenuBatchProgressResponse { + + + + +} + + + + + diff --git a/lib/messaging-api/model/richMenuBatchRequest.ts b/lib/messaging-api/model/richMenuBatchRequest.ts index 946b83545..03143ce4e 100644 --- a/lib/messaging-api/model/richMenuBatchRequest.ts +++ b/lib/messaging-api/model/richMenuBatchRequest.ts @@ -10,15 +10,26 @@ * Do not edit the class manually. */ -import { RichMenuBatchOperation } from "./richMenuBatchOperation"; - -export type RichMenuBatchRequest = { - /** - * Array of Rich menu operation object... - */ - operations: Array /**/; - /** - * Key for retry. Key value is a string matching the regular expression pattern - */ - resumeRequestKey?: string /**/; -}; + + + import { RichMenuBatchOperation } from './richMenuBatchOperation.js'; + + +export type RichMenuBatchRequest = { + /** + * Array of Rich menu operation object... + */ + 'operations': Array/**/; + /** + * Key for retry. Key value is a string matching the regular expression pattern + */ + 'resumeRequestKey'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuBatchUnlinkAllOperation.ts b/lib/messaging-api/model/richMenuBatchUnlinkAllOperation.ts index 332608860..37cba2f8b 100644 --- a/lib/messaging-api/model/richMenuBatchUnlinkAllOperation.ts +++ b/lib/messaging-api/model/richMenuBatchUnlinkAllOperation.ts @@ -10,13 +10,25 @@ * Do not edit the class manually. */ -import { RichMenuBatchOperation } from "./richMenuBatchOperation"; + + import { RichMenuBatchOperation } from './richMenuBatchOperation.js'; + + /** * Unlink the rich menu from all users linked to the rich menu. */ -import { RichMenuBatchOperationBase } from "./models"; +import { RichMenuBatchOperationBase } from './models.js'; + + +export type RichMenuBatchUnlinkAllOperation = RichMenuBatchOperationBase & { +type: "unlinkAll", + +} + + + + + + -export type RichMenuBatchUnlinkAllOperation = RichMenuBatchOperationBase & { - type: "unlinkAll"; -}; diff --git a/lib/messaging-api/model/richMenuBatchUnlinkOperation.ts b/lib/messaging-api/model/richMenuBatchUnlinkOperation.ts index 36201f143..e93858798 100644 --- a/lib/messaging-api/model/richMenuBatchUnlinkOperation.ts +++ b/lib/messaging-api/model/richMenuBatchUnlinkOperation.ts @@ -10,16 +10,28 @@ * Do not edit the class manually. */ -import { RichMenuBatchOperation } from "./richMenuBatchOperation"; + + import { RichMenuBatchOperation } from './richMenuBatchOperation.js'; + + /** * Unlink the rich menu for all users linked to the rich menu specified in the `from` property. */ -import { RichMenuBatchOperationBase } from "./models"; - -export type RichMenuBatchUnlinkOperation = RichMenuBatchOperationBase & { - type: "unlink"; - /** - */ - from: string /**/; -}; +import { RichMenuBatchOperationBase } from './models.js'; + + +export type RichMenuBatchUnlinkOperation = RichMenuBatchOperationBase & { +type: "unlink", + /** + */ + 'from': string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuBounds.ts b/lib/messaging-api/model/richMenuBounds.ts index 97e290633..4e44e8b12 100644 --- a/lib/messaging-api/model/richMenuBounds.ts +++ b/lib/messaging-api/model/richMenuBounds.ts @@ -10,32 +10,45 @@ * Do not edit the class manually. */ + + + + + /** * Rich menu bounds */ -export type RichMenuBounds = { - /** - * Horizontal position relative to the top-left corner of the area. - * - * @see x Documentation - */ - x?: number /**/; - /** - * Vertical position relative to the top-left corner of the area. - * - * @see y Documentation - */ - y?: number /**/; - /** - * Width of the area. - * - * @see width Documentation - */ - width?: number /**/; - /** - * Height of the area. - * - * @see height Documentation - */ - height?: number /**/; -}; +export type RichMenuBounds = { + /** + * Horizontal position relative to the top-left corner of the area. + * + * @see x Documentation + */ + 'x'?: number/**/; + /** + * Vertical position relative to the top-left corner of the area. + * + * @see y Documentation + */ + 'y'?: number/**/; + /** + * Width of the area. + * + * @see width Documentation + */ + 'width'?: number/**/; + /** + * Height of the area. + * + * @see height Documentation + */ + 'height'?: number/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuBulkLinkRequest.ts b/lib/messaging-api/model/richMenuBulkLinkRequest.ts index a8b365c2d..4a7a8da5b 100644 --- a/lib/messaging-api/model/richMenuBulkLinkRequest.ts +++ b/lib/messaging-api/model/richMenuBulkLinkRequest.ts @@ -10,17 +10,30 @@ * Do not edit the class manually. */ -export type RichMenuBulkLinkRequest = { - /** - * ID of a rich menu - * - * @see richMenuId Documentation - */ - richMenuId: string /**/; - /** - * Array of user IDs. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. - * - * @see userIds Documentation - */ - userIds: Array /**/; -}; + + + + + +export type RichMenuBulkLinkRequest = { + /** + * ID of a rich menu + * + * @see richMenuId Documentation + */ + 'richMenuId': string/**/; + /** + * Array of user IDs. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + * + * @see userIds Documentation + */ + 'userIds': Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuBulkUnlinkRequest.ts b/lib/messaging-api/model/richMenuBulkUnlinkRequest.ts index bc8431cb4..32a977d29 100644 --- a/lib/messaging-api/model/richMenuBulkUnlinkRequest.ts +++ b/lib/messaging-api/model/richMenuBulkUnlinkRequest.ts @@ -10,11 +10,24 @@ * Do not edit the class manually. */ -export type RichMenuBulkUnlinkRequest = { - /** - * Array of user IDs. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. - * - * @see userIds Documentation - */ - userIds: Array /**/; -}; + + + + + +export type RichMenuBulkUnlinkRequest = { + /** + * Array of user IDs. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + * + * @see userIds Documentation + */ + 'userIds': Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuIdResponse.ts b/lib/messaging-api/model/richMenuIdResponse.ts index f32e228bb..9d7a77cf4 100644 --- a/lib/messaging-api/model/richMenuIdResponse.ts +++ b/lib/messaging-api/model/richMenuIdResponse.ts @@ -10,9 +10,22 @@ * Do not edit the class manually. */ -export type RichMenuIdResponse = { - /** - * Rich menu ID - */ - richMenuId: string /**/; -}; + + + + + +export type RichMenuIdResponse = { + /** + * Rich menu ID + */ + 'richMenuId': string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuListResponse.ts b/lib/messaging-api/model/richMenuListResponse.ts index c3fa3828a..947990fe7 100644 --- a/lib/messaging-api/model/richMenuListResponse.ts +++ b/lib/messaging-api/model/richMenuListResponse.ts @@ -10,13 +10,24 @@ * Do not edit the class manually. */ -import { RichMenuResponse } from "./richMenuResponse"; - -export type RichMenuListResponse = { - /** - * Rich menus - * - * @see richmenus Documentation - */ - richmenus: Array /**/; -}; + + + import { RichMenuResponse } from './richMenuResponse.js'; + + +export type RichMenuListResponse = { + /** + * Rich menus + * + * @see richmenus Documentation + */ + 'richmenus': Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuRequest.ts b/lib/messaging-api/model/richMenuRequest.ts index f527f9c61..a1688b4d1 100644 --- a/lib/messaging-api/model/richMenuRequest.ts +++ b/lib/messaging-api/model/richMenuRequest.ts @@ -10,27 +10,37 @@ * Do not edit the class manually. */ -import { RichMenuArea } from "./richMenuArea"; -import { RichMenuSize } from "./richMenuSize"; - -export type RichMenuRequest = { - /** - */ - size?: RichMenuSize /**/; - /** - * `true` to display the rich menu by default. Otherwise, `false`. - */ - selected?: boolean /**/; - /** - * Name of the rich menu. This value can be used to help manage your rich menus and is not displayed to users. - */ - name?: string /**/; - /** - * Text displayed in the chat bar - */ - chatBarText?: string /**/; - /** - * Array of area objects which define the coordinates and size of tappable areas - */ - areas?: Array /**/; -}; + + + import { RichMenuArea } from './richMenuArea.js';import { RichMenuSize } from './richMenuSize.js'; + + +export type RichMenuRequest = { + /** + */ + 'size'?: RichMenuSize/**/; + /** + * `true` to display the rich menu by default. Otherwise, `false`. + */ + 'selected'?: boolean/**/; + /** + * Name of the rich menu. This value can be used to help manage your rich menus and is not displayed to users. + */ + 'name'?: string/**/; + /** + * Text displayed in the chat bar + */ + 'chatBarText'?: string/**/; + /** + * Array of area objects which define the coordinates and size of tappable areas + */ + 'areas'?: Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuResponse.ts b/lib/messaging-api/model/richMenuResponse.ts index 90247af03..3f16905e2 100644 --- a/lib/messaging-api/model/richMenuResponse.ts +++ b/lib/messaging-api/model/richMenuResponse.ts @@ -10,31 +10,41 @@ * Do not edit the class manually. */ -import { RichMenuArea } from "./richMenuArea"; -import { RichMenuSize } from "./richMenuSize"; - -export type RichMenuResponse = { - /** - * ID of a rich menu - */ - richMenuId: string /**/; - /** - */ - size: RichMenuSize /**/; - /** - * `true` to display the rich menu by default. Otherwise, `false`. - */ - selected: boolean /**/; - /** - * Name of the rich menu. This value can be used to help manage your rich menus and is not displayed to users. - */ - name: string /**/; - /** - * Text displayed in the chat bar - */ - chatBarText: string /**/; - /** - * Array of area objects which define the coordinates and size of tappable areas - */ - areas: Array /**/; -}; + + + import { RichMenuArea } from './richMenuArea.js';import { RichMenuSize } from './richMenuSize.js'; + + +export type RichMenuResponse = { + /** + * ID of a rich menu + */ + 'richMenuId': string/**/; + /** + */ + 'size': RichMenuSize/**/; + /** + * `true` to display the rich menu by default. Otherwise, `false`. + */ + 'selected': boolean/**/; + /** + * Name of the rich menu. This value can be used to help manage your rich menus and is not displayed to users. + */ + 'name': string/**/; + /** + * Text displayed in the chat bar + */ + 'chatBarText': string/**/; + /** + * Array of area objects which define the coordinates and size of tappable areas + */ + 'areas': Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuSize.ts b/lib/messaging-api/model/richMenuSize.ts index 60b434ab8..cb33cdc42 100644 --- a/lib/messaging-api/model/richMenuSize.ts +++ b/lib/messaging-api/model/richMenuSize.ts @@ -10,16 +10,29 @@ * Do not edit the class manually. */ + + + + + /** * Rich menu size */ -export type RichMenuSize = { - /** - * width - */ - width?: number /**/; - /** - * height - */ - height?: number /**/; -}; +export type RichMenuSize = { + /** + * width + */ + 'width'?: number/**/; + /** + * height + */ + 'height'?: number/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/richMenuSwitchAction.ts b/lib/messaging-api/model/richMenuSwitchAction.ts index a058eb90e..913e6385b 100644 --- a/lib/messaging-api/model/richMenuSwitchAction.ts +++ b/lib/messaging-api/model/richMenuSwitchAction.ts @@ -10,16 +10,28 @@ * Do not edit the class manually. */ -import { Action } from "./action"; - -import { ActionBase } from "./models"; - -export type RichMenuSwitchAction = ActionBase & { - type: "richmenuswitch"; - /** - */ - data?: string /**/; - /** - */ - richMenuAliasId?: string /**/; -}; + + + import { Action } from './action.js'; + + +import { ActionBase } from './models.js'; + + +export type RichMenuSwitchAction = ActionBase & { +type: "richmenuswitch", + /** + */ + 'data'?: string/**/; + /** + */ + 'richMenuAliasId'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/roomMemberCountResponse.ts b/lib/messaging-api/model/roomMemberCountResponse.ts index b12847787..3a84a92b6 100644 --- a/lib/messaging-api/model/roomMemberCountResponse.ts +++ b/lib/messaging-api/model/roomMemberCountResponse.ts @@ -10,11 +10,24 @@ * Do not edit the class manually. */ -export type RoomMemberCountResponse = { - /** - * The count of members in the multi-person chat. The number returned excludes the LINE Official Account. - * - * @see count Documentation - */ - count: number /**/; -}; + + + + + +export type RoomMemberCountResponse = { + /** + * The count of members in the multi-person chat. The number returned excludes the LINE Official Account. + * + * @see count Documentation + */ + 'count': number/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/roomUserProfileResponse.ts b/lib/messaging-api/model/roomUserProfileResponse.ts index 1dc50de94..898d55305 100644 --- a/lib/messaging-api/model/roomUserProfileResponse.ts +++ b/lib/messaging-api/model/roomUserProfileResponse.ts @@ -10,23 +10,36 @@ * Do not edit the class manually. */ -export type RoomUserProfileResponse = { - /** - * User\'s display name - * - * @see displayName Documentation - */ - displayName: string /**/; - /** - * User ID - * - * @see userId Documentation - */ - userId: string /**/; - /** - * Profile image URL. `https` image URL. Not included in the response if the user doesn\'t have a profile image. - * - * @see pictureUrl Documentation - */ - pictureUrl?: string /**/; -}; + + + + + +export type RoomUserProfileResponse = { + /** + * User\'s display name + * + * @see displayName Documentation + */ + 'displayName': string/**/; + /** + * User ID + * + * @see userId Documentation + */ + 'userId': string/**/; + /** + * Profile image URL. `https` image URL. Not included in the response if the user doesn\'t have a profile image. + * + * @see pictureUrl Documentation + */ + 'pictureUrl'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/sender.ts b/lib/messaging-api/model/sender.ts index d662fff9e..0e6c8aa39 100644 --- a/lib/messaging-api/model/sender.ts +++ b/lib/messaging-api/model/sender.ts @@ -10,16 +10,29 @@ * Do not edit the class manually. */ + + + + + /** * Change icon and display name */ -export type Sender = { - /** - * Display name. Certain words such as `LINE` may not be used. - */ - name?: string /**/; - /** - * URL of the image to display as an icon when sending a message - */ - iconUrl?: string /**/; -}; +export type Sender = { + /** + * Display name. Certain words such as `LINE` may not be used. + */ + 'name'?: string/**/; + /** + * URL of the image to display as an icon when sending a message + */ + 'iconUrl'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/sentMessage.ts b/lib/messaging-api/model/sentMessage.ts index 5e7712c1a..d1e3e21e3 100644 --- a/lib/messaging-api/model/sentMessage.ts +++ b/lib/messaging-api/model/sentMessage.ts @@ -10,13 +10,26 @@ * Do not edit the class manually. */ -export type SentMessage = { - /** - * ID of the sent message. - */ - id: string /**/; - /** - * Quote token of the message. Only included when a message object that can be specified as a quote target was sent as a push or reply message. - */ - quoteToken?: string /**/; -}; + + + + + +export type SentMessage = { + /** + * ID of the sent message. + */ + 'id': string/**/; + /** + * Quote token of the message. Only included when a message object that can be specified as a quote target was sent as a push or reply message. + */ + 'quoteToken'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/setWebhookEndpointRequest.ts b/lib/messaging-api/model/setWebhookEndpointRequest.ts index 8cef7d32a..88a023a64 100644 --- a/lib/messaging-api/model/setWebhookEndpointRequest.ts +++ b/lib/messaging-api/model/setWebhookEndpointRequest.ts @@ -10,11 +10,24 @@ * Do not edit the class manually. */ -export type SetWebhookEndpointRequest = { - /** - * A valid webhook URL. - * - * @see endpoint Documentation - */ - endpoint: string /**/; -}; + + + + + +export type SetWebhookEndpointRequest = { + /** + * A valid webhook URL. + * + * @see endpoint Documentation + */ + 'endpoint': string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/stickerMessage.ts b/lib/messaging-api/model/stickerMessage.ts index 81e9e222b..3b1fbcf0b 100644 --- a/lib/messaging-api/model/stickerMessage.ts +++ b/lib/messaging-api/model/stickerMessage.ts @@ -10,28 +10,38 @@ * Do not edit the class manually. */ -import { Message } from "./message"; -import { QuickReply } from "./quickReply"; -import { Sender } from "./sender"; - -import { MessageBase } from "./models"; - -export type StickerMessage = MessageBase & { - type: "sticker"; - /** - * - * @see packageId Documentation - */ - packageId: string /**/; - /** - * - * @see stickerId Documentation - */ - stickerId: string /**/; - /** - * Quote token of the message you want to quote. - * - * @see quoteToken Documentation - */ - quoteToken?: string /**/; -}; + + + import { Message } from './message.js';import { QuickReply } from './quickReply.js';import { Sender } from './sender.js'; + + +import { MessageBase } from './models.js'; + + +export type StickerMessage = MessageBase & { +type: "sticker", + /** + * + * @see packageId Documentation + */ + 'packageId': string/**/; + /** + * + * @see stickerId Documentation + */ + 'stickerId': string/**/; + /** + * Quote token of the message you want to quote. + * + * @see quoteToken Documentation + */ + 'quoteToken'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/subscriptionPeriodDemographic.ts b/lib/messaging-api/model/subscriptionPeriodDemographic.ts index f8052bf9a..283da90a2 100644 --- a/lib/messaging-api/model/subscriptionPeriodDemographic.ts +++ b/lib/messaging-api/model/subscriptionPeriodDemographic.ts @@ -10,9 +10,22 @@ * Do not edit the class manually. */ -export type SubscriptionPeriodDemographic = - | "day_7" - | "day_30" - | "day_90" - | "day_180" - | "day_365"; + + + + + + + + + export type SubscriptionPeriodDemographic = + 'day_7' + | 'day_30' + | 'day_90' + | 'day_180' + | 'day_365' + +; + + + diff --git a/lib/messaging-api/model/subscriptionPeriodDemographicFilter.ts b/lib/messaging-api/model/subscriptionPeriodDemographicFilter.ts index 57e888631..57fe9a02a 100644 --- a/lib/messaging-api/model/subscriptionPeriodDemographicFilter.ts +++ b/lib/messaging-api/model/subscriptionPeriodDemographicFilter.ts @@ -10,19 +10,34 @@ * Do not edit the class manually. */ -import { DemographicFilter } from "./demographicFilter"; -import { SubscriptionPeriodDemographic } from "./subscriptionPeriodDemographic"; - -import { DemographicFilterBase } from "./models"; - -export type SubscriptionPeriodDemographicFilter = DemographicFilterBase & { - type: "subscriptionPeriod"; - /** - */ - gte?: SubscriptionPeriodDemographic /**/; - /** - */ - lt?: SubscriptionPeriodDemographic /**/; -}; - -export namespace SubscriptionPeriodDemographicFilter {} + + + import { DemographicFilter } from './demographicFilter.js';import { SubscriptionPeriodDemographic } from './subscriptionPeriodDemographic.js'; + + +import { DemographicFilterBase } from './models.js'; + + +export type SubscriptionPeriodDemographicFilter = DemographicFilterBase & { +type: "subscriptionPeriod", + /** + */ + 'gte'?: SubscriptionPeriodDemographic/**/; + /** + */ + 'lt'?: SubscriptionPeriodDemographic/**/; + +} + + + +export namespace SubscriptionPeriodDemographicFilter { + + + +} + + + + + diff --git a/lib/messaging-api/model/template.ts b/lib/messaging-api/model/template.ts index c51817c97..240d8ff36 100644 --- a/lib/messaging-api/model/template.ts +++ b/lib/messaging-api/model/template.ts @@ -10,24 +10,39 @@ * Do not edit the class manually. */ -import { ButtonsTemplate } from "./models"; -import { CarouselTemplate } from "./models"; -import { ConfirmTemplate } from "./models"; -import { ImageCarouselTemplate } from "./models"; + + + + + + import { ButtonsTemplate } from './models.js'; + import { CarouselTemplate } from './models.js'; + import { ConfirmTemplate } from './models.js'; + import { ImageCarouselTemplate } from './models.js'; + export type Template = - | ButtonsTemplate // buttons - | CarouselTemplate // carousel - | ConfirmTemplate // confirm - | ImageCarouselTemplate // image_carousel - | UnknownTemplate; + | ButtonsTemplate // buttons + | CarouselTemplate // carousel + | ConfirmTemplate // confirm + | ImageCarouselTemplate // image_carousel + | UnknownTemplate +; export type UnknownTemplate = TemplateBase & { - [key: string]: unknown; + [key: string]: unknown; }; + +export type TemplateBase = { + /** + */ + 'type': string/**/; + +} + + + + + + -export type TemplateBase = { - /** - */ - type: string /**/; -}; diff --git a/lib/messaging-api/model/templateImageAspectRatio.ts b/lib/messaging-api/model/templateImageAspectRatio.ts index 535baf76f..0d27b185b 100644 --- a/lib/messaging-api/model/templateImageAspectRatio.ts +++ b/lib/messaging-api/model/templateImageAspectRatio.ts @@ -10,8 +10,22 @@ * Do not edit the class manually. */ + + + + + /** - * Aspect ratio of the image. This is only for the `imageAspectRatio` in ButtonsTemplate. Specify one of the following values: `rectangle`: 1.51:1 `square`: 1:1 + * Aspect ratio of the image. This is only for the `imageAspectRatio` in ButtonsTemplate. Specify one of the following values: `rectangle`: 1.51:1 `square`: 1:1 */ -export type TemplateImageAspectRatio = "rectangle" | "square"; + + + export type TemplateImageAspectRatio = + 'rectangle' + | 'square' + +; + + + diff --git a/lib/messaging-api/model/templateImageSize.ts b/lib/messaging-api/model/templateImageSize.ts index 83d5fd593..fc04058cd 100644 --- a/lib/messaging-api/model/templateImageSize.ts +++ b/lib/messaging-api/model/templateImageSize.ts @@ -10,8 +10,22 @@ * Do not edit the class manually. */ + + + + + /** - * Size of the image. This is only for the `imageSize` in ButtonsTemplate. Specify one of the following values: `cover`: The image fills the entire image area. Parts of the image that do not fit in the area are not displayed. `contain`: The entire image is displayed in the image area. A background is displayed in the unused areas to the left and right of vertical images and in the areas above and below horizontal images. + * Size of the image. This is only for the `imageSize` in ButtonsTemplate. Specify one of the following values: `cover`: The image fills the entire image area. Parts of the image that do not fit in the area are not displayed. `contain`: The entire image is displayed in the image area. A background is displayed in the unused areas to the left and right of vertical images and in the areas above and below horizontal images. */ -export type TemplateImageSize = "cover" | "contain"; + + + export type TemplateImageSize = + 'cover' + | 'contain' + +; + + + diff --git a/lib/messaging-api/model/templateMessage.ts b/lib/messaging-api/model/templateMessage.ts index 8f73cea23..7f07cc742 100644 --- a/lib/messaging-api/model/templateMessage.ts +++ b/lib/messaging-api/model/templateMessage.ts @@ -10,23 +10,32 @@ * Do not edit the class manually. */ -import { Message } from "./message"; -import { QuickReply } from "./quickReply"; -import { Sender } from "./sender"; -import { Template } from "./template"; - -import { MessageBase } from "./models"; - -export type TemplateMessage = MessageBase & { - type: "template"; - /** - * - * @see altText Documentation - */ - altText: string /**/; - /** - * - * @see template Documentation - */ - template: Template /**/; -}; + + + import { Message } from './message.js';import { QuickReply } from './quickReply.js';import { Sender } from './sender.js';import { Template } from './template.js'; + + +import { MessageBase } from './models.js'; + + +export type TemplateMessage = MessageBase & { +type: "template", + /** + * + * @see altText Documentation + */ + 'altText': string/**/; + /** + * + * @see template Documentation + */ + 'template': Template/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/testWebhookEndpointRequest.ts b/lib/messaging-api/model/testWebhookEndpointRequest.ts index 9fdf54003..3f57775bc 100644 --- a/lib/messaging-api/model/testWebhookEndpointRequest.ts +++ b/lib/messaging-api/model/testWebhookEndpointRequest.ts @@ -10,11 +10,24 @@ * Do not edit the class manually. */ -export type TestWebhookEndpointRequest = { - /** - * A webhook URL to be validated. - * - * @see endpoint Documentation - */ - endpoint?: string /**/; -}; + + + + + +export type TestWebhookEndpointRequest = { + /** + * A webhook URL to be validated. + * + * @see endpoint Documentation + */ + 'endpoint'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/testWebhookEndpointResponse.ts b/lib/messaging-api/model/testWebhookEndpointResponse.ts index ce691e097..98ce95e93 100644 --- a/lib/messaging-api/model/testWebhookEndpointResponse.ts +++ b/lib/messaging-api/model/testWebhookEndpointResponse.ts @@ -10,35 +10,48 @@ * Do not edit the class manually. */ -export type TestWebhookEndpointResponse = { - /** - * Result of the communication from the LINE platform to the webhook URL. - * - * @see success Documentation - */ - success?: boolean /**/; - /** - * Time of the event in milliseconds. Even in the case of a redelivered webhook, it represents the time the event occurred, not the time it was redelivered. - * - * @see timestamp Documentation - */ - timestamp: Date /**/; - /** - * The HTTP status code. If the webhook response isn\'t received, the status code is set to zero or a negative number. - * - * @see statusCode Documentation - */ - statusCode: number /**/; - /** - * Reason for the response. - * - * @see reason Documentation - */ - reason: string /**/; - /** - * Details of the response. - * - * @see detail Documentation - */ - detail: string /**/; -}; + + + + + +export type TestWebhookEndpointResponse = { + /** + * Result of the communication from the LINE platform to the webhook URL. + * + * @see success Documentation + */ + 'success'?: boolean/**/; + /** + * Time of the event in milliseconds. Even in the case of a redelivered webhook, it represents the time the event occurred, not the time it was redelivered. + * + * @see timestamp Documentation + */ + 'timestamp': Date/**/; + /** + * The HTTP status code. If the webhook response isn\'t received, the status code is set to zero or a negative number. + * + * @see statusCode Documentation + */ + 'statusCode': number/**/; + /** + * Reason for the response. + * + * @see reason Documentation + */ + 'reason': string/**/; + /** + * Details of the response. + * + * @see detail Documentation + */ + 'detail': string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/textMessage.ts b/lib/messaging-api/model/textMessage.ts index 98bd75963..2b3e9e201 100644 --- a/lib/messaging-api/model/textMessage.ts +++ b/lib/messaging-api/model/textMessage.ts @@ -10,29 +10,38 @@ * Do not edit the class manually. */ -import { Emoji } from "./emoji"; -import { Message } from "./message"; -import { QuickReply } from "./quickReply"; -import { Sender } from "./sender"; - -import { MessageBase } from "./models"; - -export type TextMessage = MessageBase & { - type: "text"; - /** - * - * @see text Documentation - */ - text: string /**/; - /** - * - * @see emojis Documentation - */ - emojis?: Array /**/; - /** - * Quote token of the message you want to quote. - * - * @see quoteToken Documentation - */ - quoteToken?: string /**/; -}; + + + import { Emoji } from './emoji.js';import { Message } from './message.js';import { QuickReply } from './quickReply.js';import { Sender } from './sender.js'; + + +import { MessageBase } from './models.js'; + + +export type TextMessage = MessageBase & { +type: "text", + /** + * + * @see text Documentation + */ + 'text': string/**/; + /** + * + * @see emojis Documentation + */ + 'emojis'?: Array/**/; + /** + * Quote token of the message you want to quote. + * + * @see quoteToken Documentation + */ + 'quoteToken'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/uRIAction.ts b/lib/messaging-api/model/uRIAction.ts index b4ba3e8e9..eb9136c26 100644 --- a/lib/messaging-api/model/uRIAction.ts +++ b/lib/messaging-api/model/uRIAction.ts @@ -10,17 +10,28 @@ * Do not edit the class manually. */ -import { Action } from "./action"; -import { AltUri } from "./altUri"; - -import { ActionBase } from "./models"; - -export type URIAction = ActionBase & { - type: "uri"; - /** - */ - uri?: string /**/; - /** - */ - altUri?: AltUri /**/; -}; + + + import { Action } from './action.js';import { AltUri } from './altUri.js'; + + +import { ActionBase } from './models.js'; + + +export type URIAction = ActionBase & { +type: "uri", + /** + */ + 'uri'?: string/**/; + /** + */ + 'altUri'?: AltUri/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/uRIImagemapAction.ts b/lib/messaging-api/model/uRIImagemapAction.ts index 6b51c6a8f..a82f02546 100644 --- a/lib/messaging-api/model/uRIImagemapAction.ts +++ b/lib/messaging-api/model/uRIImagemapAction.ts @@ -10,17 +10,28 @@ * Do not edit the class manually. */ -import { ImagemapAction } from "./imagemapAction"; -import { ImagemapArea } from "./imagemapArea"; - -import { ImagemapActionBase } from "./models"; - -export type URIImagemapAction = ImagemapActionBase & { - type: "uri"; - /** - */ - linkUri: string /**/; - /** - */ - label?: string /**/; -}; + + + import { ImagemapAction } from './imagemapAction.js';import { ImagemapArea } from './imagemapArea.js'; + + +import { ImagemapActionBase } from './models.js'; + + +export type URIImagemapAction = ImagemapActionBase & { +type: "uri", + /** + */ + 'linkUri': string/**/; + /** + */ + 'label'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/updateRichMenuAliasRequest.ts b/lib/messaging-api/model/updateRichMenuAliasRequest.ts index 2c2867088..0d99cd629 100644 --- a/lib/messaging-api/model/updateRichMenuAliasRequest.ts +++ b/lib/messaging-api/model/updateRichMenuAliasRequest.ts @@ -10,11 +10,24 @@ * Do not edit the class manually. */ -export type UpdateRichMenuAliasRequest = { - /** - * The rich menu ID to be associated with the rich menu alias. - * - * @see richMenuId Documentation - */ - richMenuId: string /**/; -}; + + + + + +export type UpdateRichMenuAliasRequest = { + /** + * The rich menu ID to be associated with the rich menu alias. + * + * @see richMenuId Documentation + */ + 'richMenuId': string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/userProfileResponse.ts b/lib/messaging-api/model/userProfileResponse.ts index b70b6b185..19a95939e 100644 --- a/lib/messaging-api/model/userProfileResponse.ts +++ b/lib/messaging-api/model/userProfileResponse.ts @@ -10,35 +10,48 @@ * Do not edit the class manually. */ -export type UserProfileResponse = { - /** - * User\'s display name - * - * @see displayName Documentation - */ - displayName: string /**/; - /** - * User ID - * - * @see userId Documentation - */ - userId: string /**/; - /** - * Profile image URL. `https` image URL. Not included in the response if the user doesn\'t have a profile image. - * - * @see pictureUrl Documentation - */ - pictureUrl?: string /**/; - /** - * User\'s status message. Not included in the response if the user doesn\'t have a status message. - * - * @see statusMessage Documentation - */ - statusMessage?: string /**/; - /** - * User\'s language, as a BCP 47 language tag. Not included in the response if the user hasn\'t yet consented to the LINE Privacy Policy. - * - * @see language Documentation - */ - language?: string /**/; -}; + + + + + +export type UserProfileResponse = { + /** + * User\'s display name + * + * @see displayName Documentation + */ + 'displayName': string/**/; + /** + * User ID + * + * @see userId Documentation + */ + 'userId': string/**/; + /** + * Profile image URL. `https` image URL. Not included in the response if the user doesn\'t have a profile image. + * + * @see pictureUrl Documentation + */ + 'pictureUrl'?: string/**/; + /** + * User\'s status message. Not included in the response if the user doesn\'t have a status message. + * + * @see statusMessage Documentation + */ + 'statusMessage'?: string/**/; + /** + * User\'s language, as a BCP 47 language tag. Not included in the response if the user hasn\'t yet consented to the LINE Privacy Policy. + * + * @see language Documentation + */ + 'language'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/validateMessageRequest.ts b/lib/messaging-api/model/validateMessageRequest.ts index 72af0855d..d60992e62 100644 --- a/lib/messaging-api/model/validateMessageRequest.ts +++ b/lib/messaging-api/model/validateMessageRequest.ts @@ -10,11 +10,22 @@ * Do not edit the class manually. */ -import { Message } from "./message"; - -export type ValidateMessageRequest = { - /** - * Array of message objects to validate - */ - messages: Array /**/; -}; + + + import { Message } from './message.js'; + + +export type ValidateMessageRequest = { + /** + * Array of message objects to validate + */ + 'messages': Array/**/; + +} + + + + + + + diff --git a/lib/messaging-api/model/videoMessage.ts b/lib/messaging-api/model/videoMessage.ts index 92644e545..592abeb4b 100644 --- a/lib/messaging-api/model/videoMessage.ts +++ b/lib/messaging-api/model/videoMessage.ts @@ -10,27 +10,37 @@ * Do not edit the class manually. */ -import { Message } from "./message"; -import { QuickReply } from "./quickReply"; -import { Sender } from "./sender"; - -import { MessageBase } from "./models"; - -export type VideoMessage = MessageBase & { - type: "video"; - /** - * - * @see originalContentUrl Documentation - */ - originalContentUrl: string /**/; - /** - * - * @see previewImageUrl Documentation - */ - previewImageUrl: string /**/; - /** - * - * @see trackingId Documentation - */ - trackingId?: string /**/; -}; + + + import { Message } from './message.js';import { QuickReply } from './quickReply.js';import { Sender } from './sender.js'; + + +import { MessageBase } from './models.js'; + + +export type VideoMessage = MessageBase & { +type: "video", + /** + * + * @see originalContentUrl Documentation + */ + 'originalContentUrl': string/**/; + /** + * + * @see previewImageUrl Documentation + */ + 'previewImageUrl': string/**/; + /** + * + * @see trackingId Documentation + */ + 'trackingId'?: string/**/; + +} + + + + + + + diff --git a/lib/messaging-api/tests/api/MessagingApiBlobClientTest.spec.ts b/lib/messaging-api/tests/api/MessagingApiBlobClientTest.spec.ts index dc9759328..e06e8de4f 100644 --- a/lib/messaging-api/tests/api/MessagingApiBlobClientTest.spec.ts +++ b/lib/messaging-api/tests/api/MessagingApiBlobClientTest.spec.ts @@ -1,15 +1,28 @@ -import { MessagingApiBlobClient } from "../../api"; -import { GetMessageContentTranscodingResponse } from "../../model/getMessageContentTranscodingResponse"; + +import { MessagingApiBlobClient } from "../../api.js"; + +import { GetMessageContentTranscodingResponse } from '../../model/getMessageContentTranscodingResponse.js'; + import { createServer } from "node:http"; import { deepEqual, equal, ok } from "node:assert"; -const pkg = require("../../../../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../../../../package.json"); const channel_access_token = "test_channel_access_token"; + + + + describe("MessagingApiBlobClient", () => { + + + + it("getMessageContentWithHttpInfo", async () => { let requestCount = 0; @@ -18,41 +31,58 @@ describe("MessagingApiBlobClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/{messageId}/content".replace("{messageId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/{messageId}/content" + .replace("{messageId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiBlobClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getMessageContentWithHttpInfo( - // messageId: string - "DUMMY", // messageId(string) + + + // messageId: string + "DUMMY", // messageId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getMessageContent", async () => { let requestCount = 0; @@ -61,41 +91,59 @@ describe("MessagingApiBlobClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/{messageId}/content".replace("{messageId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/{messageId}/content" + .replace("{messageId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiBlobClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getMessageContent( - // messageId: string - "DUMMY", // messageId(string) + + + // messageId: string + "DUMMY", // messageId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getMessageContentPreviewWithHttpInfo", async () => { let requestCount = 0; @@ -104,44 +152,58 @@ describe("MessagingApiBlobClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/{messageId}/content/preview".replace( - "{messageId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/{messageId}/content/preview" + .replace("{messageId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiBlobClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getMessageContentPreviewWithHttpInfo( - // messageId: string - "DUMMY", // messageId(string) + + + // messageId: string + "DUMMY", // messageId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getMessageContentPreview", async () => { let requestCount = 0; @@ -150,44 +212,59 @@ describe("MessagingApiBlobClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/{messageId}/content/preview".replace( - "{messageId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/{messageId}/content/preview" + .replace("{messageId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiBlobClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getMessageContentPreview( - // messageId: string - "DUMMY", // messageId(string) + + + // messageId: string + "DUMMY", // messageId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getMessageContentTranscodingByMessageIdWithHttpInfo", async () => { let requestCount = 0; @@ -196,45 +273,58 @@ describe("MessagingApiBlobClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/{messageId}/content/transcoding".replace( - "{messageId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/{messageId}/content/transcoding" + .replace("{messageId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiBlobClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = - await client.getMessageContentTranscodingByMessageIdWithHttpInfo( + const res = await client.getMessageContentTranscodingByMessageIdWithHttpInfo( + + // messageId: string - "DUMMY", // messageId(string) - ); + "DUMMY", // messageId(string) + + + ); equal(requestCount, 1); server.close(); }); + + + + it("getMessageContentTranscodingByMessageId", async () => { let requestCount = 0; @@ -243,44 +333,59 @@ describe("MessagingApiBlobClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/{messageId}/content/transcoding".replace( - "{messageId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/{messageId}/content/transcoding" + .replace("{messageId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiBlobClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getMessageContentTranscodingByMessageId( - // messageId: string - "DUMMY", // messageId(string) + + + // messageId: string + "DUMMY", // messageId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getRichMenuImageWithHttpInfo", async () => { let requestCount = 0; @@ -289,44 +394,58 @@ describe("MessagingApiBlobClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/{richMenuId}/content".replace( - "{richMenuId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/{richMenuId}/content" + .replace("{richMenuId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiBlobClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRichMenuImageWithHttpInfo( - // richMenuId: string - "DUMMY", // richMenuId(string) + + + // richMenuId: string + "DUMMY", // richMenuId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getRichMenuImage", async () => { let requestCount = 0; @@ -335,44 +454,59 @@ describe("MessagingApiBlobClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/{richMenuId}/content".replace( - "{richMenuId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/{richMenuId}/content" + .replace("{richMenuId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiBlobClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRichMenuImage( - // richMenuId: string - "DUMMY", // richMenuId(string) + + + // richMenuId: string + "DUMMY", // richMenuId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("setRichMenuImageWithHttpInfo", async () => { let requestCount = 0; @@ -381,47 +515,63 @@ describe("MessagingApiBlobClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/{richMenuId}/content".replace( - "{richMenuId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/{richMenuId}/content" + .replace("{richMenuId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiBlobClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.setRichMenuImageWithHttpInfo( - // richMenuId: string - "DUMMY", // richMenuId(string) - // body: Blob - new Blob([]), // paramName=body + + // richMenuId: string + "DUMMY", // richMenuId(string) + + + + // body: Blob + new Blob([]), // paramName=body + + ); equal(requestCount, 1); server.close(); }); + + + + it("setRichMenuImage", async () => { let requestCount = 0; @@ -430,44 +580,59 @@ describe("MessagingApiBlobClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/{richMenuId}/content".replace( - "{richMenuId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/{richMenuId}/content" + .replace("{richMenuId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiBlobClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.setRichMenuImage( - // richMenuId: string - "DUMMY", // richMenuId(string) - // body: Blob - new Blob([]), // paramName=body + + // richMenuId: string + "DUMMY", // richMenuId(string) + + + + // body: Blob + new Blob([]), // paramName=body + + ); equal(requestCount, 1); server.close(); }); + + + }); diff --git a/lib/messaging-api/tests/api/MessagingApiClientTest.spec.ts b/lib/messaging-api/tests/api/MessagingApiClientTest.spec.ts index 7bcc5b1ab..9f1d1fa57 100644 --- a/lib/messaging-api/tests/api/MessagingApiClientTest.spec.ts +++ b/lib/messaging-api/tests/api/MessagingApiClientTest.spec.ts @@ -1,58 +1,71 @@ -import { MessagingApiClient } from "../../api"; - -import { AudienceMatchMessagesRequest } from "../../model/audienceMatchMessagesRequest"; -import { BotInfoResponse } from "../../model/botInfoResponse"; -import { BroadcastRequest } from "../../model/broadcastRequest"; -import { CreateRichMenuAliasRequest } from "../../model/createRichMenuAliasRequest"; -import { ErrorResponse } from "../../model/errorResponse"; -import { GetAggregationUnitNameListResponse } from "../../model/getAggregationUnitNameListResponse"; -import { GetAggregationUnitUsageResponse } from "../../model/getAggregationUnitUsageResponse"; -import { GetFollowersResponse } from "../../model/getFollowersResponse"; -import { GetWebhookEndpointResponse } from "../../model/getWebhookEndpointResponse"; -import { GroupMemberCountResponse } from "../../model/groupMemberCountResponse"; -import { GroupSummaryResponse } from "../../model/groupSummaryResponse"; -import { GroupUserProfileResponse } from "../../model/groupUserProfileResponse"; -import { IssueLinkTokenResponse } from "../../model/issueLinkTokenResponse"; -import { MarkMessagesAsReadRequest } from "../../model/markMessagesAsReadRequest"; -import { MembersIdsResponse } from "../../model/membersIdsResponse"; -import { MessageQuotaResponse } from "../../model/messageQuotaResponse"; -import { MulticastRequest } from "../../model/multicastRequest"; -import { NarrowcastProgressResponse } from "../../model/narrowcastProgressResponse"; -import { NarrowcastRequest } from "../../model/narrowcastRequest"; -import { NumberOfMessagesResponse } from "../../model/numberOfMessagesResponse"; -import { PnpMessagesRequest } from "../../model/pnpMessagesRequest"; -import { PushMessageRequest } from "../../model/pushMessageRequest"; -import { PushMessageResponse } from "../../model/pushMessageResponse"; -import { QuotaConsumptionResponse } from "../../model/quotaConsumptionResponse"; -import { ReplyMessageRequest } from "../../model/replyMessageRequest"; -import { ReplyMessageResponse } from "../../model/replyMessageResponse"; -import { RichMenuAliasListResponse } from "../../model/richMenuAliasListResponse"; -import { RichMenuAliasResponse } from "../../model/richMenuAliasResponse"; -import { RichMenuBatchProgressResponse } from "../../model/richMenuBatchProgressResponse"; -import { RichMenuBatchRequest } from "../../model/richMenuBatchRequest"; -import { RichMenuBulkLinkRequest } from "../../model/richMenuBulkLinkRequest"; -import { RichMenuBulkUnlinkRequest } from "../../model/richMenuBulkUnlinkRequest"; -import { RichMenuIdResponse } from "../../model/richMenuIdResponse"; -import { RichMenuListResponse } from "../../model/richMenuListResponse"; -import { RichMenuRequest } from "../../model/richMenuRequest"; -import { RichMenuResponse } from "../../model/richMenuResponse"; -import { RoomMemberCountResponse } from "../../model/roomMemberCountResponse"; -import { RoomUserProfileResponse } from "../../model/roomUserProfileResponse"; -import { SetWebhookEndpointRequest } from "../../model/setWebhookEndpointRequest"; -import { TestWebhookEndpointRequest } from "../../model/testWebhookEndpointRequest"; -import { TestWebhookEndpointResponse } from "../../model/testWebhookEndpointResponse"; -import { UpdateRichMenuAliasRequest } from "../../model/updateRichMenuAliasRequest"; -import { UserProfileResponse } from "../../model/userProfileResponse"; -import { ValidateMessageRequest } from "../../model/validateMessageRequest"; + + +import { MessagingApiClient } from "../../api.js"; + +import { AudienceMatchMessagesRequest } from '../../model/audienceMatchMessagesRequest.js'; +import { BotInfoResponse } from '../../model/botInfoResponse.js'; +import { BroadcastRequest } from '../../model/broadcastRequest.js'; +import { CreateRichMenuAliasRequest } from '../../model/createRichMenuAliasRequest.js'; +import { ErrorResponse } from '../../model/errorResponse.js'; +import { GetAggregationUnitNameListResponse } from '../../model/getAggregationUnitNameListResponse.js'; +import { GetAggregationUnitUsageResponse } from '../../model/getAggregationUnitUsageResponse.js'; +import { GetFollowersResponse } from '../../model/getFollowersResponse.js'; +import { GetWebhookEndpointResponse } from '../../model/getWebhookEndpointResponse.js'; +import { GroupMemberCountResponse } from '../../model/groupMemberCountResponse.js'; +import { GroupSummaryResponse } from '../../model/groupSummaryResponse.js'; +import { GroupUserProfileResponse } from '../../model/groupUserProfileResponse.js'; +import { IssueLinkTokenResponse } from '../../model/issueLinkTokenResponse.js'; +import { MarkMessagesAsReadRequest } from '../../model/markMessagesAsReadRequest.js'; +import { MembersIdsResponse } from '../../model/membersIdsResponse.js'; +import { MessageQuotaResponse } from '../../model/messageQuotaResponse.js'; +import { MulticastRequest } from '../../model/multicastRequest.js'; +import { NarrowcastProgressResponse } from '../../model/narrowcastProgressResponse.js'; +import { NarrowcastRequest } from '../../model/narrowcastRequest.js'; +import { NumberOfMessagesResponse } from '../../model/numberOfMessagesResponse.js'; +import { PnpMessagesRequest } from '../../model/pnpMessagesRequest.js'; +import { PushMessageRequest } from '../../model/pushMessageRequest.js'; +import { PushMessageResponse } from '../../model/pushMessageResponse.js'; +import { QuotaConsumptionResponse } from '../../model/quotaConsumptionResponse.js'; +import { ReplyMessageRequest } from '../../model/replyMessageRequest.js'; +import { ReplyMessageResponse } from '../../model/replyMessageResponse.js'; +import { RichMenuAliasListResponse } from '../../model/richMenuAliasListResponse.js'; +import { RichMenuAliasResponse } from '../../model/richMenuAliasResponse.js'; +import { RichMenuBatchProgressResponse } from '../../model/richMenuBatchProgressResponse.js'; +import { RichMenuBatchRequest } from '../../model/richMenuBatchRequest.js'; +import { RichMenuBulkLinkRequest } from '../../model/richMenuBulkLinkRequest.js'; +import { RichMenuBulkUnlinkRequest } from '../../model/richMenuBulkUnlinkRequest.js'; +import { RichMenuIdResponse } from '../../model/richMenuIdResponse.js'; +import { RichMenuListResponse } from '../../model/richMenuListResponse.js'; +import { RichMenuRequest } from '../../model/richMenuRequest.js'; +import { RichMenuResponse } from '../../model/richMenuResponse.js'; +import { RoomMemberCountResponse } from '../../model/roomMemberCountResponse.js'; +import { RoomUserProfileResponse } from '../../model/roomUserProfileResponse.js'; +import { SetWebhookEndpointRequest } from '../../model/setWebhookEndpointRequest.js'; +import { TestWebhookEndpointRequest } from '../../model/testWebhookEndpointRequest.js'; +import { TestWebhookEndpointResponse } from '../../model/testWebhookEndpointResponse.js'; +import { UpdateRichMenuAliasRequest } from '../../model/updateRichMenuAliasRequest.js'; +import { UserProfileResponse } from '../../model/userProfileResponse.js'; +import { ValidateMessageRequest } from '../../model/validateMessageRequest.js'; + import { createServer } from "node:http"; import { deepEqual, equal, ok } from "node:assert"; -const pkg = require("../../../../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../../../../package.json"); const channel_access_token = "test_channel_access_token"; + + + + describe("MessagingApiClient", () => { + + + + it("audienceMatchWithHttpInfo", async () => { let requestCount = 0; @@ -61,38 +74,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/bot/ad/multicast/phone"); + equal(reqUrl.pathname, "/bot/ad/multicast/phone" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.audienceMatchWithHttpInfo( - // audienceMatchMessagesRequest: AudienceMatchMessagesRequest - {} as unknown as AudienceMatchMessagesRequest, // paramName=audienceMatchMessagesRequest + + + // audienceMatchMessagesRequest: AudienceMatchMessagesRequest + {} as unknown as AudienceMatchMessagesRequest, // paramName=audienceMatchMessagesRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("audienceMatch", async () => { let requestCount = 0; @@ -101,38 +133,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/bot/ad/multicast/phone"); + equal(reqUrl.pathname, "/bot/ad/multicast/phone" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.audienceMatch( - // audienceMatchMessagesRequest: AudienceMatchMessagesRequest - {} as unknown as AudienceMatchMessagesRequest, // paramName=audienceMatchMessagesRequest + + + // audienceMatchMessagesRequest: AudienceMatchMessagesRequest + {} as unknown as AudienceMatchMessagesRequest, // paramName=audienceMatchMessagesRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("broadcastWithHttpInfo", async () => { let requestCount = 0; @@ -141,44 +193,63 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/broadcast".replace("{xLineRetryKey}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/broadcast" + .replace("{xLineRetryKey}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.broadcastWithHttpInfo( - // broadcastRequest: BroadcastRequest - {} as unknown as BroadcastRequest, // paramName=broadcastRequest - // xLineRetryKey: string - "DUMMY", // xLineRetryKey(string) + + // broadcastRequest: BroadcastRequest + {} as unknown as BroadcastRequest, // paramName=broadcastRequest + + + + // xLineRetryKey: string + "DUMMY", // xLineRetryKey(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("broadcast", async () => { let requestCount = 0; @@ -187,44 +258,64 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/broadcast".replace("{xLineRetryKey}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/broadcast" + .replace("{xLineRetryKey}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.broadcast( - // broadcastRequest: BroadcastRequest - {} as unknown as BroadcastRequest, // paramName=broadcastRequest - // xLineRetryKey: string - "DUMMY", // xLineRetryKey(string) + + // broadcastRequest: BroadcastRequest + {} as unknown as BroadcastRequest, // paramName=broadcastRequest + + + + // xLineRetryKey: string + "DUMMY", // xLineRetryKey(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("cancelDefaultRichMenuWithHttpInfo", async () => { let requestCount = 0; @@ -233,35 +324,52 @@ describe("MessagingApiClient", () => { equal(req.method, "DELETE"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/user/all/richmenu"); + equal(reqUrl.pathname, "/v2/bot/user/all/richmenu" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.cancelDefaultRichMenuWithHttpInfo(); + const res = await client.cancelDefaultRichMenuWithHttpInfo( + + ); equal(requestCount, 1); server.close(); }); + + + + it("cancelDefaultRichMenu", async () => { let requestCount = 0; @@ -270,35 +378,53 @@ describe("MessagingApiClient", () => { equal(req.method, "DELETE"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/user/all/richmenu"); + equal(reqUrl.pathname, "/v2/bot/user/all/richmenu" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.cancelDefaultRichMenu(); + const res = await client.cancelDefaultRichMenu( + + ); equal(requestCount, 1); server.close(); }); + + + + + it("createRichMenuWithHttpInfo", async () => { let requestCount = 0; @@ -307,38 +433,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu"); + equal(reqUrl.pathname, "/v2/bot/richmenu" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.createRichMenuWithHttpInfo( - // richMenuRequest: RichMenuRequest - {} as unknown as RichMenuRequest, // paramName=richMenuRequest + + + // richMenuRequest: RichMenuRequest + {} as unknown as RichMenuRequest, // paramName=richMenuRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("createRichMenu", async () => { let requestCount = 0; @@ -347,38 +492,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu"); + equal(reqUrl.pathname, "/v2/bot/richmenu" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.createRichMenu( - // richMenuRequest: RichMenuRequest - {} as unknown as RichMenuRequest, // paramName=richMenuRequest + + + // richMenuRequest: RichMenuRequest + {} as unknown as RichMenuRequest, // paramName=richMenuRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("createRichMenuAliasWithHttpInfo", async () => { let requestCount = 0; @@ -387,38 +552,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/alias"); + equal(reqUrl.pathname, "/v2/bot/richmenu/alias" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.createRichMenuAliasWithHttpInfo( - // createRichMenuAliasRequest: CreateRichMenuAliasRequest - {} as unknown as CreateRichMenuAliasRequest, // paramName=createRichMenuAliasRequest + + + // createRichMenuAliasRequest: CreateRichMenuAliasRequest + {} as unknown as CreateRichMenuAliasRequest, // paramName=createRichMenuAliasRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("createRichMenuAlias", async () => { let requestCount = 0; @@ -427,38 +611,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/alias"); + equal(reqUrl.pathname, "/v2/bot/richmenu/alias" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.createRichMenuAlias( - // createRichMenuAliasRequest: CreateRichMenuAliasRequest - {} as unknown as CreateRichMenuAliasRequest, // paramName=createRichMenuAliasRequest + + + // createRichMenuAliasRequest: CreateRichMenuAliasRequest + {} as unknown as CreateRichMenuAliasRequest, // paramName=createRichMenuAliasRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("deleteRichMenuWithHttpInfo", async () => { let requestCount = 0; @@ -467,41 +671,58 @@ describe("MessagingApiClient", () => { equal(req.method, "DELETE"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/{richMenuId}".replace("{richMenuId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/{richMenuId}" + .replace("{richMenuId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.deleteRichMenuWithHttpInfo( - // richMenuId: string - "DUMMY", // richMenuId(string) + + + // richMenuId: string + "DUMMY", // richMenuId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("deleteRichMenu", async () => { let requestCount = 0; @@ -510,41 +731,59 @@ describe("MessagingApiClient", () => { equal(req.method, "DELETE"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/{richMenuId}".replace("{richMenuId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/{richMenuId}" + .replace("{richMenuId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.deleteRichMenu( - // richMenuId: string - "DUMMY", // richMenuId(string) + + + // richMenuId: string + "DUMMY", // richMenuId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("deleteRichMenuAliasWithHttpInfo", async () => { let requestCount = 0; @@ -553,44 +792,58 @@ describe("MessagingApiClient", () => { equal(req.method, "DELETE"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/alias/{richMenuAliasId}".replace( - "{richMenuAliasId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/alias/{richMenuAliasId}" + .replace("{richMenuAliasId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.deleteRichMenuAliasWithHttpInfo( - // richMenuAliasId: string - "DUMMY", // richMenuAliasId(string) + + + // richMenuAliasId: string + "DUMMY", // richMenuAliasId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("deleteRichMenuAlias", async () => { let requestCount = 0; @@ -599,44 +852,59 @@ describe("MessagingApiClient", () => { equal(req.method, "DELETE"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/alias/{richMenuAliasId}".replace( - "{richMenuAliasId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/alias/{richMenuAliasId}" + .replace("{richMenuAliasId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.deleteRichMenuAlias( - // richMenuAliasId: string - "DUMMY", // richMenuAliasId(string) + + + // richMenuAliasId: string + "DUMMY", // richMenuAliasId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getAdPhoneMessageStatisticsWithHttpInfo", async () => { let requestCount = 0; @@ -645,51 +913,67 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/delivery/ad_phone".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/delivery/ad_phone" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getAdPhoneMessageStatisticsWithHttpInfo( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getAdPhoneMessageStatistics", async () => { let requestCount = 0; @@ -698,51 +982,68 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/delivery/ad_phone".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/delivery/ad_phone" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getAdPhoneMessageStatistics( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getAggregationUnitNameListWithHttpInfo", async () => { let requestCount = 0; @@ -751,63 +1052,78 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/aggregation/list" - .replace("{limit}", "DUMMY") // string - .replace("{start}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/aggregation/list" + .replace("{limit}", "DUMMY") // string + .replace("{start}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("limit"), - String( - // limit: string - "DUMMY" as unknown as string, // paramName=limit(enum) - ), + equal(queryParams.get("limit"), String( + + // limit: string + "DUMMY" as unknown as string, // paramName=limit(enum) + )); + equal(queryParams.get("start"), String( + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, ); - equal( - queryParams.get("start"), - String( - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) - ), + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getAggregationUnitNameListWithHttpInfo( - // limit: string - "DUMMY" as unknown as string, // paramName=limit(enum) - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) + + // limit: string + "DUMMY" as unknown as string, // paramName=limit(enum) + + + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getAggregationUnitNameList", async () => { let requestCount = 0; @@ -816,63 +1132,79 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/aggregation/list" - .replace("{limit}", "DUMMY") // string - .replace("{start}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/aggregation/list" + .replace("{limit}", "DUMMY") // string + .replace("{start}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("limit"), - String( - // limit: string - "DUMMY" as unknown as string, // paramName=limit(enum) - ), + equal(queryParams.get("limit"), String( + + // limit: string + "DUMMY" as unknown as string, // paramName=limit(enum) + )); + equal(queryParams.get("start"), String( + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, ); - equal( - queryParams.get("start"), - String( - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) - ), + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getAggregationUnitNameList( - // limit: string - "DUMMY" as unknown as string, // paramName=limit(enum) - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) + + // limit: string + "DUMMY" as unknown as string, // paramName=limit(enum) + + + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getAggregationUnitUsageWithHttpInfo", async () => { let requestCount = 0; @@ -881,35 +1213,52 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/aggregation/info"); + equal(reqUrl.pathname, "/v2/bot/message/aggregation/info" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getAggregationUnitUsageWithHttpInfo(); + const res = await client.getAggregationUnitUsageWithHttpInfo( + + ); equal(requestCount, 1); server.close(); }); + + + + it("getAggregationUnitUsage", async () => { let requestCount = 0; @@ -918,35 +1267,53 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/aggregation/info"); + equal(reqUrl.pathname, "/v2/bot/message/aggregation/info" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getAggregationUnitUsage(); + const res = await client.getAggregationUnitUsage( + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getBotInfoWithHttpInfo", async () => { let requestCount = 0; @@ -955,35 +1322,52 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/info"); + equal(reqUrl.pathname, "/v2/bot/info" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getBotInfoWithHttpInfo(); + const res = await client.getBotInfoWithHttpInfo( + + ); equal(requestCount, 1); server.close(); }); + + + + it("getBotInfo", async () => { let requestCount = 0; @@ -992,35 +1376,53 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/info"); + equal(reqUrl.pathname, "/v2/bot/info" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getBotInfo(); + const res = await client.getBotInfo( + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getDefaultRichMenuIdWithHttpInfo", async () => { let requestCount = 0; @@ -1029,35 +1431,52 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/user/all/richmenu"); + equal(reqUrl.pathname, "/v2/bot/user/all/richmenu" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getDefaultRichMenuIdWithHttpInfo(); + const res = await client.getDefaultRichMenuIdWithHttpInfo( + + ); equal(requestCount, 1); server.close(); }); + + + + it("getDefaultRichMenuId", async () => { let requestCount = 0; @@ -1066,35 +1485,53 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/user/all/richmenu"); + equal(reqUrl.pathname, "/v2/bot/user/all/richmenu" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getDefaultRichMenuId(); + const res = await client.getDefaultRichMenuId( + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getFollowersWithHttpInfo", async () => { let requestCount = 0; @@ -1103,63 +1540,78 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/followers/ids" - .replace("{start}", "DUMMY") // string - .replace("{limit}", "0"), // number - ); + equal(reqUrl.pathname, "/v2/bot/followers/ids" + .replace("{start}", "DUMMY") // string + .replace("{limit}", "0") // number + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("start"), - String( - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) - ), - ); - equal( - queryParams.get("limit"), - String( - // limit: number - "DUMMY" as unknown as number, // paramName=limit(enum) - ), - ); + equal(queryParams.get("start"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + )); + equal(queryParams.get("limit"), String( + + // limit: number + "DUMMY" as unknown as number, // paramName=limit(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getFollowersWithHttpInfo( - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) - // limit: number - "DUMMY" as unknown as number, // paramName=limit(enum) + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + + + + // limit: number + "DUMMY" as unknown as number, // paramName=limit(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getFollowers", async () => { let requestCount = 0; @@ -1168,63 +1620,79 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/followers/ids" - .replace("{start}", "DUMMY") // string - .replace("{limit}", "0"), // number - ); + equal(reqUrl.pathname, "/v2/bot/followers/ids" + .replace("{start}", "DUMMY") // string + .replace("{limit}", "0") // number + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("start"), - String( - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) - ), + equal(queryParams.get("start"), String( + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + )); + equal(queryParams.get("limit"), String( + + // limit: number + "DUMMY" as unknown as number, // paramName=limit(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, ); - equal( - queryParams.get("limit"), - String( - // limit: number - "DUMMY" as unknown as number, // paramName=limit(enum) - ), + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getFollowers( - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) - // limit: number - "DUMMY" as unknown as number, // paramName=limit(enum) + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + + + + // limit: number + "DUMMY" as unknown as number, // paramName=limit(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getGroupMemberCountWithHttpInfo", async () => { let requestCount = 0; @@ -1233,41 +1701,58 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/group/{groupId}/members/count".replace("{groupId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/group/{groupId}/members/count" + .replace("{groupId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getGroupMemberCountWithHttpInfo( - // groupId: string - "DUMMY", // groupId(string) + + + // groupId: string + "DUMMY", // groupId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getGroupMemberCount", async () => { let requestCount = 0; @@ -1276,41 +1761,59 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/group/{groupId}/members/count".replace("{groupId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/group/{groupId}/members/count" + .replace("{groupId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getGroupMemberCount( - // groupId: string - "DUMMY", // groupId(string) + + + // groupId: string + "DUMMY", // groupId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getGroupMemberProfileWithHttpInfo", async () => { let requestCount = 0; @@ -1319,46 +1822,64 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/group/{groupId}/member/{userId}" - .replace("{groupId}", "DUMMY") // string - .replace("{userId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/group/{groupId}/member/{userId}" + .replace("{groupId}", "DUMMY") // string + .replace("{userId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getGroupMemberProfileWithHttpInfo( - // groupId: string - "DUMMY", // groupId(string) - // userId: string - "DUMMY", // userId(string) + + // groupId: string + "DUMMY", // groupId(string) + + + + // userId: string + "DUMMY", // userId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getGroupMemberProfile", async () => { let requestCount = 0; @@ -1367,46 +1888,65 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/group/{groupId}/member/{userId}" - .replace("{groupId}", "DUMMY") // string - .replace("{userId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/group/{groupId}/member/{userId}" + .replace("{groupId}", "DUMMY") // string + .replace("{userId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getGroupMemberProfile( - // groupId: string - "DUMMY", // groupId(string) - // userId: string - "DUMMY", // userId(string) + + // groupId: string + "DUMMY", // groupId(string) + + + + // userId: string + "DUMMY", // userId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getGroupMembersIdsWithHttpInfo", async () => { let requestCount = 0; @@ -1415,56 +1955,73 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/group/{groupId}/members/ids" - .replace("{groupId}", "DUMMY") // string - .replace("{start}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/group/{groupId}/members/ids" + .replace("{groupId}", "DUMMY") // string + .replace("{start}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("start"), - String( - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) - ), - ); + equal(queryParams.get("start"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getGroupMembersIdsWithHttpInfo( - // groupId: string - "DUMMY", // groupId(string) - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) + + // groupId: string + "DUMMY", // groupId(string) + + + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getGroupMembersIds", async () => { let requestCount = 0; @@ -1473,56 +2030,74 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/group/{groupId}/members/ids" - .replace("{groupId}", "DUMMY") // string - .replace("{start}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/group/{groupId}/members/ids" + .replace("{groupId}", "DUMMY") // string + .replace("{start}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("start"), - String( - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) - ), - ); + equal(queryParams.get("start"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getGroupMembersIds( - // groupId: string - "DUMMY", // groupId(string) - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) + + // groupId: string + "DUMMY", // groupId(string) + + + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getGroupSummaryWithHttpInfo", async () => { let requestCount = 0; @@ -1531,41 +2106,58 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/group/{groupId}/summary".replace("{groupId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/group/{groupId}/summary" + .replace("{groupId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getGroupSummaryWithHttpInfo( - // groupId: string - "DUMMY", // groupId(string) + + + // groupId: string + "DUMMY", // groupId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getGroupSummary", async () => { let requestCount = 0; @@ -1574,41 +2166,59 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/group/{groupId}/summary".replace("{groupId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/group/{groupId}/summary" + .replace("{groupId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getGroupSummary( - // groupId: string - "DUMMY", // groupId(string) + + + // groupId: string + "DUMMY", // groupId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getMessageQuotaWithHttpInfo", async () => { let requestCount = 0; @@ -1617,35 +2227,52 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/quota"); + equal(reqUrl.pathname, "/v2/bot/message/quota" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getMessageQuotaWithHttpInfo(); + const res = await client.getMessageQuotaWithHttpInfo( + + ); equal(requestCount, 1); server.close(); }); + + + + it("getMessageQuota", async () => { let requestCount = 0; @@ -1654,35 +2281,53 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/quota"); + equal(reqUrl.pathname, "/v2/bot/message/quota" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getMessageQuota(); + const res = await client.getMessageQuota( + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getMessageQuotaConsumptionWithHttpInfo", async () => { let requestCount = 0; @@ -1691,35 +2336,52 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/quota/consumption"); + equal(reqUrl.pathname, "/v2/bot/message/quota/consumption" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getMessageQuotaConsumptionWithHttpInfo(); + const res = await client.getMessageQuotaConsumptionWithHttpInfo( + + ); equal(requestCount, 1); server.close(); }); + + + + it("getMessageQuotaConsumption", async () => { let requestCount = 0; @@ -1728,35 +2390,53 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/quota/consumption"); + equal(reqUrl.pathname, "/v2/bot/message/quota/consumption" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getMessageQuotaConsumption(); + const res = await client.getMessageQuotaConsumption( + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getNarrowcastProgressWithHttpInfo", async () => { let requestCount = 0; @@ -1765,51 +2445,67 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/progress/narrowcast".replace("{requestId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/progress/narrowcast" + .replace("{requestId}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("requestId"), - String( - // requestId: string - "DUMMY" as unknown as string, // paramName=requestId(enum) - ), - ); + equal(queryParams.get("requestId"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // requestId: string + "DUMMY" as unknown as string, // paramName=requestId(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getNarrowcastProgressWithHttpInfo( - // requestId: string - "DUMMY" as unknown as string, // paramName=requestId(enum) + + + // requestId: string + "DUMMY" as unknown as string, // paramName=requestId(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getNarrowcastProgress", async () => { let requestCount = 0; @@ -1818,51 +2514,68 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/progress/narrowcast".replace("{requestId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/progress/narrowcast" + .replace("{requestId}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("requestId"), - String( - // requestId: string - "DUMMY" as unknown as string, // paramName=requestId(enum) - ), - ); + equal(queryParams.get("requestId"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // requestId: string + "DUMMY" as unknown as string, // paramName=requestId(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getNarrowcastProgress( - // requestId: string - "DUMMY" as unknown as string, // paramName=requestId(enum) + + + // requestId: string + "DUMMY" as unknown as string, // paramName=requestId(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getNumberOfSentBroadcastMessagesWithHttpInfo", async () => { let requestCount = 0; @@ -1871,51 +2584,67 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/delivery/broadcast".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/delivery/broadcast" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getNumberOfSentBroadcastMessagesWithHttpInfo( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getNumberOfSentBroadcastMessages", async () => { let requestCount = 0; @@ -1924,51 +2653,68 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/delivery/broadcast".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/delivery/broadcast" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getNumberOfSentBroadcastMessages( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getNumberOfSentMulticastMessagesWithHttpInfo", async () => { let requestCount = 0; @@ -1977,51 +2723,67 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/delivery/multicast".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/delivery/multicast" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getNumberOfSentMulticastMessagesWithHttpInfo( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getNumberOfSentMulticastMessages", async () => { let requestCount = 0; @@ -2030,51 +2792,68 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/delivery/multicast".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/delivery/multicast" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getNumberOfSentMulticastMessages( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getNumberOfSentPushMessagesWithHttpInfo", async () => { let requestCount = 0; @@ -2083,51 +2862,67 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/delivery/push".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/delivery/push" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getNumberOfSentPushMessagesWithHttpInfo( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getNumberOfSentPushMessages", async () => { let requestCount = 0; @@ -2136,51 +2931,68 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/delivery/push".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/delivery/push" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getNumberOfSentPushMessages( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getNumberOfSentReplyMessagesWithHttpInfo", async () => { let requestCount = 0; @@ -2189,51 +3001,67 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/delivery/reply".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/delivery/reply" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getNumberOfSentReplyMessagesWithHttpInfo( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getNumberOfSentReplyMessages", async () => { let requestCount = 0; @@ -2242,51 +3070,68 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/delivery/reply".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/delivery/reply" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getNumberOfSentReplyMessages( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getPNPMessageStatisticsWithHttpInfo", async () => { let requestCount = 0; @@ -2295,51 +3140,67 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/delivery/pnp".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/delivery/pnp" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getPNPMessageStatisticsWithHttpInfo( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getPNPMessageStatistics", async () => { let requestCount = 0; @@ -2348,51 +3209,68 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/delivery/pnp".replace("{date}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/delivery/pnp" + .replace("{date}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("date"), - String( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) - ), - ); + equal(queryParams.get("date"), String( + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + )); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getPNPMessageStatistics( - // date: string - "DUMMY" as unknown as string, // paramName=date(enum) + + + // date: string + "DUMMY" as unknown as string, // paramName=date(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getProfileWithHttpInfo", async () => { let requestCount = 0; @@ -2401,41 +3279,58 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/profile/{userId}".replace("{userId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/profile/{userId}" + .replace("{userId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getProfileWithHttpInfo( - // userId: string - "DUMMY", // userId(string) + + + // userId: string + "DUMMY", // userId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getProfile", async () => { let requestCount = 0; @@ -2444,41 +3339,59 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/profile/{userId}".replace("{userId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/profile/{userId}" + .replace("{userId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getProfile( - // userId: string - "DUMMY", // userId(string) + + + // userId: string + "DUMMY", // userId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getRichMenuWithHttpInfo", async () => { let requestCount = 0; @@ -2487,41 +3400,58 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/{richMenuId}".replace("{richMenuId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/{richMenuId}" + .replace("{richMenuId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRichMenuWithHttpInfo( - // richMenuId: string - "DUMMY", // richMenuId(string) + + + // richMenuId: string + "DUMMY", // richMenuId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getRichMenu", async () => { let requestCount = 0; @@ -2530,41 +3460,59 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/{richMenuId}".replace("{richMenuId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/{richMenuId}" + .replace("{richMenuId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRichMenu( - // richMenuId: string - "DUMMY", // richMenuId(string) + + + // richMenuId: string + "DUMMY", // richMenuId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getRichMenuAliasWithHttpInfo", async () => { let requestCount = 0; @@ -2573,44 +3521,58 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/alias/{richMenuAliasId}".replace( - "{richMenuAliasId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/alias/{richMenuAliasId}" + .replace("{richMenuAliasId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRichMenuAliasWithHttpInfo( - // richMenuAliasId: string - "DUMMY", // richMenuAliasId(string) + + + // richMenuAliasId: string + "DUMMY", // richMenuAliasId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getRichMenuAlias", async () => { let requestCount = 0; @@ -2619,44 +3581,59 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/alias/{richMenuAliasId}".replace( - "{richMenuAliasId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/alias/{richMenuAliasId}" + .replace("{richMenuAliasId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRichMenuAlias( - // richMenuAliasId: string - "DUMMY", // richMenuAliasId(string) + + + // richMenuAliasId: string + "DUMMY", // richMenuAliasId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getRichMenuAliasListWithHttpInfo", async () => { let requestCount = 0; @@ -2665,35 +3642,52 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/alias/list"); + equal(reqUrl.pathname, "/v2/bot/richmenu/alias/list" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getRichMenuAliasListWithHttpInfo(); + const res = await client.getRichMenuAliasListWithHttpInfo( + + ); equal(requestCount, 1); server.close(); }); + + + + it("getRichMenuAliasList", async () => { let requestCount = 0; @@ -2702,35 +3696,53 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/alias/list"); + equal(reqUrl.pathname, "/v2/bot/richmenu/alias/list" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getRichMenuAliasList(); + const res = await client.getRichMenuAliasList( + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getRichMenuBatchProgressWithHttpInfo", async () => { let requestCount = 0; @@ -2739,51 +3751,67 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/progress/batch".replace("{requestId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/progress/batch" + .replace("{requestId}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("requestId"), - String( - // requestId: string - "DUMMY" as unknown as string, // paramName=requestId(enum) - ), - ); + equal(queryParams.get("requestId"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // requestId: string + "DUMMY" as unknown as string, // paramName=requestId(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRichMenuBatchProgressWithHttpInfo( - // requestId: string - "DUMMY" as unknown as string, // paramName=requestId(enum) + + + // requestId: string + "DUMMY" as unknown as string, // paramName=requestId(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getRichMenuBatchProgress", async () => { let requestCount = 0; @@ -2792,51 +3820,68 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/progress/batch".replace("{requestId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/progress/batch" + .replace("{requestId}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("requestId"), - String( - // requestId: string - "DUMMY" as unknown as string, // paramName=requestId(enum) - ), - ); + equal(queryParams.get("requestId"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // requestId: string + "DUMMY" as unknown as string, // paramName=requestId(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRichMenuBatchProgress( - // requestId: string - "DUMMY" as unknown as string, // paramName=requestId(enum) + + + // requestId: string + "DUMMY" as unknown as string, // paramName=requestId(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getRichMenuIdOfUserWithHttpInfo", async () => { let requestCount = 0; @@ -2845,41 +3890,58 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/user/{userId}/richmenu".replace("{userId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/user/{userId}/richmenu" + .replace("{userId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRichMenuIdOfUserWithHttpInfo( - // userId: string - "DUMMY", // userId(string) + + + // userId: string + "DUMMY", // userId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getRichMenuIdOfUser", async () => { let requestCount = 0; @@ -2888,41 +3950,59 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/user/{userId}/richmenu".replace("{userId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/user/{userId}/richmenu" + .replace("{userId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRichMenuIdOfUser( - // userId: string - "DUMMY", // userId(string) + + + // userId: string + "DUMMY", // userId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getRichMenuListWithHttpInfo", async () => { let requestCount = 0; @@ -2931,35 +4011,52 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/list"); + equal(reqUrl.pathname, "/v2/bot/richmenu/list" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getRichMenuListWithHttpInfo(); + const res = await client.getRichMenuListWithHttpInfo( + + ); equal(requestCount, 1); server.close(); }); + + + + it("getRichMenuList", async () => { let requestCount = 0; @@ -2968,35 +4065,53 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/list"); + equal(reqUrl.pathname, "/v2/bot/richmenu/list" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getRichMenuList(); + const res = await client.getRichMenuList( + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getRoomMemberCountWithHttpInfo", async () => { let requestCount = 0; @@ -3005,41 +4120,58 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/room/{roomId}/members/count".replace("{roomId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/room/{roomId}/members/count" + .replace("{roomId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRoomMemberCountWithHttpInfo( - // roomId: string - "DUMMY", // roomId(string) + + + // roomId: string + "DUMMY", // roomId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getRoomMemberCount", async () => { let requestCount = 0; @@ -3048,41 +4180,59 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/room/{roomId}/members/count".replace("{roomId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/room/{roomId}/members/count" + .replace("{roomId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRoomMemberCount( - // roomId: string - "DUMMY", // roomId(string) + + + // roomId: string + "DUMMY", // roomId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getRoomMemberProfileWithHttpInfo", async () => { let requestCount = 0; @@ -3091,46 +4241,64 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/room/{roomId}/member/{userId}" - .replace("{roomId}", "DUMMY") // string - .replace("{userId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/room/{roomId}/member/{userId}" + .replace("{roomId}", "DUMMY") // string + .replace("{userId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRoomMemberProfileWithHttpInfo( - // roomId: string - "DUMMY", // roomId(string) - // userId: string - "DUMMY", // userId(string) + + // roomId: string + "DUMMY", // roomId(string) + + + + // userId: string + "DUMMY", // userId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getRoomMemberProfile", async () => { let requestCount = 0; @@ -3139,46 +4307,65 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/room/{roomId}/member/{userId}" - .replace("{roomId}", "DUMMY") // string - .replace("{userId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/room/{roomId}/member/{userId}" + .replace("{roomId}", "DUMMY") // string + .replace("{userId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRoomMemberProfile( - // roomId: string - "DUMMY", // roomId(string) - // userId: string - "DUMMY", // userId(string) + + // roomId: string + "DUMMY", // roomId(string) + + + + // userId: string + "DUMMY", // userId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getRoomMembersIdsWithHttpInfo", async () => { let requestCount = 0; @@ -3187,56 +4374,73 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/room/{roomId}/members/ids" - .replace("{roomId}", "DUMMY") // string - .replace("{start}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/room/{roomId}/members/ids" + .replace("{roomId}", "DUMMY") // string + .replace("{start}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("start"), - String( - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) - ), - ); + equal(queryParams.get("start"), String( + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + )); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRoomMembersIdsWithHttpInfo( - // roomId: string - "DUMMY", // roomId(string) - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) + + // roomId: string + "DUMMY", // roomId(string) + + + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getRoomMembersIds", async () => { let requestCount = 0; @@ -3245,56 +4449,74 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/room/{roomId}/members/ids" - .replace("{roomId}", "DUMMY") // string - .replace("{start}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/room/{roomId}/members/ids" + .replace("{roomId}", "DUMMY") // string + .replace("{start}", "DUMMY") // string + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("start"), - String( - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) - ), - ); + equal(queryParams.get("start"), String( - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getRoomMembersIds( - // roomId: string - "DUMMY", // roomId(string) - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) + + // roomId: string + "DUMMY", // roomId(string) + + + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getWebhookEndpointWithHttpInfo", async () => { let requestCount = 0; @@ -3303,35 +4525,52 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/channel/webhook/endpoint"); + equal(reqUrl.pathname, "/v2/bot/channel/webhook/endpoint" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getWebhookEndpointWithHttpInfo(); + const res = await client.getWebhookEndpointWithHttpInfo( + + ); equal(requestCount, 1); server.close(); }); + + + + it("getWebhookEndpoint", async () => { let requestCount = 0; @@ -3340,35 +4579,53 @@ describe("MessagingApiClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/channel/webhook/endpoint"); + equal(reqUrl.pathname, "/v2/bot/channel/webhook/endpoint" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); - const res = await client.getWebhookEndpoint(); + const res = await client.getWebhookEndpoint( + + ); equal(requestCount, 1); server.close(); }); + + + + + it("issueLinkTokenWithHttpInfo", async () => { let requestCount = 0; @@ -3377,41 +4634,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/user/{userId}/linkToken".replace("{userId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/user/{userId}/linkToken" + .replace("{userId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.issueLinkTokenWithHttpInfo( - // userId: string - "DUMMY", // userId(string) + + + // userId: string + "DUMMY", // userId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("issueLinkToken", async () => { let requestCount = 0; @@ -3420,41 +4694,59 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/user/{userId}/linkToken".replace("{userId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/user/{userId}/linkToken" + .replace("{userId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.issueLinkToken( - // userId: string - "DUMMY", // userId(string) + + + // userId: string + "DUMMY", // userId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("leaveGroupWithHttpInfo", async () => { let requestCount = 0; @@ -3463,41 +4755,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/group/{groupId}/leave".replace("{groupId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/group/{groupId}/leave" + .replace("{groupId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.leaveGroupWithHttpInfo( - // groupId: string - "DUMMY", // groupId(string) + + + // groupId: string + "DUMMY", // groupId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("leaveGroup", async () => { let requestCount = 0; @@ -3506,41 +4815,59 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/group/{groupId}/leave".replace("{groupId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/group/{groupId}/leave" + .replace("{groupId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.leaveGroup( - // groupId: string - "DUMMY", // groupId(string) + + + // groupId: string + "DUMMY", // groupId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("leaveRoomWithHttpInfo", async () => { let requestCount = 0; @@ -3549,41 +4876,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/room/{roomId}/leave".replace("{roomId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/room/{roomId}/leave" + .replace("{roomId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.leaveRoomWithHttpInfo( - // roomId: string - "DUMMY", // roomId(string) + + + // roomId: string + "DUMMY", // roomId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("leaveRoom", async () => { let requestCount = 0; @@ -3592,41 +4936,59 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/room/{roomId}/leave".replace("{roomId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/room/{roomId}/leave" + .replace("{roomId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.leaveRoom( - // roomId: string - "DUMMY", // roomId(string) + + + // roomId: string + "DUMMY", // roomId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("linkRichMenuIdToUserWithHttpInfo", async () => { let requestCount = 0; @@ -3635,46 +4997,64 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/user/{userId}/richmenu/{richMenuId}" - .replace("{userId}", "DUMMY") // string - .replace("{richMenuId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/user/{userId}/richmenu/{richMenuId}" + .replace("{userId}", "DUMMY") // string + .replace("{richMenuId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.linkRichMenuIdToUserWithHttpInfo( - // userId: string - "DUMMY", // userId(string) - // richMenuId: string - "DUMMY", // richMenuId(string) + + // userId: string + "DUMMY", // userId(string) + + + + // richMenuId: string + "DUMMY", // richMenuId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("linkRichMenuIdToUser", async () => { let requestCount = 0; @@ -3683,46 +5063,65 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/user/{userId}/richmenu/{richMenuId}" - .replace("{userId}", "DUMMY") // string - .replace("{richMenuId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/user/{userId}/richmenu/{richMenuId}" + .replace("{userId}", "DUMMY") // string + .replace("{richMenuId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.linkRichMenuIdToUser( - // userId: string - "DUMMY", // userId(string) - // richMenuId: string - "DUMMY", // richMenuId(string) + + // userId: string + "DUMMY", // userId(string) + + + + // richMenuId: string + "DUMMY", // richMenuId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("linkRichMenuIdToUsersWithHttpInfo", async () => { let requestCount = 0; @@ -3731,38 +5130,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/bulk/link"); + equal(reqUrl.pathname, "/v2/bot/richmenu/bulk/link" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.linkRichMenuIdToUsersWithHttpInfo( - // richMenuBulkLinkRequest: RichMenuBulkLinkRequest - {} as unknown as RichMenuBulkLinkRequest, // paramName=richMenuBulkLinkRequest + + + // richMenuBulkLinkRequest: RichMenuBulkLinkRequest + {} as unknown as RichMenuBulkLinkRequest, // paramName=richMenuBulkLinkRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("linkRichMenuIdToUsers", async () => { let requestCount = 0; @@ -3771,38 +5189,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/bulk/link"); + equal(reqUrl.pathname, "/v2/bot/richmenu/bulk/link" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.linkRichMenuIdToUsers( - // richMenuBulkLinkRequest: RichMenuBulkLinkRequest - {} as unknown as RichMenuBulkLinkRequest, // paramName=richMenuBulkLinkRequest + + + // richMenuBulkLinkRequest: RichMenuBulkLinkRequest + {} as unknown as RichMenuBulkLinkRequest, // paramName=richMenuBulkLinkRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("markMessagesAsReadWithHttpInfo", async () => { let requestCount = 0; @@ -3811,38 +5249,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/markAsRead"); + equal(reqUrl.pathname, "/v2/bot/message/markAsRead" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.markMessagesAsReadWithHttpInfo( - // markMessagesAsReadRequest: MarkMessagesAsReadRequest - {} as unknown as MarkMessagesAsReadRequest, // paramName=markMessagesAsReadRequest + + + // markMessagesAsReadRequest: MarkMessagesAsReadRequest + {} as unknown as MarkMessagesAsReadRequest, // paramName=markMessagesAsReadRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("markMessagesAsRead", async () => { let requestCount = 0; @@ -3851,38 +5308,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/markAsRead"); + equal(reqUrl.pathname, "/v2/bot/message/markAsRead" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.markMessagesAsRead( - // markMessagesAsReadRequest: MarkMessagesAsReadRequest - {} as unknown as MarkMessagesAsReadRequest, // paramName=markMessagesAsReadRequest + + + // markMessagesAsReadRequest: MarkMessagesAsReadRequest + {} as unknown as MarkMessagesAsReadRequest, // paramName=markMessagesAsReadRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("multicastWithHttpInfo", async () => { let requestCount = 0; @@ -3891,44 +5368,63 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/multicast".replace("{xLineRetryKey}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/multicast" + .replace("{xLineRetryKey}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.multicastWithHttpInfo( - // multicastRequest: MulticastRequest - {} as unknown as MulticastRequest, // paramName=multicastRequest - // xLineRetryKey: string - "DUMMY", // xLineRetryKey(string) + + // multicastRequest: MulticastRequest + {} as unknown as MulticastRequest, // paramName=multicastRequest + + + + // xLineRetryKey: string + "DUMMY", // xLineRetryKey(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("multicast", async () => { let requestCount = 0; @@ -3937,44 +5433,64 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/multicast".replace("{xLineRetryKey}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/multicast" + .replace("{xLineRetryKey}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.multicast( - // multicastRequest: MulticastRequest - {} as unknown as MulticastRequest, // paramName=multicastRequest - // xLineRetryKey: string - "DUMMY", // xLineRetryKey(string) + + // multicastRequest: MulticastRequest + {} as unknown as MulticastRequest, // paramName=multicastRequest + + + + // xLineRetryKey: string + "DUMMY", // xLineRetryKey(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("narrowcastWithHttpInfo", async () => { let requestCount = 0; @@ -3983,44 +5499,63 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/narrowcast".replace("{xLineRetryKey}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/narrowcast" + .replace("{xLineRetryKey}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.narrowcastWithHttpInfo( - // narrowcastRequest: NarrowcastRequest - {} as unknown as NarrowcastRequest, // paramName=narrowcastRequest - // xLineRetryKey: string - "DUMMY", // xLineRetryKey(string) + + // narrowcastRequest: NarrowcastRequest + {} as unknown as NarrowcastRequest, // paramName=narrowcastRequest + + + + // xLineRetryKey: string + "DUMMY", // xLineRetryKey(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("narrowcast", async () => { let requestCount = 0; @@ -4029,44 +5564,64 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/narrowcast".replace("{xLineRetryKey}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/narrowcast" + .replace("{xLineRetryKey}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.narrowcast( - // narrowcastRequest: NarrowcastRequest - {} as unknown as NarrowcastRequest, // paramName=narrowcastRequest - // xLineRetryKey: string - "DUMMY", // xLineRetryKey(string) + + // narrowcastRequest: NarrowcastRequest + {} as unknown as NarrowcastRequest, // paramName=narrowcastRequest + + + + // xLineRetryKey: string + "DUMMY", // xLineRetryKey(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("pushMessageWithHttpInfo", async () => { let requestCount = 0; @@ -4075,44 +5630,63 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/push".replace("{xLineRetryKey}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/push" + .replace("{xLineRetryKey}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.pushMessageWithHttpInfo( - // pushMessageRequest: PushMessageRequest - {} as unknown as PushMessageRequest, // paramName=pushMessageRequest - // xLineRetryKey: string - "DUMMY", // xLineRetryKey(string) + + // pushMessageRequest: PushMessageRequest + {} as unknown as PushMessageRequest, // paramName=pushMessageRequest + + + + // xLineRetryKey: string + "DUMMY", // xLineRetryKey(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("pushMessage", async () => { let requestCount = 0; @@ -4121,44 +5695,64 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/message/push".replace("{xLineRetryKey}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/message/push" + .replace("{xLineRetryKey}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.pushMessage( - // pushMessageRequest: PushMessageRequest - {} as unknown as PushMessageRequest, // paramName=pushMessageRequest - // xLineRetryKey: string - "DUMMY", // xLineRetryKey(string) + + // pushMessageRequest: PushMessageRequest + {} as unknown as PushMessageRequest, // paramName=pushMessageRequest + + + + // xLineRetryKey: string + "DUMMY", // xLineRetryKey(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("pushMessagesByPhoneWithHttpInfo", async () => { let requestCount = 0; @@ -4167,44 +5761,63 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/bot/pnp/push".replace("{xLineDeliveryTag}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/bot/pnp/push" + .replace("{xLineDeliveryTag}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.pushMessagesByPhoneWithHttpInfo( - // pnpMessagesRequest: PnpMessagesRequest - {} as unknown as PnpMessagesRequest, // paramName=pnpMessagesRequest - // xLineDeliveryTag: string - "DUMMY", // xLineDeliveryTag(string) + + // pnpMessagesRequest: PnpMessagesRequest + {} as unknown as PnpMessagesRequest, // paramName=pnpMessagesRequest + + + + // xLineDeliveryTag: string + "DUMMY", // xLineDeliveryTag(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("pushMessagesByPhone", async () => { let requestCount = 0; @@ -4213,44 +5826,64 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/bot/pnp/push".replace("{xLineDeliveryTag}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/bot/pnp/push" + .replace("{xLineDeliveryTag}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.pushMessagesByPhone( - // pnpMessagesRequest: PnpMessagesRequest - {} as unknown as PnpMessagesRequest, // paramName=pnpMessagesRequest - // xLineDeliveryTag: string - "DUMMY", // xLineDeliveryTag(string) + + // pnpMessagesRequest: PnpMessagesRequest + {} as unknown as PnpMessagesRequest, // paramName=pnpMessagesRequest + + + + // xLineDeliveryTag: string + "DUMMY", // xLineDeliveryTag(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("replyMessageWithHttpInfo", async () => { let requestCount = 0; @@ -4259,38 +5892,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/reply"); + equal(reqUrl.pathname, "/v2/bot/message/reply" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.replyMessageWithHttpInfo( - // replyMessageRequest: ReplyMessageRequest - {} as unknown as ReplyMessageRequest, // paramName=replyMessageRequest + + + // replyMessageRequest: ReplyMessageRequest + {} as unknown as ReplyMessageRequest, // paramName=replyMessageRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("replyMessage", async () => { let requestCount = 0; @@ -4299,38 +5951,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/reply"); + equal(reqUrl.pathname, "/v2/bot/message/reply" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.replyMessage( - // replyMessageRequest: ReplyMessageRequest - {} as unknown as ReplyMessageRequest, // paramName=replyMessageRequest + + + // replyMessageRequest: ReplyMessageRequest + {} as unknown as ReplyMessageRequest, // paramName=replyMessageRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("richMenuBatchWithHttpInfo", async () => { let requestCount = 0; @@ -4339,38 +6011,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/batch"); + equal(reqUrl.pathname, "/v2/bot/richmenu/batch" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.richMenuBatchWithHttpInfo( - // richMenuBatchRequest: RichMenuBatchRequest - {} as unknown as RichMenuBatchRequest, // paramName=richMenuBatchRequest + + + // richMenuBatchRequest: RichMenuBatchRequest + {} as unknown as RichMenuBatchRequest, // paramName=richMenuBatchRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("richMenuBatch", async () => { let requestCount = 0; @@ -4379,38 +6070,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/batch"); + equal(reqUrl.pathname, "/v2/bot/richmenu/batch" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.richMenuBatch( - // richMenuBatchRequest: RichMenuBatchRequest - {} as unknown as RichMenuBatchRequest, // paramName=richMenuBatchRequest + + + // richMenuBatchRequest: RichMenuBatchRequest + {} as unknown as RichMenuBatchRequest, // paramName=richMenuBatchRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("setDefaultRichMenuWithHttpInfo", async () => { let requestCount = 0; @@ -4419,44 +6130,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/user/all/richmenu/{richMenuId}".replace( - "{richMenuId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/user/all/richmenu/{richMenuId}" + .replace("{richMenuId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.setDefaultRichMenuWithHttpInfo( - // richMenuId: string - "DUMMY", // richMenuId(string) + + + // richMenuId: string + "DUMMY", // richMenuId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("setDefaultRichMenu", async () => { let requestCount = 0; @@ -4465,44 +6190,59 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/user/all/richmenu/{richMenuId}".replace( - "{richMenuId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/user/all/richmenu/{richMenuId}" + .replace("{richMenuId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.setDefaultRichMenu( - // richMenuId: string - "DUMMY", // richMenuId(string) + + + // richMenuId: string + "DUMMY", // richMenuId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("setWebhookEndpointWithHttpInfo", async () => { let requestCount = 0; @@ -4511,38 +6251,57 @@ describe("MessagingApiClient", () => { equal(req.method, "PUT"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/channel/webhook/endpoint"); + equal(reqUrl.pathname, "/v2/bot/channel/webhook/endpoint" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.setWebhookEndpointWithHttpInfo( - // setWebhookEndpointRequest: SetWebhookEndpointRequest - {} as unknown as SetWebhookEndpointRequest, // paramName=setWebhookEndpointRequest + + + // setWebhookEndpointRequest: SetWebhookEndpointRequest + {} as unknown as SetWebhookEndpointRequest, // paramName=setWebhookEndpointRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("setWebhookEndpoint", async () => { let requestCount = 0; @@ -4551,38 +6310,58 @@ describe("MessagingApiClient", () => { equal(req.method, "PUT"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/channel/webhook/endpoint"); + equal(reqUrl.pathname, "/v2/bot/channel/webhook/endpoint" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.setWebhookEndpoint( - // setWebhookEndpointRequest: SetWebhookEndpointRequest - {} as unknown as SetWebhookEndpointRequest, // paramName=setWebhookEndpointRequest + + + // setWebhookEndpointRequest: SetWebhookEndpointRequest + {} as unknown as SetWebhookEndpointRequest, // paramName=setWebhookEndpointRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("testWebhookEndpointWithHttpInfo", async () => { let requestCount = 0; @@ -4591,38 +6370,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/channel/webhook/test"); + equal(reqUrl.pathname, "/v2/bot/channel/webhook/test" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.testWebhookEndpointWithHttpInfo( - // testWebhookEndpointRequest: TestWebhookEndpointRequest - {} as unknown as TestWebhookEndpointRequest, // paramName=testWebhookEndpointRequest + + + // testWebhookEndpointRequest: TestWebhookEndpointRequest + {} as unknown as TestWebhookEndpointRequest, // paramName=testWebhookEndpointRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("testWebhookEndpoint", async () => { let requestCount = 0; @@ -4631,38 +6429,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/channel/webhook/test"); + equal(reqUrl.pathname, "/v2/bot/channel/webhook/test" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.testWebhookEndpoint( - // testWebhookEndpointRequest: TestWebhookEndpointRequest - {} as unknown as TestWebhookEndpointRequest, // paramName=testWebhookEndpointRequest + + + // testWebhookEndpointRequest: TestWebhookEndpointRequest + {} as unknown as TestWebhookEndpointRequest, // paramName=testWebhookEndpointRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("unlinkRichMenuIdFromUserWithHttpInfo", async () => { let requestCount = 0; @@ -4671,41 +6489,58 @@ describe("MessagingApiClient", () => { equal(req.method, "DELETE"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/user/{userId}/richmenu".replace("{userId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/user/{userId}/richmenu" + .replace("{userId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.unlinkRichMenuIdFromUserWithHttpInfo( - // userId: string - "DUMMY", // userId(string) + + + // userId: string + "DUMMY", // userId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("unlinkRichMenuIdFromUser", async () => { let requestCount = 0; @@ -4714,41 +6549,59 @@ describe("MessagingApiClient", () => { equal(req.method, "DELETE"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/user/{userId}/richmenu".replace("{userId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/user/{userId}/richmenu" + .replace("{userId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.unlinkRichMenuIdFromUser( - // userId: string - "DUMMY", // userId(string) + + + // userId: string + "DUMMY", // userId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("unlinkRichMenuIdFromUsersWithHttpInfo", async () => { let requestCount = 0; @@ -4757,38 +6610,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/bulk/unlink"); + equal(reqUrl.pathname, "/v2/bot/richmenu/bulk/unlink" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.unlinkRichMenuIdFromUsersWithHttpInfo( - // richMenuBulkUnlinkRequest: RichMenuBulkUnlinkRequest - {} as unknown as RichMenuBulkUnlinkRequest, // paramName=richMenuBulkUnlinkRequest + + + // richMenuBulkUnlinkRequest: RichMenuBulkUnlinkRequest + {} as unknown as RichMenuBulkUnlinkRequest, // paramName=richMenuBulkUnlinkRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("unlinkRichMenuIdFromUsers", async () => { let requestCount = 0; @@ -4797,38 +6669,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/bulk/unlink"); + equal(reqUrl.pathname, "/v2/bot/richmenu/bulk/unlink" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.unlinkRichMenuIdFromUsers( - // richMenuBulkUnlinkRequest: RichMenuBulkUnlinkRequest - {} as unknown as RichMenuBulkUnlinkRequest, // paramName=richMenuBulkUnlinkRequest + + + // richMenuBulkUnlinkRequest: RichMenuBulkUnlinkRequest + {} as unknown as RichMenuBulkUnlinkRequest, // paramName=richMenuBulkUnlinkRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("updateRichMenuAliasWithHttpInfo", async () => { let requestCount = 0; @@ -4837,47 +6729,63 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/alias/{richMenuAliasId}".replace( - "{richMenuAliasId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/alias/{richMenuAliasId}" + .replace("{richMenuAliasId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.updateRichMenuAliasWithHttpInfo( - // richMenuAliasId: string - "DUMMY", // richMenuAliasId(string) - // updateRichMenuAliasRequest: UpdateRichMenuAliasRequest - {} as unknown as UpdateRichMenuAliasRequest, // paramName=updateRichMenuAliasRequest + + // richMenuAliasId: string + "DUMMY", // richMenuAliasId(string) + + + + // updateRichMenuAliasRequest: UpdateRichMenuAliasRequest + {} as unknown as UpdateRichMenuAliasRequest, // paramName=updateRichMenuAliasRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("updateRichMenuAlias", async () => { let requestCount = 0; @@ -4886,47 +6794,64 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/richmenu/alias/{richMenuAliasId}".replace( - "{richMenuAliasId}", - "DUMMY", - ), // string - ); + equal(reqUrl.pathname, "/v2/bot/richmenu/alias/{richMenuAliasId}" + .replace("{richMenuAliasId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.updateRichMenuAlias( - // richMenuAliasId: string - "DUMMY", // richMenuAliasId(string) - // updateRichMenuAliasRequest: UpdateRichMenuAliasRequest - {} as unknown as UpdateRichMenuAliasRequest, // paramName=updateRichMenuAliasRequest + + // richMenuAliasId: string + "DUMMY", // richMenuAliasId(string) + + + + // updateRichMenuAliasRequest: UpdateRichMenuAliasRequest + {} as unknown as UpdateRichMenuAliasRequest, // paramName=updateRichMenuAliasRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("validateBroadcastWithHttpInfo", async () => { let requestCount = 0; @@ -4935,38 +6860,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/validate/broadcast"); + equal(reqUrl.pathname, "/v2/bot/message/validate/broadcast" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.validateBroadcastWithHttpInfo( - // validateMessageRequest: ValidateMessageRequest - {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + + // validateMessageRequest: ValidateMessageRequest + {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("validateBroadcast", async () => { let requestCount = 0; @@ -4975,38 +6919,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/validate/broadcast"); + equal(reqUrl.pathname, "/v2/bot/message/validate/broadcast" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.validateBroadcast( - // validateMessageRequest: ValidateMessageRequest - {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + + // validateMessageRequest: ValidateMessageRequest + {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("validateMulticastWithHttpInfo", async () => { let requestCount = 0; @@ -5015,38 +6979,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/validate/multicast"); + equal(reqUrl.pathname, "/v2/bot/message/validate/multicast" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.validateMulticastWithHttpInfo( - // validateMessageRequest: ValidateMessageRequest - {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + + // validateMessageRequest: ValidateMessageRequest + {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("validateMulticast", async () => { let requestCount = 0; @@ -5055,38 +7038,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/validate/multicast"); + equal(reqUrl.pathname, "/v2/bot/message/validate/multicast" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.validateMulticast( - // validateMessageRequest: ValidateMessageRequest - {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + + // validateMessageRequest: ValidateMessageRequest + {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("validateNarrowcastWithHttpInfo", async () => { let requestCount = 0; @@ -5095,38 +7098,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/validate/narrowcast"); + equal(reqUrl.pathname, "/v2/bot/message/validate/narrowcast" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.validateNarrowcastWithHttpInfo( - // validateMessageRequest: ValidateMessageRequest - {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + + // validateMessageRequest: ValidateMessageRequest + {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("validateNarrowcast", async () => { let requestCount = 0; @@ -5135,38 +7157,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/validate/narrowcast"); + equal(reqUrl.pathname, "/v2/bot/message/validate/narrowcast" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.validateNarrowcast( - // validateMessageRequest: ValidateMessageRequest - {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + + // validateMessageRequest: ValidateMessageRequest + {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("validatePushWithHttpInfo", async () => { let requestCount = 0; @@ -5175,38 +7217,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/validate/push"); + equal(reqUrl.pathname, "/v2/bot/message/validate/push" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.validatePushWithHttpInfo( - // validateMessageRequest: ValidateMessageRequest - {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + + // validateMessageRequest: ValidateMessageRequest + {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("validatePush", async () => { let requestCount = 0; @@ -5215,38 +7276,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/validate/push"); + equal(reqUrl.pathname, "/v2/bot/message/validate/push" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.validatePush( - // validateMessageRequest: ValidateMessageRequest - {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + + // validateMessageRequest: ValidateMessageRequest + {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("validateReplyWithHttpInfo", async () => { let requestCount = 0; @@ -5255,38 +7336,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/validate/reply"); + equal(reqUrl.pathname, "/v2/bot/message/validate/reply" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.validateReplyWithHttpInfo( - // validateMessageRequest: ValidateMessageRequest - {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + + // validateMessageRequest: ValidateMessageRequest + {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("validateReply", async () => { let requestCount = 0; @@ -5295,38 +7395,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/message/validate/reply"); + equal(reqUrl.pathname, "/v2/bot/message/validate/reply" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.validateReply( - // validateMessageRequest: ValidateMessageRequest - {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + + // validateMessageRequest: ValidateMessageRequest + {} as unknown as ValidateMessageRequest, // paramName=validateMessageRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("validateRichMenuBatchRequestWithHttpInfo", async () => { let requestCount = 0; @@ -5335,38 +7455,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/validate/batch"); + equal(reqUrl.pathname, "/v2/bot/richmenu/validate/batch" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.validateRichMenuBatchRequestWithHttpInfo( - // richMenuBatchRequest: RichMenuBatchRequest - {} as unknown as RichMenuBatchRequest, // paramName=richMenuBatchRequest + + + // richMenuBatchRequest: RichMenuBatchRequest + {} as unknown as RichMenuBatchRequest, // paramName=richMenuBatchRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("validateRichMenuBatchRequest", async () => { let requestCount = 0; @@ -5375,38 +7514,58 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/validate/batch"); + equal(reqUrl.pathname, "/v2/bot/richmenu/validate/batch" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.validateRichMenuBatchRequest( - // richMenuBatchRequest: RichMenuBatchRequest - {} as unknown as RichMenuBatchRequest, // paramName=richMenuBatchRequest + + + // richMenuBatchRequest: RichMenuBatchRequest + {} as unknown as RichMenuBatchRequest, // paramName=richMenuBatchRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("validateRichMenuObjectWithHttpInfo", async () => { let requestCount = 0; @@ -5415,38 +7574,57 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/validate"); + equal(reqUrl.pathname, "/v2/bot/richmenu/validate" + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.validateRichMenuObjectWithHttpInfo( - // richMenuRequest: RichMenuRequest - {} as unknown as RichMenuRequest, // paramName=richMenuRequest + + + // richMenuRequest: RichMenuRequest + {} as unknown as RichMenuRequest, // paramName=richMenuRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("validateRichMenuObject", async () => { let requestCount = 0; @@ -5455,35 +7633,53 @@ describe("MessagingApiClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/richmenu/validate"); + equal(reqUrl.pathname, "/v2/bot/richmenu/validate" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new MessagingApiClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.validateRichMenuObject( - // richMenuRequest: RichMenuRequest - {} as unknown as RichMenuRequest, // paramName=richMenuRequest + + + // richMenuRequest: RichMenuRequest + {} as unknown as RichMenuRequest, // paramName=richMenuRequest + + ); equal(requestCount, 1); server.close(); }); + + + }); diff --git a/lib/middleware.ts b/lib/middleware.ts index d34d56e22..2b56a9f6a 100644 --- a/lib/middleware.ts +++ b/lib/middleware.ts @@ -1,7 +1,7 @@ import * as http from "node:http"; -import { JSONParseError, SignatureValidationFailed } from "./exceptions"; -import * as Types from "./types"; -import validateSignature from "./validate-signature"; +import { JSONParseError, SignatureValidationFailed } from "./exceptions.js"; +import * as Types from "./types.js"; +import validateSignature from "./validate-signature.js"; export type Request = http.IncomingMessage & { body: any }; export type Response = http.ServerResponse; diff --git a/lib/module-attach/api.ts b/lib/module-attach/api.ts index eeedcdab6..048a59bd5 100644 --- a/lib/module-attach/api.ts +++ b/lib/module-attach/api.ts @@ -1,3 +1,3 @@ // This is the entrypoint for the package -export * from "./api/apis"; -export * from "./model/models"; +export * from './api/apis.js'; +export * from './model/models.js'; diff --git a/lib/module-attach/api/apis.ts b/lib/module-attach/api/apis.ts index bb09d6851..09d3276d7 100644 --- a/lib/module-attach/api/apis.ts +++ b/lib/module-attach/api/apis.ts @@ -1 +1,3 @@ -export { LineModuleAttachClient } from "./lineModuleAttachClient"; + +export { LineModuleAttachClient } from './lineModuleAttachClient.js'; + diff --git a/lib/module-attach/api/lineModuleAttachClient.ts b/lib/module-attach/api/lineModuleAttachClient.ts index 8b9eb4f07..322d578f1 100644 --- a/lib/module-attach/api/lineModuleAttachClient.ts +++ b/lib/module-attach/api/lineModuleAttachClient.ts @@ -1,3 +1,5 @@ + + /** * LINE Messaging API * This document describes LINE Messaging API. @@ -10,146 +12,127 @@ * Do not edit the class manually. */ + /* tslint:disable:no-unused-locals */ -import { AttachModuleResponse } from "../model/attachModuleResponse"; +import { AttachModuleResponse } from '../model/attachModuleResponse.js'; -import * as Types from "../../types"; -import { ensureJSON } from "../../utils"; -import { Readable } from "node:stream"; +import * as Types from "../../types.js"; +import {ensureJSON} from "../../utils.js"; +import {Readable} from "node:stream"; -import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch"; +import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch.js"; // =============================================== // This file is autogenerated - Please do not edit // =============================================== interface httpClientConfig { - baseURL?: string; - channelAccessToken: string; - // TODO support defaultHeaders? + baseURL?: string; + channelAccessToken: string; + // TODO support defaultHeaders? } + export class LineModuleAttachClient { - private httpClient: HTTPFetchClient; + private httpClient: HTTPFetchClient; - constructor(config: httpClientConfig) { - if (!config.baseURL) { - config.baseURL = "https://manager.line.biz"; + constructor(config: httpClientConfig) { + if (!config.baseURL) { + config.baseURL = 'https://manager.line.biz'; + } + this.httpClient = new HTTPFetchClient({ + defaultHeaders: { + Authorization: "Bearer " + config.channelAccessToken, + }, + baseURL: config.baseURL, + }); } - this.httpClient = new HTTPFetchClient({ - defaultHeaders: { - Authorization: "Bearer " + config.channelAccessToken, - }, - baseURL: config.baseURL, - }); - } - - private async parseHTTPResponse(response: Response) { - const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; - let resBody: Record = { - ...(await response.json()), - }; - if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { - resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = response.headers.get( - LINE_REQUEST_ID_HTTP_HEADER_NAME, - ); + + private async parseHTTPResponse(response: Response) { + const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; + let resBody: Record = { + ...await response.json(), + }; + if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { + resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = + response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME); + } + return resBody; } - return resBody; - } - - /** - * Attach by operation of the module channel provider - * @param grantType authorization_code - * @param code Authorization code received from the LINE Platform. - * @param redirectUri Specify the redirect_uri specified in the URL for authentication and authorization. - * @param codeVerifier Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks. - * @param clientId Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. - * @param clientSecret Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. - * @param region If you specified a value for region in the URL for authentication and authorization, specify the same value. - * @param basicSearchId If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value. - * @param scope If you specified a value for scope in the URL for authentication and authorization, specify the same value. - * @param brandType If you specified a value for brand_type in the URL for authentication and authorization, specify the same value. - * - * @see Documentation - */ - public async attachModule( - grantType?: string, - code?: string, - redirectUri?: string, - codeVerifier?: string, - clientId?: string, - clientSecret?: string, - region?: string, - basicSearchId?: string, - scope?: string, - brandType?: string, - ): Promise { - return ( - await this.attachModuleWithHttpInfo( - grantType, - code, - redirectUri, - codeVerifier, - clientId, - clientSecret, - region, - basicSearchId, - scope, - brandType, - ) - ).body; - } - - /** - * Attach by operation of the module channel provider. - * This method includes HttpInfo object to return additional information. - * @param grantType authorization_code - * @param code Authorization code received from the LINE Platform. - * @param redirectUri Specify the redirect_uri specified in the URL for authentication and authorization. - * @param codeVerifier Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks. - * @param clientId Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. - * @param clientSecret Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. - * @param region If you specified a value for region in the URL for authentication and authorization, specify the same value. - * @param basicSearchId If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value. - * @param scope If you specified a value for scope in the URL for authentication and authorization, specify the same value. - * @param brandType If you specified a value for brand_type in the URL for authentication and authorization, specify the same value. - * - * @see Documentation - */ - public async attachModuleWithHttpInfo( - grantType?: string, - code?: string, - redirectUri?: string, - codeVerifier?: string, - clientId?: string, - clientSecret?: string, - region?: string, - basicSearchId?: string, - scope?: string, - brandType?: string, - ): Promise> { + +/** + * Attach by operation of the module channel provider + * @param grantType authorization_code + * @param code Authorization code received from the LINE Platform. + * @param redirectUri Specify the redirect_uri specified in the URL for authentication and authorization. + * @param codeVerifier Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks. + * @param clientId Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. + * @param clientSecret Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. + * @param region If you specified a value for region in the URL for authentication and authorization, specify the same value. + * @param basicSearchId If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value. + * @param scope If you specified a value for scope in the URL for authentication and authorization, specify the same value. + * @param brandType If you specified a value for brand_type in the URL for authentication and authorization, specify the same value. + * + * @see Documentation + */ + public async attachModule(grantType?: string, code?: string, redirectUri?: string, codeVerifier?: string, clientId?: string, clientSecret?: string, region?: string, basicSearchId?: string, scope?: string, brandType?: string, ) : Promise { + return (await this.attachModuleWithHttpInfo(grantType, code, redirectUri, codeVerifier, clientId, clientSecret, region, basicSearchId, scope, brandType, )).body; + } + + /** + * Attach by operation of the module channel provider. + * This method includes HttpInfo object to return additional information. + * @param grantType authorization_code + * @param code Authorization code received from the LINE Platform. + * @param redirectUri Specify the redirect_uri specified in the URL for authentication and authorization. + * @param codeVerifier Specify when using PKCE (Proof Key for Code Exchange) defined in the OAuth 2.0 extension specification as a countermeasure against authorization code interception attacks. + * @param clientId Instead of using Authorization header, you can use this parameter to specify the channel ID of the module channel. You can find the channel ID of the module channel in the LINE Developers Console. + * @param clientSecret Instead of using Authorization header, you can use this parameter to specify the channel secret of the module channel. You can find the channel secret of the module channel in the LINE Developers Console. + * @param region If you specified a value for region in the URL for authentication and authorization, specify the same value. + * @param basicSearchId If you specified a value for basic_search_id in the URL for authentication and authorization, specify the same value. + * @param scope If you specified a value for scope in the URL for authentication and authorization, specify the same value. + * @param brandType If you specified a value for brand_type in the URL for authentication and authorization, specify the same value. + * + * @see Documentation + */ + public async attachModuleWithHttpInfo(grantType?: string, code?: string, redirectUri?: string, codeVerifier?: string, clientId?: string, clientSecret?: string, region?: string, basicSearchId?: string, scope?: string, brandType?: string, ) : Promise> { + + + + const formParams = { - grant_type: grantType, - code: code, - redirect_uri: redirectUri, - code_verifier: codeVerifier, - client_id: clientId, - client_secret: clientSecret, - region: region, - basic_search_id: basicSearchId, - scope: scope, - brand_type: brandType, - }; - Object.keys(formParams).forEach((key: keyof typeof formParams) => { - if (formParams[key] === undefined) { - delete formParams[key]; - } - }); - - const res = await this.httpClient.postForm( - "/module/auth/v1/token", - formParams, - ); - return { httpResponse: res, body: await res.json() }; - } + "grant_type": grantType, + "code": code, + "redirect_uri": redirectUri, + "code_verifier": codeVerifier, + "client_id": clientId, + "client_secret": clientSecret, + "region": region, + "basic_search_id": basicSearchId, + "scope": scope, + "brand_type": brandType, + + }; + Object.keys(formParams).forEach((key: keyof typeof formParams) => { + if (formParams[key] === undefined) { + delete formParams[key]; + } + }); + + + + const res = await this.httpClient.postForm( + "/module/auth/v1/token" + , + + formParams, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } + } diff --git a/lib/module-attach/model/attachModuleResponse.ts b/lib/module-attach/model/attachModuleResponse.ts index 0a8ec25d6..d00b6cf97 100644 --- a/lib/module-attach/model/attachModuleResponse.ts +++ b/lib/module-attach/model/attachModuleResponse.ts @@ -10,16 +10,29 @@ * Do not edit the class manually. */ + + + + + /** * Attach by operation of the module channel provider */ -export type AttachModuleResponse = { - /** - * User ID of the bot on the LINE Official Account. - */ - botId: string /**/; - /** - * Permissions (scope) granted by the LINE Official Account admin. - */ - scopes: Array /**/; -}; +export type AttachModuleResponse = { + /** + * User ID of the bot on the LINE Official Account. + */ + 'botId': string/**/; + /** + * Permissions (scope) granted by the LINE Official Account admin. + */ + 'scopes': Array/**/; + +} + + + + + + + diff --git a/lib/module-attach/model/models.ts b/lib/module-attach/model/models.ts index 490661810..1fefdb501 100644 --- a/lib/module-attach/model/models.ts +++ b/lib/module-attach/model/models.ts @@ -1 +1,2 @@ -export * from "./attachModuleResponse"; + +export * from './attachModuleResponse.js'; diff --git a/lib/module-attach/tests/api/LineModuleAttachClientTest.spec.ts b/lib/module-attach/tests/api/LineModuleAttachClientTest.spec.ts index 0e39ab223..2cb26cd14 100644 --- a/lib/module-attach/tests/api/LineModuleAttachClientTest.spec.ts +++ b/lib/module-attach/tests/api/LineModuleAttachClientTest.spec.ts @@ -1,15 +1,28 @@ -import { LineModuleAttachClient } from "../../api"; -import { AttachModuleResponse } from "../../model/attachModuleResponse"; + +import { LineModuleAttachClient } from "../../api.js"; + +import { AttachModuleResponse } from '../../model/attachModuleResponse.js'; + import { createServer } from "node:http"; import { deepEqual, equal, ok } from "node:assert"; -const pkg = require("../../../../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../../../../package.json"); const channel_access_token = "test_channel_access_token"; + + + + describe("LineModuleAttachClient", () => { + + + + it("attachModuleWithHttpInfo", async () => { let requestCount = 0; @@ -18,78 +31,112 @@ describe("LineModuleAttachClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/module/auth/v1/token" - .replace("{grantType}", "DUMMY") // string - .replace("{code}", "DUMMY") // string - .replace("{redirectUri}", "DUMMY") // string - .replace("{codeVerifier}", "DUMMY") // string - .replace("{clientId}", "DUMMY") // string - .replace("{clientSecret}", "DUMMY") // string - .replace("{region}", "DUMMY") // string - .replace("{basicSearchId}", "DUMMY") // string - .replace("{scope}", "DUMMY") // string - .replace("{brandType}", "DUMMY"), // string + equal(reqUrl.pathname, "/module/auth/v1/token" + .replace("{grantType}", "DUMMY") // string + .replace("{code}", "DUMMY") // string + .replace("{redirectUri}", "DUMMY") // string + .replace("{codeVerifier}", "DUMMY") // string + .replace("{clientId}", "DUMMY") // string + .replace("{clientSecret}", "DUMMY") // string + .replace("{region}", "DUMMY") // string + .replace("{basicSearchId}", "DUMMY") // string + .replace("{scope}", "DUMMY") // string + .replace("{brandType}", "DUMMY") // string + + ); + + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, ); - - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LineModuleAttachClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.attachModuleWithHttpInfo( - // grantType: string - "DUMMY", // grantType(string) - // code: string - "DUMMY", // code(string) - // redirectUri: string - "DUMMY", // redirectUri(string) + // grantType: string + "DUMMY", // grantType(string) + + + + // code: string + "DUMMY", // code(string) + + + + // redirectUri: string + "DUMMY", // redirectUri(string) + + + + // codeVerifier: string + "DUMMY", // codeVerifier(string) + + + + // clientId: string + "DUMMY", // clientId(string) + + + + // clientSecret: string + "DUMMY", // clientSecret(string) + - // codeVerifier: string - "DUMMY", // codeVerifier(string) - // clientId: string - "DUMMY", // clientId(string) + // region: string + "DUMMY", // region(string) + - // clientSecret: string - "DUMMY", // clientSecret(string) - // region: string - "DUMMY", // region(string) + // basicSearchId: string + "DUMMY", // basicSearchId(string) + - // basicSearchId: string - "DUMMY", // basicSearchId(string) - // scope: string - "DUMMY", // scope(string) + // scope: string + "DUMMY", // scope(string) + + + + // brandType: string + "DUMMY", // brandType(string) + - // brandType: string - "DUMMY", // brandType(string) ); equal(requestCount, 1); server.close(); }); + + + + it("attachModule", async () => { let requestCount = 0; @@ -98,75 +145,108 @@ describe("LineModuleAttachClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/module/auth/v1/token" - .replace("{grantType}", "DUMMY") // string - .replace("{code}", "DUMMY") // string - .replace("{redirectUri}", "DUMMY") // string - .replace("{codeVerifier}", "DUMMY") // string - .replace("{clientId}", "DUMMY") // string - .replace("{clientSecret}", "DUMMY") // string - .replace("{region}", "DUMMY") // string - .replace("{basicSearchId}", "DUMMY") // string - .replace("{scope}", "DUMMY") // string - .replace("{brandType}", "DUMMY"), // string + equal(reqUrl.pathname, "/module/auth/v1/token" + .replace("{grantType}", "DUMMY") // string + .replace("{code}", "DUMMY") // string + .replace("{redirectUri}", "DUMMY") // string + .replace("{codeVerifier}", "DUMMY") // string + .replace("{clientId}", "DUMMY") // string + .replace("{clientSecret}", "DUMMY") // string + .replace("{region}", "DUMMY") // string + .replace("{basicSearchId}", "DUMMY") // string + .replace("{scope}", "DUMMY") // string + .replace("{brandType}", "DUMMY") // string + + ); + + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, ); - - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LineModuleAttachClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.attachModule( - // grantType: string - "DUMMY", // grantType(string) - // code: string - "DUMMY", // code(string) - // redirectUri: string - "DUMMY", // redirectUri(string) + // grantType: string + "DUMMY", // grantType(string) + + + + // code: string + "DUMMY", // code(string) + + + + // redirectUri: string + "DUMMY", // redirectUri(string) + - // codeVerifier: string - "DUMMY", // codeVerifier(string) - // clientId: string - "DUMMY", // clientId(string) + // codeVerifier: string + "DUMMY", // codeVerifier(string) + - // clientSecret: string - "DUMMY", // clientSecret(string) - // region: string - "DUMMY", // region(string) + // clientId: string + "DUMMY", // clientId(string) + - // basicSearchId: string - "DUMMY", // basicSearchId(string) - // scope: string - "DUMMY", // scope(string) + // clientSecret: string + "DUMMY", // clientSecret(string) + + + + // region: string + "DUMMY", // region(string) + + + + // basicSearchId: string + "DUMMY", // basicSearchId(string) + + + + // scope: string + "DUMMY", // scope(string) + + + + // brandType: string + "DUMMY", // brandType(string) + - // brandType: string - "DUMMY", // brandType(string) ); equal(requestCount, 1); server.close(); }); + + + }); diff --git a/lib/module/api.ts b/lib/module/api.ts index eeedcdab6..048a59bd5 100644 --- a/lib/module/api.ts +++ b/lib/module/api.ts @@ -1,3 +1,3 @@ // This is the entrypoint for the package -export * from "./api/apis"; -export * from "./model/models"; +export * from './api/apis.js'; +export * from './model/models.js'; diff --git a/lib/module/api/apis.ts b/lib/module/api/apis.ts index b5f45afa2..0b0008290 100644 --- a/lib/module/api/apis.ts +++ b/lib/module/api/apis.ts @@ -1 +1,3 @@ -export { LineModuleClient } from "./lineModuleClient"; + +export { LineModuleClient } from './lineModuleClient.js'; + diff --git a/lib/module/api/lineModuleClient.ts b/lib/module/api/lineModuleClient.ts index cc76e2ddc..b582eb7bf 100644 --- a/lib/module/api/lineModuleClient.ts +++ b/lib/module/api/lineModuleClient.ts @@ -1,3 +1,5 @@ + + /** * LINE Messaging API * This document describes LINE Messaging API. @@ -10,191 +12,225 @@ * Do not edit the class manually. */ + /* tslint:disable:no-unused-locals */ -import { AcquireChatControlRequest } from "../model/acquireChatControlRequest"; -import { DetachModuleRequest } from "../model/detachModuleRequest"; -import { GetModulesResponse } from "../model/getModulesResponse"; +import { AcquireChatControlRequest } from '../model/acquireChatControlRequest.js'; +import { DetachModuleRequest } from '../model/detachModuleRequest.js'; +import { GetModulesResponse } from '../model/getModulesResponse.js'; -import * as Types from "../../types"; -import { ensureJSON } from "../../utils"; -import { Readable } from "node:stream"; +import * as Types from "../../types.js"; +import {ensureJSON} from "../../utils.js"; +import {Readable} from "node:stream"; -import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch"; +import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch.js"; // =============================================== // This file is autogenerated - Please do not edit // =============================================== interface httpClientConfig { - baseURL?: string; - channelAccessToken: string; - // TODO support defaultHeaders? + baseURL?: string; + channelAccessToken: string; + // TODO support defaultHeaders? } + export class LineModuleClient { - private httpClient: HTTPFetchClient; + private httpClient: HTTPFetchClient; + + constructor(config: httpClientConfig) { + if (!config.baseURL) { + config.baseURL = 'https://api.line.me'; + } + this.httpClient = new HTTPFetchClient({ + defaultHeaders: { + Authorization: "Bearer " + config.channelAccessToken, + }, + baseURL: config.baseURL, + }); + } - constructor(config: httpClientConfig) { - if (!config.baseURL) { - config.baseURL = "https://api.line.me"; + private async parseHTTPResponse(response: Response) { + const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; + let resBody: Record = { + ...await response.json(), + }; + if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { + resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = + response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME); + } + return resBody; } - this.httpClient = new HTTPFetchClient({ - defaultHeaders: { - Authorization: "Bearer " + config.channelAccessToken, - }, - baseURL: config.baseURL, - }); - } - - private async parseHTTPResponse(response: Response) { - const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; - let resBody: Record = { - ...(await response.json()), - }; - if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { - resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = response.headers.get( - LINE_REQUEST_ID_HTTP_HEADER_NAME, - ); + +/** + * If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel. + * @param chatId The `userId`, `roomId`, or `groupId` + * @param acquireChatControlRequest + * + * @see Documentation + */ + public async acquireChatControl(chatId: string, acquireChatControlRequest?: AcquireChatControlRequest, ) : Promise { + return (await this.acquireChatControlWithHttpInfo(chatId, acquireChatControlRequest, )).body; } - return resBody; - } - - /** - * If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel. - * @param chatId The `userId`, `roomId`, or `groupId` - * @param acquireChatControlRequest - * - * @see Documentation - */ - public async acquireChatControl( - chatId: string, - acquireChatControlRequest?: AcquireChatControlRequest, - ): Promise { - return ( - await this.acquireChatControlWithHttpInfo( - chatId, - acquireChatControlRequest, - ) - ).body; - } - - /** - * If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel. . - * This method includes HttpInfo object to return additional information. - * @param chatId The `userId`, `roomId`, or `groupId` - * @param acquireChatControlRequest - * - * @see Documentation - */ - public async acquireChatControlWithHttpInfo( - chatId: string, - acquireChatControlRequest?: AcquireChatControlRequest, - ): Promise> { + + /** + * If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel. . + * This method includes HttpInfo object to return additional information. + * @param chatId The `userId`, `roomId`, or `groupId` + * @param acquireChatControlRequest + * + * @see Documentation + */ + public async acquireChatControlWithHttpInfo(chatId: string, acquireChatControlRequest?: AcquireChatControlRequest, ) : Promise> { + + + + const params = acquireChatControlRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/chat/{chatId}/control/acquire" + + .replace("{chatId}", String(chatId)) + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * The module channel admin calls the Detach API to detach the module channel from a LINE Official Account. + * @param detachModuleRequest + * + * @see Documentation + */ + public async detachModule(detachModuleRequest?: DetachModuleRequest, ) : Promise { + return (await this.detachModuleWithHttpInfo(detachModuleRequest, )).body; + } + + /** + * The module channel admin calls the Detach API to detach the module channel from a LINE Official Account.. + * This method includes HttpInfo object to return additional information. + * @param detachModuleRequest + * + * @see Documentation + */ + public async detachModuleWithHttpInfo(detachModuleRequest?: DetachModuleRequest, ) : Promise> { + + + - const res = await this.httpClient.post( - "/v2/bot/chat/{chatId}/control/acquire".replace( - "{chatId}", - String(chatId), - ), - params, - ); - return { httpResponse: res, body: await res.json() }; - } - /** - * The module channel admin calls the Detach API to detach the module channel from a LINE Official Account. - * @param detachModuleRequest - * - * @see Documentation - */ - public async detachModule( - detachModuleRequest?: DetachModuleRequest, - ): Promise { - return (await this.detachModuleWithHttpInfo(detachModuleRequest)).body; - } - - /** - * The module channel admin calls the Detach API to detach the module channel from a LINE Official Account.. - * This method includes HttpInfo object to return additional information. - * @param detachModuleRequest - * - * @see Documentation - */ - public async detachModuleWithHttpInfo( - detachModuleRequest?: DetachModuleRequest, - ): Promise> { const params = detachModuleRequest; + + + + const res = await this.httpClient.post( + "/v2/bot/channel/detach" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels. + * @param start Value of the continuation token found in the next property of the JSON object returned in the response. If you can\'t get all basic information about the bots in one request, include this parameter to get the remaining array. + * @param limit Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 + * + * @see Documentation + */ + public async getModules(start?: string, limit?: number, ) : Promise { + return (await this.getModulesWithHttpInfo(start, limit, )).body; + } + + /** + * Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels.. + * This method includes HttpInfo object to return additional information. + * @param start Value of the continuation token found in the next property of the JSON object returned in the response. If you can\'t get all basic information about the bots in one request, include this parameter to get the remaining array. + * @param limit Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 + * + * @see Documentation + */ + public async getModulesWithHttpInfo(start?: string, limit?: number, ) : Promise> { + + + - const res = await this.httpClient.post("/v2/bot/channel/detach", params); - return { httpResponse: res, body: await res.json() }; - } - /** - * Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels. - * @param start Value of the continuation token found in the next property of the JSON object returned in the response. If you can\'t get all basic information about the bots in one request, include this parameter to get the remaining array. - * @param limit Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 - * - * @see Documentation - */ - public async getModules( - start?: string, - limit?: number, - ): Promise { - return (await this.getModulesWithHttpInfo(start, limit)).body; - } - - /** - * Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels.. - * This method includes HttpInfo object to return additional information. - * @param start Value of the continuation token found in the next property of the JSON object returned in the response. If you can\'t get all basic information about the bots in one request, include this parameter to get the remaining array. - * @param limit Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 - * - * @see Documentation - */ - public async getModulesWithHttpInfo( - start?: string, - limit?: number, - ): Promise> { const queryParams = { - start: start, - limit: limit, - }; - Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { - if (queryParams[key] === undefined) { - delete queryParams[key]; - } - }); - - const res = await this.httpClient.get("/v2/bot/list", queryParams); - return { httpResponse: res, body: await res.json() }; - } - /** - * To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. - * @param chatId The `userId`, `roomId`, or `groupId` - * - * @see Documentation - */ - public async releaseChatControl( - chatId: string, - ): Promise { - return (await this.releaseChatControlWithHttpInfo(chatId)).body; - } - - /** - * To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. . - * This method includes HttpInfo object to return additional information. - * @param chatId The `userId`, `roomId`, or `groupId` - * - * @see Documentation - */ - public async releaseChatControlWithHttpInfo( - chatId: string, - ): Promise> { - const res = await this.httpClient.post( - "/v2/bot/chat/{chatId}/control/release".replace( - "{chatId}", - String(chatId), - ), - ); - return { httpResponse: res, body: await res.json() }; - } + "start": start, + "limit": limit, + + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + + + const res = await this.httpClient.get( + "/v2/bot/list" + , + + queryParams, + + ); + return {httpResponse: res, body: await res.json()}; + + + + } +/** + * To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. + * @param chatId The `userId`, `roomId`, or `groupId` + * + * @see Documentation + */ + public async releaseChatControl(chatId: string, ) : Promise { + return (await this.releaseChatControlWithHttpInfo(chatId, )).body; + } + + /** + * To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. . + * This method includes HttpInfo object to return additional information. + * @param chatId The `userId`, `roomId`, or `groupId` + * + * @see Documentation + */ + public async releaseChatControlWithHttpInfo(chatId: string, ) : Promise> { + + + + + + + + const res = await this.httpClient.post( + "/v2/bot/chat/{chatId}/control/release" + + .replace("{chatId}", String(chatId)) + , + + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } + } diff --git a/lib/module/model/acquireChatControlRequest.ts b/lib/module/model/acquireChatControlRequest.ts index 9c01cd418..de60821eb 100644 --- a/lib/module/model/acquireChatControlRequest.ts +++ b/lib/module/model/acquireChatControlRequest.ts @@ -10,20 +10,33 @@ * Do not edit the class manually. */ + + + + + /** * Request entity of the Acquire Control API */ -export type AcquireChatControlRequest = { - /** - * `True`: After the time limit (ttl) has passed, the initiative (Chat Control) will return to the Primary Channel. (Default) `False`: There\'s no time limit and the initiative (Chat Control) doesn\'t change over time. - * - * @see expired Documentation - */ - expired?: boolean /**/; - /** - * The time it takes for initiative (Chat Control) to return to the Primary Channel (the time that the module channel stays on the Active Channel). The value is specified in seconds. The maximum value is one year (3600 * 24 * 365). The default value is 3600 (1 hour). * Ignored if the value of expired is false. - * - * @see ttl Documentation - */ - ttl?: number /**/; -}; +export type AcquireChatControlRequest = { + /** + * `True`: After the time limit (ttl) has passed, the initiative (Chat Control) will return to the Primary Channel. (Default) `False`: There\'s no time limit and the initiative (Chat Control) doesn\'t change over time. + * + * @see expired Documentation + */ + 'expired'?: boolean/**/; + /** + * The time it takes for initiative (Chat Control) to return to the Primary Channel (the time that the module channel stays on the Active Channel). The value is specified in seconds. The maximum value is one year (3600 * 24 * 365). The default value is 3600 (1 hour). * Ignored if the value of expired is false. + * + * @see ttl Documentation + */ + 'ttl'?: number/**/; + +} + + + + + + + diff --git a/lib/module/model/detachModuleRequest.ts b/lib/module/model/detachModuleRequest.ts index 861fb9cbf..6576daf50 100644 --- a/lib/module/model/detachModuleRequest.ts +++ b/lib/module/model/detachModuleRequest.ts @@ -10,14 +10,27 @@ * Do not edit the class manually. */ + + + + + /** * Unlink (detach) the module channel by the operation of the module channel administrator */ -export type DetachModuleRequest = { - /** - * User ID of the LINE Official Account bot attached to the module channel. - * - * @see botId Documentation - */ - botId?: string /**/; -}; +export type DetachModuleRequest = { + /** + * User ID of the LINE Official Account bot attached to the module channel. + * + * @see botId Documentation + */ + 'botId'?: string/**/; + +} + + + + + + + diff --git a/lib/module/model/getModulesResponse.ts b/lib/module/model/getModulesResponse.ts index cbc1b7bc1..d4b2a20fb 100644 --- a/lib/module/model/getModulesResponse.ts +++ b/lib/module/model/getModulesResponse.ts @@ -10,22 +10,33 @@ * Do not edit the class manually. */ -import { ModuleBot } from "./moduleBot"; + + import { ModuleBot } from './moduleBot.js'; + + /** * List of bots to which the module is attached */ -export type GetModulesResponse = { - /** - * Array of Bot list Item objects representing basic information about the bot. - * - * @see bots Documentation - */ - bots: Array /**/; - /** - * Continuation token. Used to get the next array of basic bot information. This property is only returned if there are more unreturned results. - * - * @see next Documentation - */ - next?: string /**/; -}; +export type GetModulesResponse = { + /** + * Array of Bot list Item objects representing basic information about the bot. + * + * @see bots Documentation + */ + 'bots': Array/**/; + /** + * Continuation token. Used to get the next array of basic bot information. This property is only returned if there are more unreturned results. + * + * @see next Documentation + */ + 'next'?: string/**/; + +} + + + + + + + diff --git a/lib/module/model/models.ts b/lib/module/model/models.ts index 219f4a999..41745bf7a 100644 --- a/lib/module/model/models.ts +++ b/lib/module/model/models.ts @@ -1,4 +1,2 @@ -export * from "./acquireChatControlRequest"; -export * from "./detachModuleRequest"; -export * from "./getModulesResponse"; -export * from "./moduleBot"; + +export * from './acquireChatControlRequest.js';export * from './detachModuleRequest.js';export * from './getModulesResponse.js';export * from './moduleBot.js'; diff --git a/lib/module/model/moduleBot.ts b/lib/module/model/moduleBot.ts index 79eea438c..0bc41fa71 100644 --- a/lib/module/model/moduleBot.ts +++ b/lib/module/model/moduleBot.ts @@ -10,38 +10,51 @@ * Do not edit the class manually. */ + + + + + /** * basic information about the bot. */ -export type ModuleBot = { - /** - * Bot\'s user ID - * - * @see userId Documentation - */ - userId: string /**/; - /** - * Bot\'s basic ID - * - * @see basicId Documentation - */ - basicId: string /**/; - /** - * Bot\'s premium ID. Not included in the response if the premium ID isn\'t set. - * - * @see premiumId Documentation - */ - premiumId?: string /**/; - /** - * Bot\'s display name - * - * @see displayName Documentation - */ - displayName: string /**/; - /** - * Profile image URL. Image URL starting with `https://`. Not included in the response if the bot doesn\'t have a profile image. - * - * @see pictureUrl Documentation - */ - pictureUrl?: string /**/; -}; +export type ModuleBot = { + /** + * Bot\'s user ID + * + * @see userId Documentation + */ + 'userId': string/**/; + /** + * Bot\'s basic ID + * + * @see basicId Documentation + */ + 'basicId': string/**/; + /** + * Bot\'s premium ID. Not included in the response if the premium ID isn\'t set. + * + * @see premiumId Documentation + */ + 'premiumId'?: string/**/; + /** + * Bot\'s display name + * + * @see displayName Documentation + */ + 'displayName': string/**/; + /** + * Profile image URL. Image URL starting with `https://`. Not included in the response if the bot doesn\'t have a profile image. + * + * @see pictureUrl Documentation + */ + 'pictureUrl'?: string/**/; + +} + + + + + + + diff --git a/lib/module/tests/api/LineModuleClientTest.spec.ts b/lib/module/tests/api/LineModuleClientTest.spec.ts index e1b30adee..428d590ba 100644 --- a/lib/module/tests/api/LineModuleClientTest.spec.ts +++ b/lib/module/tests/api/LineModuleClientTest.spec.ts @@ -1,17 +1,30 @@ -import { LineModuleClient } from "../../api"; -import { AcquireChatControlRequest } from "../../model/acquireChatControlRequest"; -import { DetachModuleRequest } from "../../model/detachModuleRequest"; -import { GetModulesResponse } from "../../model/getModulesResponse"; + +import { LineModuleClient } from "../../api.js"; + +import { AcquireChatControlRequest } from '../../model/acquireChatControlRequest.js'; +import { DetachModuleRequest } from '../../model/detachModuleRequest.js'; +import { GetModulesResponse } from '../../model/getModulesResponse.js'; + import { createServer } from "node:http"; import { deepEqual, equal, ok } from "node:assert"; -const pkg = require("../../../../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../../../../package.json"); const channel_access_token = "test_channel_access_token"; + + + + describe("LineModuleClient", () => { + + + + it("acquireChatControlWithHttpInfo", async () => { let requestCount = 0; @@ -20,44 +33,63 @@ describe("LineModuleClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/chat/{chatId}/control/acquire".replace("{chatId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/chat/{chatId}/control/acquire" + .replace("{chatId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LineModuleClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.acquireChatControlWithHttpInfo( - // chatId: string - "DUMMY", // chatId(string) - // acquireChatControlRequest: AcquireChatControlRequest - {} as unknown as AcquireChatControlRequest, // paramName=acquireChatControlRequest + + // chatId: string + "DUMMY", // chatId(string) + + + + // acquireChatControlRequest: AcquireChatControlRequest + {} as unknown as AcquireChatControlRequest, // paramName=acquireChatControlRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("acquireChatControl", async () => { let requestCount = 0; @@ -66,44 +98,64 @@ describe("LineModuleClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/chat/{chatId}/control/acquire".replace("{chatId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/chat/{chatId}/control/acquire" + .replace("{chatId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LineModuleClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.acquireChatControl( - // chatId: string - "DUMMY", // chatId(string) - // acquireChatControlRequest: AcquireChatControlRequest - {} as unknown as AcquireChatControlRequest, // paramName=acquireChatControlRequest + + // chatId: string + "DUMMY", // chatId(string) + + + + // acquireChatControlRequest: AcquireChatControlRequest + {} as unknown as AcquireChatControlRequest, // paramName=acquireChatControlRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("detachModuleWithHttpInfo", async () => { let requestCount = 0; @@ -112,38 +164,57 @@ describe("LineModuleClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/channel/detach"); + equal(reqUrl.pathname, "/v2/bot/channel/detach" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LineModuleClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.detachModuleWithHttpInfo( - // detachModuleRequest: DetachModuleRequest - {} as unknown as DetachModuleRequest, // paramName=detachModuleRequest + + + // detachModuleRequest: DetachModuleRequest + {} as unknown as DetachModuleRequest, // paramName=detachModuleRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("detachModule", async () => { let requestCount = 0; @@ -152,38 +223,58 @@ describe("LineModuleClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/v2/bot/channel/detach"); + equal(reqUrl.pathname, "/v2/bot/channel/detach" + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LineModuleClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.detachModule( - // detachModuleRequest: DetachModuleRequest - {} as unknown as DetachModuleRequest, // paramName=detachModuleRequest + + + // detachModuleRequest: DetachModuleRequest + {} as unknown as DetachModuleRequest, // paramName=detachModuleRequest + + ); equal(requestCount, 1); server.close(); }); + + + + + it("getModulesWithHttpInfo", async () => { let requestCount = 0; @@ -192,63 +283,78 @@ describe("LineModuleClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/list" - .replace("{start}", "DUMMY") // string - .replace("{limit}", "0"), // number - ); + equal(reqUrl.pathname, "/v2/bot/list" + .replace("{start}", "DUMMY") // string + .replace("{limit}", "0") // number + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("start"), - String( - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) - ), + equal(queryParams.get("start"), String( + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + )); + equal(queryParams.get("limit"), String( + + // limit: number + "DUMMY" as unknown as number, // paramName=limit(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, ); - equal( - queryParams.get("limit"), - String( - // limit: number - "DUMMY" as unknown as number, // paramName=limit(enum) - ), + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LineModuleClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getModulesWithHttpInfo( - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) - // limit: number - "DUMMY" as unknown as number, // paramName=limit(enum) + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + + + + // limit: number + "DUMMY" as unknown as number, // paramName=limit(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + it("getModules", async () => { let requestCount = 0; @@ -257,63 +363,79 @@ describe("LineModuleClient", () => { equal(req.method, "GET"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/list" - .replace("{start}", "DUMMY") // string - .replace("{limit}", "0"), // number - ); + equal(reqUrl.pathname, "/v2/bot/list" + .replace("{start}", "DUMMY") // string + .replace("{limit}", "0") // number + + ); + + // Query parameters const queryParams = new URLSearchParams(reqUrl.search); - equal( - queryParams.get("start"), - String( - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) - ), + equal(queryParams.get("start"), String( + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + )); + equal(queryParams.get("limit"), String( + + // limit: number + "DUMMY" as unknown as number, // paramName=limit(enum) + )); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, ); - equal( - queryParams.get("limit"), - String( - // limit: number - "DUMMY" as unknown as number, // paramName=limit(enum) - ), + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, ); - - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LineModuleClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.getModules( - // start: string - "DUMMY" as unknown as string, // paramName=start(enum) - // limit: number - "DUMMY" as unknown as number, // paramName=limit(enum) + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + + + + // limit: number + "DUMMY" as unknown as number, // paramName=limit(enum) + + ); equal(requestCount, 1); server.close(); }); + + + + + it("releaseChatControlWithHttpInfo", async () => { let requestCount = 0; @@ -322,41 +444,58 @@ describe("LineModuleClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/chat/{chatId}/control/release".replace("{chatId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/chat/{chatId}/control/release" + .replace("{chatId}", "DUMMY") // string + + ); + - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LineModuleClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.releaseChatControlWithHttpInfo( - // chatId: string - "DUMMY", // chatId(string) + + + // chatId: string + "DUMMY", // chatId(string) + + ); equal(requestCount, 1); server.close(); }); + + + + it("releaseChatControl", async () => { let requestCount = 0; @@ -365,38 +504,54 @@ describe("LineModuleClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal( - reqUrl.pathname, - "/v2/bot/chat/{chatId}/control/release".replace("{chatId}", "DUMMY"), // string - ); + equal(reqUrl.pathname, "/v2/bot/chat/{chatId}/control/release" + .replace("{chatId}", "DUMMY") // string + + ); - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new LineModuleClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.releaseChatControl( - // chatId: string - "DUMMY", // chatId(string) + + + // chatId: string + "DUMMY", // chatId(string) + + ); equal(requestCount, 1); server.close(); }); + + + }); diff --git a/lib/shop/api.ts b/lib/shop/api.ts index eeedcdab6..048a59bd5 100644 --- a/lib/shop/api.ts +++ b/lib/shop/api.ts @@ -1,3 +1,3 @@ // This is the entrypoint for the package -export * from "./api/apis"; -export * from "./model/models"; +export * from './api/apis.js'; +export * from './model/models.js'; diff --git a/lib/shop/api/apis.ts b/lib/shop/api/apis.ts index 8c160c6bd..b925f8691 100644 --- a/lib/shop/api/apis.ts +++ b/lib/shop/api/apis.ts @@ -1 +1,3 @@ -export { ShopClient } from "./shopClient"; + +export { ShopClient } from './shopClient.js'; + diff --git a/lib/shop/api/shopClient.ts b/lib/shop/api/shopClient.ts index 17f42bf91..ceb1573be 100644 --- a/lib/shop/api/shopClient.ts +++ b/lib/shop/api/shopClient.ts @@ -1,3 +1,5 @@ + + /** * Mission Stickers API * This document describes LINE Mission Stickers API. @@ -10,79 +12,92 @@ * Do not edit the class manually. */ + /* tslint:disable:no-unused-locals */ -import { MissionStickerRequest } from "../model/missionStickerRequest"; +import { MissionStickerRequest } from '../model/missionStickerRequest.js'; -import * as Types from "../../types"; -import { ensureJSON } from "../../utils"; -import { Readable } from "node:stream"; +import * as Types from "../../types.js"; +import {ensureJSON} from "../../utils.js"; +import {Readable} from "node:stream"; -import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch"; +import HTTPFetchClient, { convertResponseToReadable } from "../../http-fetch.js"; // =============================================== // This file is autogenerated - Please do not edit // =============================================== interface httpClientConfig { - baseURL?: string; - channelAccessToken: string; - // TODO support defaultHeaders? + baseURL?: string; + channelAccessToken: string; + // TODO support defaultHeaders? } + export class ShopClient { - private httpClient: HTTPFetchClient; + private httpClient: HTTPFetchClient; - constructor(config: httpClientConfig) { - if (!config.baseURL) { - config.baseURL = "https://api.line.me"; + constructor(config: httpClientConfig) { + if (!config.baseURL) { + config.baseURL = 'https://api.line.me'; + } + this.httpClient = new HTTPFetchClient({ + defaultHeaders: { + Authorization: "Bearer " + config.channelAccessToken, + }, + baseURL: config.baseURL, + }); } - this.httpClient = new HTTPFetchClient({ - defaultHeaders: { - Authorization: "Bearer " + config.channelAccessToken, - }, - baseURL: config.baseURL, - }); - } - - private async parseHTTPResponse(response: Response) { - const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; - let resBody: Record = { - ...(await response.json()), - }; - if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { - resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = response.headers.get( - LINE_REQUEST_ID_HTTP_HEADER_NAME, - ); + + private async parseHTTPResponse(response: Response) { + const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types; + let resBody: Record = { + ...await response.json(), + }; + if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) { + resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = + response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME); + } + return resBody; + } + +/** + * Sends a mission sticker. + * @param missionStickerRequest + * + * @see Documentation + */ + public async missionStickerV3(missionStickerRequest: MissionStickerRequest, ) : Promise { + return (await this.missionStickerV3WithHttpInfo(missionStickerRequest, )).body; } - return resBody; - } - - /** - * Sends a mission sticker. - * @param missionStickerRequest - * - * @see Documentation - */ - public async missionStickerV3( - missionStickerRequest: MissionStickerRequest, - ): Promise { - return (await this.missionStickerV3WithHttpInfo(missionStickerRequest)) - .body; - } - - /** - * Sends a mission sticker.. - * This method includes HttpInfo object to return additional information. - * @param missionStickerRequest - * - * @see Documentation - */ - public async missionStickerV3WithHttpInfo( - missionStickerRequest: MissionStickerRequest, - ): Promise> { + + /** + * Sends a mission sticker.. + * This method includes HttpInfo object to return additional information. + * @param missionStickerRequest + * + * @see Documentation + */ + public async missionStickerV3WithHttpInfo(missionStickerRequest: MissionStickerRequest, ) : Promise> { + + + + const params = missionStickerRequest; + + + + const res = await this.httpClient.post( + "/shop/v3/mission" + , + + params, + + + ); + return {httpResponse: res, body: await res.json()}; + + + + } - const res = await this.httpClient.post("/shop/v3/mission", params); - return { httpResponse: res, body: await res.json() }; - } } diff --git a/lib/shop/model/errorResponse.ts b/lib/shop/model/errorResponse.ts index 94ef6f38a..e68ef1f45 100644 --- a/lib/shop/model/errorResponse.ts +++ b/lib/shop/model/errorResponse.ts @@ -10,11 +10,24 @@ * Do not edit the class manually. */ -export type ErrorResponse = { - /** - * Message containing information about the error. - * - * @see message Documentation - */ - message: string /**/; -}; + + + + + +export type ErrorResponse = { + /** + * Message containing information about the error. + * + * @see message Documentation + */ + 'message': string/**/; + +} + + + + + + + diff --git a/lib/shop/model/missionStickerRequest.ts b/lib/shop/model/missionStickerRequest.ts index d644968ef..4a1bab4d1 100644 --- a/lib/shop/model/missionStickerRequest.ts +++ b/lib/shop/model/missionStickerRequest.ts @@ -10,32 +10,45 @@ * Do not edit the class manually. */ + + + + + /** * Send mission stickers (v3) */ -export type MissionStickerRequest = { - /** - * Destination user ID - * - * @see to Documentation - */ - to: string /**/; - /** - * Package ID for a set of stickers - * - * @see productId Documentation - */ - productId: string /**/; - /** - * `STICKER` - * - * @see productType Documentation - */ - productType: string /**/; - /** - * `false` - * - * @see sendPresentMessage Documentation - */ - sendPresentMessage: boolean /**/; -}; +export type MissionStickerRequest = { + /** + * Destination user ID + * + * @see to Documentation + */ + 'to': string/**/; + /** + * Package ID for a set of stickers + * + * @see productId Documentation + */ + 'productId': string/**/; + /** + * `STICKER` + * + * @see productType Documentation + */ + 'productType': string/**/; + /** + * `false` + * + * @see sendPresentMessage Documentation + */ + 'sendPresentMessage': boolean/**/; + +} + + + + + + + diff --git a/lib/shop/model/models.ts b/lib/shop/model/models.ts index ffbf7100a..2685dab9b 100644 --- a/lib/shop/model/models.ts +++ b/lib/shop/model/models.ts @@ -1,2 +1,2 @@ -export * from "./errorResponse"; -export * from "./missionStickerRequest"; + +export * from './errorResponse.js';export * from './missionStickerRequest.js'; diff --git a/lib/shop/tests/api/ShopClientTest.spec.ts b/lib/shop/tests/api/ShopClientTest.spec.ts index abe05e6f3..9e7686dd0 100644 --- a/lib/shop/tests/api/ShopClientTest.spec.ts +++ b/lib/shop/tests/api/ShopClientTest.spec.ts @@ -1,15 +1,28 @@ -import { ShopClient } from "../../api"; -import { MissionStickerRequest } from "../../model/missionStickerRequest"; + +import { ShopClient } from "../../api.js"; + +import { MissionStickerRequest } from '../../model/missionStickerRequest.js'; + import { createServer } from "node:http"; import { deepEqual, equal, ok } from "node:assert"; -const pkg = require("../../../../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../../../../package.json"); const channel_access_token = "test_channel_access_token"; + + + + describe("ShopClient", () => { + + + + it("missionStickerV3WithHttpInfo", async () => { let requestCount = 0; @@ -18,38 +31,57 @@ describe("ShopClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/shop/v3/mission"); - - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + equal(reqUrl.pathname, "/shop/v3/mission" + + ); + + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ShopClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.missionStickerV3WithHttpInfo( - // missionStickerRequest: MissionStickerRequest - {} as unknown as MissionStickerRequest, // paramName=missionStickerRequest + + + // missionStickerRequest: MissionStickerRequest + {} as unknown as MissionStickerRequest, // paramName=missionStickerRequest + + ); equal(requestCount, 1); server.close(); }); + + + + it("missionStickerV3", async () => { let requestCount = 0; @@ -58,35 +90,53 @@ describe("ShopClient", () => { equal(req.method, "POST"); const reqUrl = new URL(req.url, "http://localhost/"); - equal(reqUrl.pathname, "/shop/v3/mission"); - - equal(req.headers["authorization"], `Bearer ${channel_access_token}`); - equal(req.headers["user-agent"], `${pkg.name}/${pkg.version}`); + equal(reqUrl.pathname, "/shop/v3/mission" + + ); + + + + equal( + req.headers["authorization"], + `Bearer ${channel_access_token}`, + ); + equal( + req.headers["user-agent"], + `${pkg.name}/${pkg.version}`, + ); + res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({})); }); - await new Promise(resolve => { + await new Promise((resolve) => { server.listen(0); - server.on("listening", resolve); + server.on('listening', resolve); }); const serverAddress = server.address(); if (typeof serverAddress === "string" || serverAddress === null) { - throw new Error("Unexpected server address: " + serverAddress); + throw new Error("Unexpected server address: " + serverAddress); } const client = new ShopClient({ - channelAccessToken: channel_access_token, - baseURL: `http://localhost:${String(serverAddress.port)}/`, + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/` }); const res = await client.missionStickerV3( - // missionStickerRequest: MissionStickerRequest - {} as unknown as MissionStickerRequest, // paramName=missionStickerRequest + + + // missionStickerRequest: MissionStickerRequest + {} as unknown as MissionStickerRequest, // paramName=missionStickerRequest + + ); equal(requestCount, 1); server.close(); }); + + + }); diff --git a/lib/utils.ts b/lib/utils.ts index 5c37736cd..9c3dfa026 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -1,4 +1,4 @@ -import { JSONParseError } from "./exceptions"; +import { JSONParseError } from "./exceptions.js"; export function toArray(maybeArr: T | T[]): T[] { return Array.isArray(maybeArr) ? maybeArr : [maybeArr]; diff --git a/lib/webhook/api.ts b/lib/webhook/api.ts index 00dd34ea2..c63cceb55 100644 --- a/lib/webhook/api.ts +++ b/lib/webhook/api.ts @@ -1 +1 @@ -export * from "./model/models"; +export * from './model/models.js'; \ No newline at end of file diff --git a/lib/webhook/model/accountLinkEvent.ts b/lib/webhook/model/accountLinkEvent.ts index 024392423..51864514d 100644 --- a/lib/webhook/model/accountLinkEvent.ts +++ b/lib/webhook/model/accountLinkEvent.ts @@ -10,26 +10,38 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { LinkContent } from "./linkContent"; -import { Source } from "./source"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { LinkContent } from './linkContent.js';import { Source } from './source.js'; + + /** * Event object for when a user has linked their LINE account with a provider\'s service account. You can reply to account link events. */ -import { EventBase } from "./models"; - -export type AccountLinkEvent = EventBase & { - type: "accountLink"; - /** - * Reply token used to send reply message to this event. This property won\'t be included if linking the account has failed. - */ - replyToken?: string /**/; - /** - */ - link: LinkContent /**/; -}; - -export namespace AccountLinkEvent {} +import { EventBase } from './models.js'; + + +export type AccountLinkEvent = EventBase & { +type: "accountLink", + /** + * Reply token used to send reply message to this event. This property won\'t be included if linking the account has failed. + */ + 'replyToken'?: string/**/; + /** + */ + 'link': LinkContent/**/; + +} + + + +export namespace AccountLinkEvent { + + + +} + + + + + diff --git a/lib/webhook/model/actionResult.ts b/lib/webhook/model/actionResult.ts index accd73b58..594f766ea 100644 --- a/lib/webhook/model/actionResult.ts +++ b/lib/webhook/model/actionResult.ts @@ -10,16 +10,37 @@ * Do not edit the class manually. */ -export type ActionResult = { - /** - */ - type: ActionResult.TypeEnum /**/; - /** - * Base64-encoded binary data - */ - data?: string /**/; -}; + + + + +export type ActionResult = { + /** + */ + 'type': ActionResult.TypeEnum/**/; + /** + * Base64-encoded binary data + */ + 'data'?: string/**/; + +} + + + export namespace ActionResult { - export type TypeEnum = "void" | "binary"; + export type TypeEnum = + 'void' + | 'binary' + + + ; + + + } + + + + + diff --git a/lib/webhook/model/activatedEvent.ts b/lib/webhook/model/activatedEvent.ts index e2c14820a..bdf4e19b7 100644 --- a/lib/webhook/model/activatedEvent.ts +++ b/lib/webhook/model/activatedEvent.ts @@ -10,22 +10,33 @@ * Do not edit the class manually. */ -import { ChatControl } from "./chatControl"; -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { Source } from "./source"; + + import { ChatControl } from './chatControl.js';import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { Source } from './source.js'; + + /** * This event indicates that the module channel has been switched to Active Channel by calling the Acquire Control API. Sent to the webhook URL server of the module channel. */ -import { EventBase } from "./models"; +import { EventBase } from './models.js'; + + +export type ActivatedEvent = EventBase & { +type: "activated", + /** + */ + 'chatControl': ChatControl/**/; + +} + + + +export namespace ActivatedEvent { + + +} + + + -export type ActivatedEvent = EventBase & { - type: "activated"; - /** - */ - chatControl: ChatControl /**/; -}; -export namespace ActivatedEvent {} diff --git a/lib/webhook/model/allMentionee.ts b/lib/webhook/model/allMentionee.ts index c94ff3d01..3607a45b9 100644 --- a/lib/webhook/model/allMentionee.ts +++ b/lib/webhook/model/allMentionee.ts @@ -10,13 +10,25 @@ * Do not edit the class manually. */ -import { Mentionee } from "./mentionee"; + + import { Mentionee } from './mentionee.js'; + + /** * Mentioned target is entire group */ -import { MentioneeBase } from "./models"; +import { MentioneeBase } from './models.js'; + + +export type AllMentionee = MentioneeBase & { +type: "all", + +} + + + + + + -export type AllMentionee = MentioneeBase & { - type: "all"; -}; diff --git a/lib/webhook/model/attachedModuleContent.ts b/lib/webhook/model/attachedModuleContent.ts index ff07aab3f..498e9fe3f 100644 --- a/lib/webhook/model/attachedModuleContent.ts +++ b/lib/webhook/model/attachedModuleContent.ts @@ -10,18 +10,30 @@ * Do not edit the class manually. */ -import { ModuleContent } from "./moduleContent"; - -import { ModuleContentBase } from "./models"; - -export type AttachedModuleContent = ModuleContentBase & { - type: "attached"; - /** - * User ID of the bot on the attached LINE Official Account - */ - botId: string /**/; - /** - * An array of strings indicating the scope permitted by the admin of the LINE Official Account. - */ - scopes: Array /**/; -}; + + + import { ModuleContent } from './moduleContent.js'; + + +import { ModuleContentBase } from './models.js'; + + +export type AttachedModuleContent = ModuleContentBase & { +type: "attached", + /** + * User ID of the bot on the attached LINE Official Account + */ + 'botId': string/**/; + /** + * An array of strings indicating the scope permitted by the admin of the LINE Official Account. + */ + 'scopes': Array/**/; + +} + + + + + + + diff --git a/lib/webhook/model/audioMessageContent.ts b/lib/webhook/model/audioMessageContent.ts index 6cd23afa5..ec3b212aa 100644 --- a/lib/webhook/model/audioMessageContent.ts +++ b/lib/webhook/model/audioMessageContent.ts @@ -10,18 +10,29 @@ * Do not edit the class manually. */ -import { ContentProvider } from "./contentProvider"; -import { MessageContent } from "./messageContent"; - -import { MessageContentBase } from "./models"; - -export type AudioMessageContent = MessageContentBase & { - type: "audio"; - /** - */ - contentProvider: ContentProvider /**/; - /** - * Length of audio file (milliseconds) - */ - duration?: number /**/; -}; + + + import { ContentProvider } from './contentProvider.js';import { MessageContent } from './messageContent.js'; + + +import { MessageContentBase } from './models.js'; + + +export type AudioMessageContent = MessageContentBase & { +type: "audio", + /** + */ + 'contentProvider': ContentProvider/**/; + /** + * Length of audio file (milliseconds) + */ + 'duration'?: number/**/; + +} + + + + + + + diff --git a/lib/webhook/model/beaconContent.ts b/lib/webhook/model/beaconContent.ts index c143a3cb8..26e383d7f 100644 --- a/lib/webhook/model/beaconContent.ts +++ b/lib/webhook/model/beaconContent.ts @@ -10,21 +10,44 @@ * Do not edit the class manually. */ -export type BeaconContent = { - /** - * Hardware ID of the beacon that was detected - */ - hwid: string /**/; - /** - * Type of beacon event. - */ - type: BeaconContent.TypeEnum /**/; - /** - * Device message of beacon that was detected. - */ - dm?: string /**/; -}; + + + + +export type BeaconContent = { + /** + * Hardware ID of the beacon that was detected + */ + 'hwid': string/**/; + /** + * Type of beacon event. + */ + 'type': BeaconContent.TypeEnum/**/; + /** + * Device message of beacon that was detected. + */ + 'dm'?: string/**/; + +} + + + export namespace BeaconContent { - export type TypeEnum = "enter" | "banner" | "stay"; + + export type TypeEnum = + 'enter' + | 'banner' + | 'stay' + + + ; + + + } + + + + + diff --git a/lib/webhook/model/beaconEvent.ts b/lib/webhook/model/beaconEvent.ts index 7339c3902..6125758fd 100644 --- a/lib/webhook/model/beaconEvent.ts +++ b/lib/webhook/model/beaconEvent.ts @@ -10,26 +10,38 @@ * Do not edit the class manually. */ -import { BeaconContent } from "./beaconContent"; -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { Source } from "./source"; + + import { BeaconContent } from './beaconContent.js';import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { Source } from './source.js'; + + /** * Event object for when a user enters the range of a LINE Beacon. You can reply to beacon events. */ -import { EventBase } from "./models"; - -export type BeaconEvent = EventBase & { - type: "beacon"; - /** - * Reply token used to send reply message to this event - */ - replyToken: string /**/; - /** - */ - beacon: BeaconContent /**/; -}; - -export namespace BeaconEvent {} +import { EventBase } from './models.js'; + + +export type BeaconEvent = EventBase & { +type: "beacon", + /** + * Reply token used to send reply message to this event + */ + 'replyToken': string/**/; + /** + */ + 'beacon': BeaconContent/**/; + +} + + + +export namespace BeaconEvent { + + + +} + + + + + diff --git a/lib/webhook/model/botResumedEvent.ts b/lib/webhook/model/botResumedEvent.ts index b079bbf17..df716b40e 100644 --- a/lib/webhook/model/botResumedEvent.ts +++ b/lib/webhook/model/botResumedEvent.ts @@ -10,18 +10,29 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { Source } from "./source"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { Source } from './source.js'; + + /** * This event indicates that the LINE Official Account has returned from the suspended state. Sent to the webhook URL server of the module channel. */ -import { EventBase } from "./models"; +import { EventBase } from './models.js'; + + +export type BotResumedEvent = EventBase & { +type: "botResumed", + +} + + + +export namespace BotResumedEvent { + +} + + + -export type BotResumedEvent = EventBase & { - type: "botResumed"; -}; -export namespace BotResumedEvent {} diff --git a/lib/webhook/model/botSuspendedEvent.ts b/lib/webhook/model/botSuspendedEvent.ts index fabf6aecc..9a220199a 100644 --- a/lib/webhook/model/botSuspendedEvent.ts +++ b/lib/webhook/model/botSuspendedEvent.ts @@ -10,18 +10,29 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { Source } from "./source"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { Source } from './source.js'; + + /** * This event indicates that the LINE Official Account has been suspended (Suspend). Sent to the webhook URL server of the module channel. */ -import { EventBase } from "./models"; +import { EventBase } from './models.js'; + + +export type BotSuspendedEvent = EventBase & { +type: "botSuspended", + +} + + + +export namespace BotSuspendedEvent { + +} + + + -export type BotSuspendedEvent = EventBase & { - type: "botSuspended"; -}; -export namespace BotSuspendedEvent {} diff --git a/lib/webhook/model/callbackRequest.ts b/lib/webhook/model/callbackRequest.ts index e7aff1d7d..6278b48bd 100644 --- a/lib/webhook/model/callbackRequest.ts +++ b/lib/webhook/model/callbackRequest.ts @@ -10,22 +10,33 @@ * Do not edit the class manually. */ -import { Event } from "./event"; + + import { Event } from './event.js'; + + /** - * The request body contains a JSON object with the user ID of a bot that should receive webhook events and an array of webhook event objects. + * The request body contains a JSON object with the user ID of a bot that should receive webhook events and an array of webhook event objects. */ -export type CallbackRequest = { - /** - * User ID of a bot that should receive webhook events. The user ID value is a string that matches the regular expression, `U[0-9a-f]{32}`. - * - * @see destination Documentation - */ - destination: string /**/; - /** - * Array of webhook event objects. The LINE Platform may send an empty array that doesn\'t include a webhook event object to confirm communication. - * - * @see events Documentation - */ - events: Array /**/; -}; +export type CallbackRequest = { + /** + * User ID of a bot that should receive webhook events. The user ID value is a string that matches the regular expression, `U[0-9a-f]{32}`. + * + * @see destination Documentation + */ + 'destination': string/**/; + /** + * Array of webhook event objects. The LINE Platform may send an empty array that doesn\'t include a webhook event object to confirm communication. + * + * @see events Documentation + */ + 'events': Array/**/; + +} + + + + + + + diff --git a/lib/webhook/model/chatControl.ts b/lib/webhook/model/chatControl.ts index f5ced833c..538a8f471 100644 --- a/lib/webhook/model/chatControl.ts +++ b/lib/webhook/model/chatControl.ts @@ -10,8 +10,21 @@ * Do not edit the class manually. */ -export type ChatControl = { - /** - */ - expireAt: number /**/; -}; + + + + + +export type ChatControl = { + /** + */ + 'expireAt': number/**/; + +} + + + + + + + diff --git a/lib/webhook/model/contentProvider.ts b/lib/webhook/model/contentProvider.ts index 719113cfb..edc776027 100644 --- a/lib/webhook/model/contentProvider.ts +++ b/lib/webhook/model/contentProvider.ts @@ -10,24 +10,46 @@ * Do not edit the class manually. */ + + + + + /** * Provider of the media file. */ -export type ContentProvider = { - /** - * Provider of the image file. - */ - type: ContentProvider.TypeEnum /**/; - /** - * URL of the image file. Only included when contentProvider.type is external. - */ - originalContentUrl?: string /**/; - /** - * URL of the preview image. Only included when contentProvider.type is external. - */ - previewImageUrl?: string /**/; -}; +export type ContentProvider = { + /** + * Provider of the image file. + */ + 'type': ContentProvider.TypeEnum/**/; + /** + * URL of the image file. Only included when contentProvider.type is external. + */ + 'originalContentUrl'?: string/**/; + /** + * URL of the preview image. Only included when contentProvider.type is external. + */ + 'previewImageUrl'?: string/**/; + +} + + export namespace ContentProvider { - export type TypeEnum = "line" | "external"; + export type TypeEnum = + 'line' + | 'external' + + + ; + + + + } + + + + + diff --git a/lib/webhook/model/deactivatedEvent.ts b/lib/webhook/model/deactivatedEvent.ts index 8249bf1be..d2474d25d 100644 --- a/lib/webhook/model/deactivatedEvent.ts +++ b/lib/webhook/model/deactivatedEvent.ts @@ -10,18 +10,29 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { Source } from "./source"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { Source } from './source.js'; + + /** * This event indicates that the module channel has been switched to Standby Channel by calling Acquire Control API or Release Control API. Sent to the webhook URL server of the module channel. */ -import { EventBase } from "./models"; +import { EventBase } from './models.js'; + + +export type DeactivatedEvent = EventBase & { +type: "deactivated", + +} + + + +export namespace DeactivatedEvent { + +} + + + -export type DeactivatedEvent = EventBase & { - type: "deactivated"; -}; -export namespace DeactivatedEvent {} diff --git a/lib/webhook/model/deliveryContext.ts b/lib/webhook/model/deliveryContext.ts index 986c110af..91c9f472f 100644 --- a/lib/webhook/model/deliveryContext.ts +++ b/lib/webhook/model/deliveryContext.ts @@ -10,12 +10,25 @@ * Do not edit the class manually. */ + + + + + /** * webhook\'s delivery context information */ -export type DeliveryContext = { - /** - * Whether the webhook event is a redelivered one or not. - */ - isRedelivery: boolean /**/; -}; +export type DeliveryContext = { + /** + * Whether the webhook event is a redelivered one or not. + */ + 'isRedelivery': boolean/**/; + +} + + + + + + + diff --git a/lib/webhook/model/detachedModuleContent.ts b/lib/webhook/model/detachedModuleContent.ts index 8c94c829d..280a9fafe 100644 --- a/lib/webhook/model/detachedModuleContent.ts +++ b/lib/webhook/model/detachedModuleContent.ts @@ -10,22 +10,41 @@ * Do not edit the class manually. */ -import { ModuleContent } from "./moduleContent"; - -import { ModuleContentBase } from "./models"; - -export type DetachedModuleContent = ModuleContentBase & { - type: "detached"; - /** - * Detached LINE Official Account bot user ID - */ - botId: string /**/; - /** - * Reason for detaching - */ - reason: DetachedModuleContent.ReasonEnum /**/; -}; + + import { ModuleContent } from './moduleContent.js'; + + +import { ModuleContentBase } from './models.js'; + + +export type DetachedModuleContent = ModuleContentBase & { +type: "detached", + /** + * Detached LINE Official Account bot user ID + */ + 'botId': string/**/; + /** + * Reason for detaching + */ + 'reason': DetachedModuleContent.ReasonEnum/**/; + +} + + + export namespace DetachedModuleContent { - export type ReasonEnum = "bot_deleted"; + + export type ReasonEnum = + 'bot_deleted' + + + ; + + } + + + + + diff --git a/lib/webhook/model/emoji.ts b/lib/webhook/model/emoji.ts index 1a5c87893..9794e13dc 100644 --- a/lib/webhook/model/emoji.ts +++ b/lib/webhook/model/emoji.ts @@ -10,21 +10,34 @@ * Do not edit the class manually. */ -export type Emoji = { - /** - * Index position for a character in text, with the first character being at position 0. - */ - index: number /**/; - /** - * The length of the LINE emoji string. For LINE emoji (hello), 7 is the length. - */ - length: number /**/; - /** - * Product ID for a LINE emoji set. - */ - productId: string /**/; - /** - * ID for a LINE emoji inside a set. - */ - emojiId: string /**/; -}; + + + + + +export type Emoji = { + /** + * Index position for a character in text, with the first character being at position 0. + */ + 'index': number/**/; + /** + * The length of the LINE emoji string. For LINE emoji (hello), 7 is the length. + */ + 'length': number/**/; + /** + * Product ID for a LINE emoji set. + */ + 'productId': string/**/; + /** + * ID for a LINE emoji inside a set. + */ + 'emojiId': string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/event.ts b/lib/webhook/model/event.ts index 5081d5d90..35cd34546 100644 --- a/lib/webhook/model/event.ts +++ b/lib/webhook/model/event.ts @@ -10,81 +10,100 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { EventMode } from "./eventMode"; -import { Source } from "./source"; -import { AccountLinkEvent } from "./models"; -import { ActivatedEvent } from "./models"; -import { BeaconEvent } from "./models"; -import { BotResumedEvent } from "./models"; -import { BotSuspendedEvent } from "./models"; -import { DeactivatedEvent } from "./models"; -import { PnpDeliveryCompletionEvent } from "./models"; -import { FollowEvent } from "./models"; -import { JoinEvent } from "./models"; -import { LeaveEvent } from "./models"; -import { MemberJoinedEvent } from "./models"; -import { MemberLeftEvent } from "./models"; -import { MessageEvent } from "./models"; -import { ModuleEvent } from "./models"; -import { PostbackEvent } from "./models"; -import { ThingsEvent } from "./models"; -import { UnfollowEvent } from "./models"; -import { UnsendEvent } from "./models"; -import { VideoPlayCompleteEvent } from "./models"; + + import { DeliveryContext } from './deliveryContext.js';import { EventMode } from './eventMode.js';import { Source } from './source.js'; + + + import { AccountLinkEvent } from './models.js'; + import { ActivatedEvent } from './models.js'; + import { BeaconEvent } from './models.js'; + import { BotResumedEvent } from './models.js'; + import { BotSuspendedEvent } from './models.js'; + import { DeactivatedEvent } from './models.js'; + import { PnpDeliveryCompletionEvent } from './models.js'; + import { FollowEvent } from './models.js'; + import { JoinEvent } from './models.js'; + import { LeaveEvent } from './models.js'; + import { MemberJoinedEvent } from './models.js'; + import { MemberLeftEvent } from './models.js'; + import { MessageEvent } from './models.js'; + import { ModuleEvent } from './models.js'; + import { PostbackEvent } from './models.js'; + import { ThingsEvent } from './models.js'; + import { UnfollowEvent } from './models.js'; + import { UnsendEvent } from './models.js'; + import { VideoPlayCompleteEvent } from './models.js'; + export type Event = - | AccountLinkEvent // accountLink - | ActivatedEvent // activated - | BeaconEvent // beacon - | BotResumedEvent // botResumed - | BotSuspendedEvent // botSuspended - | DeactivatedEvent // deactivated - | PnpDeliveryCompletionEvent // delivery - | FollowEvent // follow - | JoinEvent // join - | LeaveEvent // leave - | MemberJoinedEvent // memberJoined - | MemberLeftEvent // memberLeft - | MessageEvent // message - | ModuleEvent // module - | PostbackEvent // postback - | ThingsEvent // things - | UnfollowEvent // unfollow - | UnsendEvent // unsend - | VideoPlayCompleteEvent // videoPlayComplete - | UnknownEvent; + | AccountLinkEvent // accountLink + | ActivatedEvent // activated + | BeaconEvent // beacon + | BotResumedEvent // botResumed + | BotSuspendedEvent // botSuspended + | DeactivatedEvent // deactivated + | PnpDeliveryCompletionEvent // delivery + | FollowEvent // follow + | JoinEvent // join + | LeaveEvent // leave + | MemberJoinedEvent // memberJoined + | MemberLeftEvent // memberLeft + | MessageEvent // message + | ModuleEvent // module + | PostbackEvent // postback + | ThingsEvent // things + | UnfollowEvent // unfollow + | UnsendEvent // unsend + | VideoPlayCompleteEvent // videoPlayComplete + | UnknownEvent +; export type UnknownEvent = EventBase & { - [key: string]: unknown; + [key: string]: unknown; }; - + /** * Webhook event */ -export type EventBase = { - /** - * Type of the event - */ - type: string /**/; - /** - */ - source?: Source /**/; - /** - * Time of the event in milliseconds. - */ - timestamp: number /**/; - /** - */ - mode: EventMode /**/; - /** - * Webhook Event ID. An ID that uniquely identifies a webhook event. This is a string in ULID format. - */ - webhookEventId: string /**/; - /** - */ - deliveryContext: DeliveryContext /**/; -}; +export type EventBase = { + /** + * Type of the event + */ + 'type': string/**/; + /** + */ + 'source'?: Source/**/; + /** + * Time of the event in milliseconds. + */ + 'timestamp': number/**/; + /** + */ + 'mode': EventMode/**/; + /** + * Webhook Event ID. An ID that uniquely identifies a webhook event. This is a string in ULID format. + */ + 'webhookEventId': string/**/; + /** + */ + 'deliveryContext': DeliveryContext/**/; + +} + + + +export namespace Event { + + + + + + + +} + + + + -export namespace Event {} diff --git a/lib/webhook/model/eventMode.ts b/lib/webhook/model/eventMode.ts index 4e72c1022..8dd9661c0 100644 --- a/lib/webhook/model/eventMode.ts +++ b/lib/webhook/model/eventMode.ts @@ -10,8 +10,22 @@ * Do not edit the class manually. */ + + + + + /** * Channel state. */ -export type EventMode = "active" | "standby"; + + + export type EventMode = + 'active' + | 'standby' + +; + + + diff --git a/lib/webhook/model/fileMessageContent.ts b/lib/webhook/model/fileMessageContent.ts index 2aa7bb9f4..ed1bef4b3 100644 --- a/lib/webhook/model/fileMessageContent.ts +++ b/lib/webhook/model/fileMessageContent.ts @@ -10,18 +10,30 @@ * Do not edit the class manually. */ -import { MessageContent } from "./messageContent"; - -import { MessageContentBase } from "./models"; - -export type FileMessageContent = MessageContentBase & { - type: "file"; - /** - * File name - */ - fileName: string /**/; - /** - * File size in bytes - */ - fileSize: number /**/; -}; + + + import { MessageContent } from './messageContent.js'; + + +import { MessageContentBase } from './models.js'; + + +export type FileMessageContent = MessageContentBase & { +type: "file", + /** + * File name + */ + 'fileName': string/**/; + /** + * File size in bytes + */ + 'fileSize': number/**/; + +} + + + + + + + diff --git a/lib/webhook/model/followDetail.ts b/lib/webhook/model/followDetail.ts index beaea308c..d8ccc206d 100644 --- a/lib/webhook/model/followDetail.ts +++ b/lib/webhook/model/followDetail.ts @@ -10,9 +10,22 @@ * Do not edit the class manually. */ -export type FollowDetail = { - /** - * Whether a user has added your LINE Official Account as a friend or unblocked. - */ - isUnblocked: boolean /**/; -}; + + + + + +export type FollowDetail = { + /** + * Whether a user has added your LINE Official Account as a friend or unblocked. + */ + 'isUnblocked': boolean/**/; + +} + + + + + + + diff --git a/lib/webhook/model/followEvent.ts b/lib/webhook/model/followEvent.ts index 791eef361..b689715af 100644 --- a/lib/webhook/model/followEvent.ts +++ b/lib/webhook/model/followEvent.ts @@ -10,26 +10,38 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { FollowDetail } from "./followDetail"; -import { Source } from "./source"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { FollowDetail } from './followDetail.js';import { Source } from './source.js'; + + /** * Event object for when your LINE Official Account is added as a friend (or unblocked). You can reply to follow events. */ -import { EventBase } from "./models"; - -export type FollowEvent = EventBase & { - type: "follow"; - /** - * Reply token used to send reply message to this event - */ - replyToken: string /**/; - /** - */ - follow: FollowDetail /**/; -}; - -export namespace FollowEvent {} +import { EventBase } from './models.js'; + + +export type FollowEvent = EventBase & { +type: "follow", + /** + * Reply token used to send reply message to this event + */ + 'replyToken': string/**/; + /** + */ + 'follow': FollowDetail/**/; + +} + + + +export namespace FollowEvent { + + + +} + + + + + diff --git a/lib/webhook/model/groupSource.ts b/lib/webhook/model/groupSource.ts index d33c7d00a..081f93882 100644 --- a/lib/webhook/model/groupSource.ts +++ b/lib/webhook/model/groupSource.ts @@ -10,18 +10,30 @@ * Do not edit the class manually. */ -import { Source } from "./source"; - -import { SourceBase } from "./models"; - -export type GroupSource = SourceBase & { - type: "group"; - /** - * Group ID of the source group chat - */ - groupId: string /**/; - /** - * ID of the source user. Only included in message events. Only users of LINE for iOS and LINE for Android are included in userId. - */ - userId?: string /**/; -}; + + + import { Source } from './source.js'; + + +import { SourceBase } from './models.js'; + + +export type GroupSource = SourceBase & { +type: "group", + /** + * Group ID of the source group chat + */ + 'groupId': string/**/; + /** + * ID of the source user. Only included in message events. Only users of LINE for iOS and LINE for Android are included in userId. + */ + 'userId'?: string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/imageMessageContent.ts b/lib/webhook/model/imageMessageContent.ts index f3b2b36d0..7b7f03ebf 100644 --- a/lib/webhook/model/imageMessageContent.ts +++ b/lib/webhook/model/imageMessageContent.ts @@ -10,22 +10,32 @@ * Do not edit the class manually. */ -import { ContentProvider } from "./contentProvider"; -import { ImageSet } from "./imageSet"; -import { MessageContent } from "./messageContent"; - -import { MessageContentBase } from "./models"; - -export type ImageMessageContent = MessageContentBase & { - type: "image"; - /** - */ - contentProvider: ContentProvider /**/; - /** - */ - imageSet?: ImageSet /**/; - /** - * Quote token to quote this message. - */ - quoteToken: string /**/; -}; + + + import { ContentProvider } from './contentProvider.js';import { ImageSet } from './imageSet.js';import { MessageContent } from './messageContent.js'; + + +import { MessageContentBase } from './models.js'; + + +export type ImageMessageContent = MessageContentBase & { +type: "image", + /** + */ + 'contentProvider': ContentProvider/**/; + /** + */ + 'imageSet'?: ImageSet/**/; + /** + * Quote token to quote this message. + */ + 'quoteToken': string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/imageSet.ts b/lib/webhook/model/imageSet.ts index dcfd99ff1..4b98e0de4 100644 --- a/lib/webhook/model/imageSet.ts +++ b/lib/webhook/model/imageSet.ts @@ -10,17 +10,30 @@ * Do not edit the class manually. */ -export type ImageSet = { - /** - * Image set ID. Only included when multiple images are sent simultaneously. - */ - id: string /**/; - /** - * An index starting from 1, indicating the image number in a set of images sent simultaneously. Only included when multiple images are sent simultaneously. However, it won\'t be included if the sender is using LINE 11.15 or earlier for Android. - */ - index?: number /**/; - /** - * The total number of images sent simultaneously. - */ - total?: number /**/; -}; + + + + + +export type ImageSet = { + /** + * Image set ID. Only included when multiple images are sent simultaneously. + */ + 'id': string/**/; + /** + * An index starting from 1, indicating the image number in a set of images sent simultaneously. Only included when multiple images are sent simultaneously. However, it won\'t be included if the sender is using LINE 11.15 or earlier for Android. + */ + 'index'?: number/**/; + /** + * The total number of images sent simultaneously. + */ + 'total'?: number/**/; + +} + + + + + + + diff --git a/lib/webhook/model/joinEvent.ts b/lib/webhook/model/joinEvent.ts index 8a39dd3e2..680c49e0f 100644 --- a/lib/webhook/model/joinEvent.ts +++ b/lib/webhook/model/joinEvent.ts @@ -10,22 +10,34 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { Source } from "./source"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { Source } from './source.js'; + + /** * Event object for when your LINE Official Account joins a group chat or multi-person chat. You can reply to join events. */ -import { EventBase } from "./models"; +import { EventBase } from './models.js'; + + +export type JoinEvent = EventBase & { +type: "join", + /** + * Reply token used to send reply message to this event + */ + 'replyToken': string/**/; + +} + + + +export namespace JoinEvent { + + +} + + + -export type JoinEvent = EventBase & { - type: "join"; - /** - * Reply token used to send reply message to this event - */ - replyToken: string /**/; -}; -export namespace JoinEvent {} diff --git a/lib/webhook/model/joinedMembers.ts b/lib/webhook/model/joinedMembers.ts index 397325fe4..26d4932f6 100644 --- a/lib/webhook/model/joinedMembers.ts +++ b/lib/webhook/model/joinedMembers.ts @@ -10,11 +10,22 @@ * Do not edit the class manually. */ -import { UserSource } from "./userSource"; - -export type JoinedMembers = { - /** - * Users who joined. Array of source user objects. - */ - members: Array /**/; -}; + + + import { UserSource } from './userSource.js'; + + +export type JoinedMembers = { + /** + * Users who joined. Array of source user objects. + */ + 'members': Array/**/; + +} + + + + + + + diff --git a/lib/webhook/model/leaveEvent.ts b/lib/webhook/model/leaveEvent.ts index 36dcf1b4f..e23fff474 100644 --- a/lib/webhook/model/leaveEvent.ts +++ b/lib/webhook/model/leaveEvent.ts @@ -10,18 +10,29 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { Source } from "./source"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { Source } from './source.js'; + + /** * Event object for when a user removes your LINE Official Account from a group chat or when your LINE Official Account leaves a group chat or multi-person chat. */ -import { EventBase } from "./models"; +import { EventBase } from './models.js'; + + +export type LeaveEvent = EventBase & { +type: "leave", + +} + + + +export namespace LeaveEvent { + +} + + + -export type LeaveEvent = EventBase & { - type: "leave"; -}; -export namespace LeaveEvent {} diff --git a/lib/webhook/model/leftMembers.ts b/lib/webhook/model/leftMembers.ts index 73214b4d2..0479d3cca 100644 --- a/lib/webhook/model/leftMembers.ts +++ b/lib/webhook/model/leftMembers.ts @@ -10,11 +10,22 @@ * Do not edit the class manually. */ -import { UserSource } from "./userSource"; - -export type LeftMembers = { - /** - * Users who left. Array of source user objects. - */ - members: Array /**/; -}; + + + import { UserSource } from './userSource.js'; + + +export type LeftMembers = { + /** + * Users who left. Array of source user objects. + */ + 'members': Array/**/; + +} + + + + + + + diff --git a/lib/webhook/model/linkContent.ts b/lib/webhook/model/linkContent.ts index 3e87c4817..88988ab3a 100644 --- a/lib/webhook/model/linkContent.ts +++ b/lib/webhook/model/linkContent.ts @@ -10,20 +10,41 @@ * Do not edit the class manually. */ + + + + + /** * Content of the account link event. */ -export type LinkContent = { - /** - * One of the following values to indicate whether linking the account was successful or not - */ - result: LinkContent.ResultEnum /**/; - /** - * Specified nonce (number used once) when verifying the user ID. - */ - nonce: string /**/; -}; +export type LinkContent = { + /** + * One of the following values to indicate whether linking the account was successful or not + */ + 'result': LinkContent.ResultEnum/**/; + /** + * Specified nonce (number used once) when verifying the user ID. + */ + 'nonce': string/**/; + +} + + export namespace LinkContent { - export type ResultEnum = "ok" | "failed"; + export type ResultEnum = + 'ok' + | 'failed' + + + ; + + + } + + + + + diff --git a/lib/webhook/model/linkThingsContent.ts b/lib/webhook/model/linkThingsContent.ts index 49acef1dd..60be7bd06 100644 --- a/lib/webhook/model/linkThingsContent.ts +++ b/lib/webhook/model/linkThingsContent.ts @@ -10,14 +10,26 @@ * Do not edit the class manually. */ -import { ThingsContent } from "./thingsContent"; -import { ThingsContentBase } from "./models"; -export type LinkThingsContent = ThingsContentBase & { - type: "link"; - /** - * Device ID of the device that has been linked with LINE. - */ - deviceId: string /**/; -}; + import { ThingsContent } from './thingsContent.js'; + + +import { ThingsContentBase } from './models.js'; + + +export type LinkThingsContent = ThingsContentBase & { +type: "link", + /** + * Device ID of the device that has been linked with LINE. + */ + 'deviceId': string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/locationMessageContent.ts b/lib/webhook/model/locationMessageContent.ts index 7581c77c8..525b49aed 100644 --- a/lib/webhook/model/locationMessageContent.ts +++ b/lib/webhook/model/locationMessageContent.ts @@ -10,26 +10,38 @@ * Do not edit the class manually. */ -import { MessageContent } from "./messageContent"; - -import { MessageContentBase } from "./models"; - -export type LocationMessageContent = MessageContentBase & { - type: "location"; - /** - * Title - */ - title?: string /**/; - /** - * Address - */ - address?: string /**/; - /** - * Latitude - */ - latitude: number /**/; - /** - * Longitude - */ - longitude: number /**/; -}; + + + import { MessageContent } from './messageContent.js'; + + +import { MessageContentBase } from './models.js'; + + +export type LocationMessageContent = MessageContentBase & { +type: "location", + /** + * Title + */ + 'title'?: string/**/; + /** + * Address + */ + 'address'?: string/**/; + /** + * Latitude + */ + 'latitude': number/**/; + /** + * Longitude + */ + 'longitude': number/**/; + +} + + + + + + + diff --git a/lib/webhook/model/memberJoinedEvent.ts b/lib/webhook/model/memberJoinedEvent.ts index 52f5ffa17..08cd1cbb0 100644 --- a/lib/webhook/model/memberJoinedEvent.ts +++ b/lib/webhook/model/memberJoinedEvent.ts @@ -10,26 +10,38 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { JoinedMembers } from "./joinedMembers"; -import { Source } from "./source"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { JoinedMembers } from './joinedMembers.js';import { Source } from './source.js'; + + /** * Event object for when a user joins a group chat or multi-person chat that the LINE Official Account is in. */ -import { EventBase } from "./models"; - -export type MemberJoinedEvent = EventBase & { - type: "memberJoined"; - /** - * Reply token used to send reply message to this event - */ - replyToken: string /**/; - /** - */ - joined: JoinedMembers /**/; -}; - -export namespace MemberJoinedEvent {} +import { EventBase } from './models.js'; + + +export type MemberJoinedEvent = EventBase & { +type: "memberJoined", + /** + * Reply token used to send reply message to this event + */ + 'replyToken': string/**/; + /** + */ + 'joined': JoinedMembers/**/; + +} + + + +export namespace MemberJoinedEvent { + + + +} + + + + + diff --git a/lib/webhook/model/memberLeftEvent.ts b/lib/webhook/model/memberLeftEvent.ts index 913449423..ccba4b02d 100644 --- a/lib/webhook/model/memberLeftEvent.ts +++ b/lib/webhook/model/memberLeftEvent.ts @@ -10,22 +10,33 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { LeftMembers } from "./leftMembers"; -import { Source } from "./source"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { LeftMembers } from './leftMembers.js';import { Source } from './source.js'; + + /** * Event object for when a user leaves a group chat or multi-person chat that the LINE Official Account is in. */ -import { EventBase } from "./models"; +import { EventBase } from './models.js'; + + +export type MemberLeftEvent = EventBase & { +type: "memberLeft", + /** + */ + 'left': LeftMembers/**/; + +} + + + +export namespace MemberLeftEvent { + + +} + + + -export type MemberLeftEvent = EventBase & { - type: "memberLeft"; - /** - */ - left: LeftMembers /**/; -}; -export namespace MemberLeftEvent {} diff --git a/lib/webhook/model/mention.ts b/lib/webhook/model/mention.ts index e0be19c3e..53f42feb3 100644 --- a/lib/webhook/model/mention.ts +++ b/lib/webhook/model/mention.ts @@ -10,11 +10,22 @@ * Do not edit the class manually. */ -import { Mentionee } from "./mentionee"; - -export type Mention = { - /** - * Array of one or more mention objects. Max: 20 mentions - */ - mentionees: Array /**/; -}; + + + import { Mentionee } from './mentionee.js'; + + +export type Mention = { + /** + * Array of one or more mention objects. Max: 20 mentions + */ + 'mentionees': Array/**/; + +} + + + + + + + diff --git a/lib/webhook/model/mentionee.ts b/lib/webhook/model/mentionee.ts index 9acfe4870..b9ef141a1 100644 --- a/lib/webhook/model/mentionee.ts +++ b/lib/webhook/model/mentionee.ts @@ -10,35 +10,50 @@ * Do not edit the class manually. */ -import { AllMentionee } from "./models"; -import { UserMentionee } from "./models"; + + + + + + import { AllMentionee } from './models.js'; + import { UserMentionee } from './models.js'; + export type Mentionee = - | AllMentionee // all - | UserMentionee // user - | UnknownMentionee; + | AllMentionee // all + | UserMentionee // user + | UnknownMentionee +; export type UnknownMentionee = MentioneeBase & { - [key: string]: unknown; + [key: string]: unknown; }; + +export type MentioneeBase = { + /** + * Mentioned target. + * + * @see type Documentation + */ + 'type': string/**/; + /** + * Index position of the user mention for a character in text, with the first character being at position 0. + * + * @see index Documentation + */ + 'index': number/**/; + /** + * The length of the text of the mentioned user. For a mention @example, 8 is the length. + * + * @see length Documentation + */ + 'length': number/**/; + +} + + + + + + -export type MentioneeBase = { - /** - * Mentioned target. - * - * @see type Documentation - */ - type: string /**/; - /** - * Index position of the user mention for a character in text, with the first character being at position 0. - * - * @see index Documentation - */ - index: number /**/; - /** - * The length of the text of the mentioned user. For a mention @example, 8 is the length. - * - * @see length Documentation - */ - length: number /**/; -}; diff --git a/lib/webhook/model/messageContent.ts b/lib/webhook/model/messageContent.ts index fb27d3678..d6a1f1685 100644 --- a/lib/webhook/model/messageContent.ts +++ b/lib/webhook/model/messageContent.ts @@ -10,39 +10,54 @@ * Do not edit the class manually. */ -import { AudioMessageContent } from "./models"; -import { FileMessageContent } from "./models"; -import { ImageMessageContent } from "./models"; -import { LocationMessageContent } from "./models"; -import { StickerMessageContent } from "./models"; -import { TextMessageContent } from "./models"; -import { VideoMessageContent } from "./models"; + + + + + + import { AudioMessageContent } from './models.js'; + import { FileMessageContent } from './models.js'; + import { ImageMessageContent } from './models.js'; + import { LocationMessageContent } from './models.js'; + import { StickerMessageContent } from './models.js'; + import { TextMessageContent } from './models.js'; + import { VideoMessageContent } from './models.js'; + export type MessageContent = - | AudioMessageContent // audio - | FileMessageContent // file - | ImageMessageContent // image - | LocationMessageContent // location - | StickerMessageContent // sticker - | TextMessageContent // text - | VideoMessageContent // video - | UnknownMessageContent; + | AudioMessageContent // audio + | FileMessageContent // file + | ImageMessageContent // image + | LocationMessageContent // location + | StickerMessageContent // sticker + | TextMessageContent // text + | VideoMessageContent // video + | UnknownMessageContent +; export type UnknownMessageContent = MessageContentBase & { - [key: string]: unknown; + [key: string]: unknown; }; + +export type MessageContentBase = { + /** + * Type + * + * @see type Documentation + */ + 'type': string/**/; + /** + * Message ID + * + * @see id Documentation + */ + 'id': string/**/; + +} + + + + + + -export type MessageContentBase = { - /** - * Type - * - * @see type Documentation - */ - type: string /**/; - /** - * Message ID - * - * @see id Documentation - */ - id: string /**/; -}; diff --git a/lib/webhook/model/messageEvent.ts b/lib/webhook/model/messageEvent.ts index 47a777304..e724de821 100644 --- a/lib/webhook/model/messageEvent.ts +++ b/lib/webhook/model/messageEvent.ts @@ -10,25 +10,37 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { MessageContent } from "./messageContent"; -import { Source } from "./source"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { MessageContent } from './messageContent.js';import { Source } from './source.js'; + + /** * Webhook event object which contains the sent message. */ -import { EventBase } from "./models"; - -export type MessageEvent = EventBase & { - type: "message"; - /** - */ - replyToken?: string /**/; - /** - */ - message: MessageContent /**/; -}; - -export namespace MessageEvent {} +import { EventBase } from './models.js'; + + +export type MessageEvent = EventBase & { +type: "message", + /** + */ + 'replyToken'?: string/**/; + /** + */ + 'message': MessageContent/**/; + +} + + + +export namespace MessageEvent { + + + +} + + + + + diff --git a/lib/webhook/model/models.ts b/lib/webhook/model/models.ts index c7b21aee1..75c34b41d 100644 --- a/lib/webhook/model/models.ts +++ b/lib/webhook/model/models.ts @@ -1,61 +1,2 @@ -export * from "./accountLinkEvent"; -export * from "./actionResult"; -export * from "./activatedEvent"; -export * from "./allMentionee"; -export * from "./attachedModuleContent"; -export * from "./audioMessageContent"; -export * from "./beaconContent"; -export * from "./beaconEvent"; -export * from "./botResumedEvent"; -export * from "./botSuspendedEvent"; -export * from "./callbackRequest"; -export * from "./chatControl"; -export * from "./contentProvider"; -export * from "./deactivatedEvent"; -export * from "./deliveryContext"; -export * from "./detachedModuleContent"; -export * from "./emoji"; -export * from "./event"; -export * from "./eventMode"; -export * from "./fileMessageContent"; -export * from "./followDetail"; -export * from "./followEvent"; -export * from "./groupSource"; -export * from "./imageMessageContent"; -export * from "./imageSet"; -export * from "./joinEvent"; -export * from "./joinedMembers"; -export * from "./leaveEvent"; -export * from "./leftMembers"; -export * from "./linkContent"; -export * from "./linkThingsContent"; -export * from "./locationMessageContent"; -export * from "./memberJoinedEvent"; -export * from "./memberLeftEvent"; -export * from "./mention"; -export * from "./mentionee"; -export * from "./messageContent"; -export * from "./messageEvent"; -export * from "./moduleContent"; -export * from "./moduleEvent"; -export * from "./pnpDelivery"; -export * from "./pnpDeliveryCompletionEvent"; -export * from "./postbackContent"; -export * from "./postbackEvent"; -export * from "./roomSource"; -export * from "./scenarioResult"; -export * from "./scenarioResultThingsContent"; -export * from "./source"; -export * from "./stickerMessageContent"; -export * from "./textMessageContent"; -export * from "./thingsContent"; -export * from "./thingsEvent"; -export * from "./unfollowEvent"; -export * from "./unlinkThingsContent"; -export * from "./unsendDetail"; -export * from "./unsendEvent"; -export * from "./userMentionee"; -export * from "./userSource"; -export * from "./videoMessageContent"; -export * from "./videoPlayComplete"; -export * from "./videoPlayCompleteEvent"; + +export * from './accountLinkEvent.js';export * from './actionResult.js';export * from './activatedEvent.js';export * from './allMentionee.js';export * from './attachedModuleContent.js';export * from './audioMessageContent.js';export * from './beaconContent.js';export * from './beaconEvent.js';export * from './botResumedEvent.js';export * from './botSuspendedEvent.js';export * from './callbackRequest.js';export * from './chatControl.js';export * from './contentProvider.js';export * from './deactivatedEvent.js';export * from './deliveryContext.js';export * from './detachedModuleContent.js';export * from './emoji.js';export * from './event.js';export * from './eventMode.js';export * from './fileMessageContent.js';export * from './followDetail.js';export * from './followEvent.js';export * from './groupSource.js';export * from './imageMessageContent.js';export * from './imageSet.js';export * from './joinEvent.js';export * from './joinedMembers.js';export * from './leaveEvent.js';export * from './leftMembers.js';export * from './linkContent.js';export * from './linkThingsContent.js';export * from './locationMessageContent.js';export * from './memberJoinedEvent.js';export * from './memberLeftEvent.js';export * from './mention.js';export * from './mentionee.js';export * from './messageContent.js';export * from './messageEvent.js';export * from './moduleContent.js';export * from './moduleEvent.js';export * from './pnpDelivery.js';export * from './pnpDeliveryCompletionEvent.js';export * from './postbackContent.js';export * from './postbackEvent.js';export * from './roomSource.js';export * from './scenarioResult.js';export * from './scenarioResultThingsContent.js';export * from './source.js';export * from './stickerMessageContent.js';export * from './textMessageContent.js';export * from './thingsContent.js';export * from './thingsEvent.js';export * from './unfollowEvent.js';export * from './unlinkThingsContent.js';export * from './unsendDetail.js';export * from './unsendEvent.js';export * from './userMentionee.js';export * from './userSource.js';export * from './videoMessageContent.js';export * from './videoPlayComplete.js';export * from './videoPlayCompleteEvent.js'; diff --git a/lib/webhook/model/moduleContent.ts b/lib/webhook/model/moduleContent.ts index 3e9c3abed..9628d26fc 100644 --- a/lib/webhook/model/moduleContent.ts +++ b/lib/webhook/model/moduleContent.ts @@ -10,21 +10,36 @@ * Do not edit the class manually. */ -import { AttachedModuleContent } from "./models"; -import { DetachedModuleContent } from "./models"; + + + + + + import { AttachedModuleContent } from './models.js'; + import { DetachedModuleContent } from './models.js'; + export type ModuleContent = - | AttachedModuleContent // attached - | DetachedModuleContent // detached - | UnknownModuleContent; + | AttachedModuleContent // attached + | DetachedModuleContent // detached + | UnknownModuleContent +; export type UnknownModuleContent = ModuleContentBase & { - [key: string]: unknown; + [key: string]: unknown; }; + +export type ModuleContentBase = { + /** + * Type + */ + 'type': string/**/; + +} + + + + + + -export type ModuleContentBase = { - /** - * Type - */ - type: string /**/; -}; diff --git a/lib/webhook/model/moduleEvent.ts b/lib/webhook/model/moduleEvent.ts index 11cdb6cd5..e1f146695 100644 --- a/lib/webhook/model/moduleEvent.ts +++ b/lib/webhook/model/moduleEvent.ts @@ -10,22 +10,33 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { ModuleContent } from "./moduleContent"; -import { Source } from "./source"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { ModuleContent } from './moduleContent.js';import { Source } from './source.js'; + + /** * This event indicates that the module channel has been attached to the LINE Official Account. Sent to the webhook URL server of the module channel. */ -import { EventBase } from "./models"; +import { EventBase } from './models.js'; + + +export type ModuleEvent = EventBase & { +type: "module", + /** + */ + 'module': ModuleContent/**/; + +} + + + +export namespace ModuleEvent { + + +} + + + -export type ModuleEvent = EventBase & { - type: "module"; - /** - */ - module: ModuleContent /**/; -}; -export namespace ModuleEvent {} diff --git a/lib/webhook/model/pnpDelivery.ts b/lib/webhook/model/pnpDelivery.ts index bc95beed2..4c2550610 100644 --- a/lib/webhook/model/pnpDelivery.ts +++ b/lib/webhook/model/pnpDelivery.ts @@ -10,12 +10,25 @@ * Do not edit the class manually. */ + + + + + /** * A delivery object containing a hashed phone number string or a string specified by `X-Line-Delivery-Tag` header */ -export type PnpDelivery = { - /** - * A hashed phone number string or a string specified by `X-Line-Delivery-Tag` header - */ - data: string /**/; -}; +export type PnpDelivery = { + /** + * A hashed phone number string or a string specified by `X-Line-Delivery-Tag` header + */ + 'data': string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/pnpDeliveryCompletionEvent.ts b/lib/webhook/model/pnpDeliveryCompletionEvent.ts index 8dcf61ed2..25af4f803 100644 --- a/lib/webhook/model/pnpDeliveryCompletionEvent.ts +++ b/lib/webhook/model/pnpDeliveryCompletionEvent.ts @@ -10,22 +10,33 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { PnpDelivery } from "./pnpDelivery"; -import { Source } from "./source"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { PnpDelivery } from './pnpDelivery.js';import { Source } from './source.js'; + + /** * When a request is made to the LINE notification messages API and delivery of the LINE notification message to the user is completed, a dedicated webhook event (delivery completion event) is sent from the LINE Platform to the webhook URL of the bot server. */ -import { EventBase } from "./models"; +import { EventBase } from './models.js'; + + +export type PnpDeliveryCompletionEvent = EventBase & { +type: "delivery", + /** + */ + 'delivery': PnpDelivery/**/; + +} + + + +export namespace PnpDeliveryCompletionEvent { + + +} + + + -export type PnpDeliveryCompletionEvent = EventBase & { - type: "delivery"; - /** - */ - delivery: PnpDelivery /**/; -}; -export namespace PnpDeliveryCompletionEvent {} diff --git a/lib/webhook/model/postbackContent.ts b/lib/webhook/model/postbackContent.ts index 62fdf7b4c..921b16da5 100644 --- a/lib/webhook/model/postbackContent.ts +++ b/lib/webhook/model/postbackContent.ts @@ -10,12 +10,25 @@ * Do not edit the class manually. */ -export type PostbackContent = { - /** - * Postback data - */ - data: string /**/; - /** - */ - params?: { [key: string]: string } /**/; -}; + + + + + +export type PostbackContent = { + /** + * Postback data + */ + 'data': string/**/; + /** + */ + 'params'?: { [key: string]: string; }/**/; + +} + + + + + + + diff --git a/lib/webhook/model/postbackEvent.ts b/lib/webhook/model/postbackEvent.ts index 4be8aed11..44ca7b806 100644 --- a/lib/webhook/model/postbackEvent.ts +++ b/lib/webhook/model/postbackEvent.ts @@ -10,26 +10,38 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { PostbackContent } from "./postbackContent"; -import { Source } from "./source"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { PostbackContent } from './postbackContent.js';import { Source } from './source.js'; + + /** * Event object for when a user performs a postback action which initiates a postback. You can reply to postback events. */ -import { EventBase } from "./models"; - -export type PostbackEvent = EventBase & { - type: "postback"; - /** - * Reply token used to send reply message to this event - */ - replyToken?: string /**/; - /** - */ - postback: PostbackContent /**/; -}; - -export namespace PostbackEvent {} +import { EventBase } from './models.js'; + + +export type PostbackEvent = EventBase & { +type: "postback", + /** + * Reply token used to send reply message to this event + */ + 'replyToken'?: string/**/; + /** + */ + 'postback': PostbackContent/**/; + +} + + + +export namespace PostbackEvent { + + + +} + + + + + diff --git a/lib/webhook/model/roomSource.ts b/lib/webhook/model/roomSource.ts index a5336fd61..8547fd9cb 100644 --- a/lib/webhook/model/roomSource.ts +++ b/lib/webhook/model/roomSource.ts @@ -10,18 +10,30 @@ * Do not edit the class manually. */ -import { Source } from "./source"; - -import { SourceBase } from "./models"; - -export type RoomSource = SourceBase & { - type: "room"; - /** - * ID of the source user. Only included in message events. Only users of LINE for iOS and LINE for Android are included in userId. - */ - userId?: string /**/; - /** - * Room ID of the source multi-person chat - */ - roomId: string /**/; -}; + + + import { Source } from './source.js'; + + +import { SourceBase } from './models.js'; + + +export type RoomSource = SourceBase & { +type: "room", + /** + * ID of the source user. Only included in message events. Only users of LINE for iOS and LINE for Android are included in userId. + */ + 'userId'?: string/**/; + /** + * Room ID of the source multi-person chat + */ + 'roomId': string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/scenarioResult.ts b/lib/webhook/model/scenarioResult.ts index 9c42d5c7a..29daeec00 100644 --- a/lib/webhook/model/scenarioResult.ts +++ b/lib/webhook/model/scenarioResult.ts @@ -10,55 +10,66 @@ * Do not edit the class manually. */ -import { ActionResult } from "./actionResult"; -export type ScenarioResult = { - /** - * Scenario ID executed - * - * @see scenarioId Documentation - */ - scenarioId?: string /**/; - /** - * Revision number of the scenario set containing the executed scenario - * - * @see revision Documentation - */ - revision?: number /**/; - /** - * Timestamp for when execution of scenario action started (milliseconds, LINE app time) - * - * @see startTime Documentation - */ - startTime: number /**/; - /** - * Timestamp for when execution of scenario was completed (milliseconds, LINE app time) - * - * @see endTime Documentation - */ - endTime: number /**/; - /** - * Scenario execution completion status - * - * @see resultCode Documentation - */ - resultCode: string /**/; - /** - * Execution result of individual operations specified in action. Only included when things.result.resultCode is success. - * - * @see actionResults Documentation - */ - actionResults?: Array /**/; - /** - * Data contained in notification. - * - * @see bleNotificationPayload Documentation - */ - bleNotificationPayload?: string /**/; - /** - * Error reason. - * - * @see errorReason Documentation - */ - errorReason?: string /**/; -}; + + import { ActionResult } from './actionResult.js'; + + +export type ScenarioResult = { + /** + * Scenario ID executed + * + * @see scenarioId Documentation + */ + 'scenarioId'?: string/**/; + /** + * Revision number of the scenario set containing the executed scenario + * + * @see revision Documentation + */ + 'revision'?: number/**/; + /** + * Timestamp for when execution of scenario action started (milliseconds, LINE app time) + * + * @see startTime Documentation + */ + 'startTime': number/**/; + /** + * Timestamp for when execution of scenario was completed (milliseconds, LINE app time) + * + * @see endTime Documentation + */ + 'endTime': number/**/; + /** + * Scenario execution completion status + * + * @see resultCode Documentation + */ + 'resultCode': string/**/; + /** + * Execution result of individual operations specified in action. Only included when things.result.resultCode is success. + * + * @see actionResults Documentation + */ + 'actionResults'?: Array/**/; + /** + * Data contained in notification. + * + * @see bleNotificationPayload Documentation + */ + 'bleNotificationPayload'?: string/**/; + /** + * Error reason. + * + * @see errorReason Documentation + */ + 'errorReason'?: string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/scenarioResultThingsContent.ts b/lib/webhook/model/scenarioResultThingsContent.ts index c9e0d9991..104a26e57 100644 --- a/lib/webhook/model/scenarioResultThingsContent.ts +++ b/lib/webhook/model/scenarioResultThingsContent.ts @@ -10,18 +10,29 @@ * Do not edit the class manually. */ -import { ScenarioResult } from "./scenarioResult"; -import { ThingsContent } from "./thingsContent"; - -import { ThingsContentBase } from "./models"; - -export type ScenarioResultThingsContent = ThingsContentBase & { - type: "scenarioResult"; - /** - * Device ID of the device that has been linked with LINE. - */ - deviceId: string /**/; - /** - */ - result: ScenarioResult /**/; -}; + + + import { ScenarioResult } from './scenarioResult.js';import { ThingsContent } from './thingsContent.js'; + + +import { ThingsContentBase } from './models.js'; + + +export type ScenarioResultThingsContent = ThingsContentBase & { +type: "scenarioResult", + /** + * Device ID of the device that has been linked with LINE. + */ + 'deviceId': string/**/; + /** + */ + 'result': ScenarioResult/**/; + +} + + + + + + + diff --git a/lib/webhook/model/source.ts b/lib/webhook/model/source.ts index d1f77b823..aba4ee3fc 100644 --- a/lib/webhook/model/source.ts +++ b/lib/webhook/model/source.ts @@ -10,28 +10,43 @@ * Do not edit the class manually. */ -import { GroupSource } from "./models"; -import { RoomSource } from "./models"; -import { UserSource } from "./models"; + + + + + + import { GroupSource } from './models.js'; + import { RoomSource } from './models.js'; + import { UserSource } from './models.js'; + export type Source = - | GroupSource // group - | RoomSource // room - | UserSource // user - | UnknownSource; + | GroupSource // group + | RoomSource // room + | UserSource // user + | UnknownSource +; export type UnknownSource = SourceBase & { - [key: string]: unknown; + [key: string]: unknown; }; - + /** * the source of the event. */ -export type SourceBase = { - /** - * source type - * - * @see type Documentation - */ - type?: string /**/; -}; +export type SourceBase = { + /** + * source type + * + * @see type Documentation + */ + 'type'?: string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/stickerMessageContent.ts b/lib/webhook/model/stickerMessageContent.ts index 524ac246d..17eacbf14 100644 --- a/lib/webhook/model/stickerMessageContent.ts +++ b/lib/webhook/model/stickerMessageContent.ts @@ -10,65 +10,88 @@ * Do not edit the class manually. */ -import { MessageContent } from "./messageContent"; -import { MessageContentBase } from "./models"; -export type StickerMessageContent = MessageContentBase & { - type: "sticker"; - /** - * Package ID - * - * @see packageId Documentation - */ - packageId: string /**/; - /** - * Sticker ID - * - * @see stickerId Documentation - */ - stickerId: string /**/; - /** - * - * @see stickerResourceType Documentation - */ - stickerResourceType: StickerMessageContent.StickerResourceTypeEnum /**/; - /** - * Array of up to 15 keywords describing the sticker. If a sticker has 16 or more keywords, a random selection of 15 keywords will be returned. The keyword selection is random for each event, so different keywords may be returned for the same sticker. - * - * @see keywords Documentation - */ - keywords?: Array /**/; - /** - * Any text entered by the user. This property is only included for message stickers. Max character limit: 100 - * - * @see text Documentation - */ - text?: string /**/; - /** - * Quote token to quote this message. - * - * @see quoteToken Documentation - */ - quoteToken: string /**/; - /** - * Message ID of a quoted message. Only included when the received message quotes a past message. - * - * @see quotedMessageId Documentation - */ - quotedMessageId?: string /**/; -}; + import { MessageContent } from './messageContent.js'; + +import { MessageContentBase } from './models.js'; + + +export type StickerMessageContent = MessageContentBase & { +type: "sticker", + /** + * Package ID + * + * @see packageId Documentation + */ + 'packageId': string/**/; + /** + * Sticker ID + * + * @see stickerId Documentation + */ + 'stickerId': string/**/; + /** + * + * @see stickerResourceType Documentation + */ + 'stickerResourceType': StickerMessageContent.StickerResourceTypeEnum/**/; + /** + * Array of up to 15 keywords describing the sticker. If a sticker has 16 or more keywords, a random selection of 15 keywords will be returned. The keyword selection is random for each event, so different keywords may be returned for the same sticker. + * + * @see keywords Documentation + */ + 'keywords'?: Array/**/; + /** + * Any text entered by the user. This property is only included for message stickers. Max character limit: 100 + * + * @see text Documentation + */ + 'text'?: string/**/; + /** + * Quote token to quote this message. + * + * @see quoteToken Documentation + */ + 'quoteToken': string/**/; + /** + * Message ID of a quoted message. Only included when the received message quotes a past message. + * + * @see quotedMessageId Documentation + */ + 'quotedMessageId'?: string/**/; + +} + + + export namespace StickerMessageContent { - export type StickerResourceTypeEnum = - | "STATIC" - | "ANIMATION" - | "SOUND" - | "ANIMATION_SOUND" - | "POPUP" - | "POPUP_SOUND" - | "CUSTOM" - | "MESSAGE" - | "NAME_TEXT" - | "PER_STICKER_TEXT"; + + + export type StickerResourceTypeEnum = + 'STATIC' + | 'ANIMATION' + | 'SOUND' + | 'ANIMATION_SOUND' + | 'POPUP' + | 'POPUP_SOUND' + | 'CUSTOM' + | 'MESSAGE' + | 'NAME_TEXT' + | 'PER_STICKER_TEXT' + + + ; + + + + + + } + + + + + diff --git a/lib/webhook/model/textMessageContent.ts b/lib/webhook/model/textMessageContent.ts index 37d9771ce..13262b3e3 100644 --- a/lib/webhook/model/textMessageContent.ts +++ b/lib/webhook/model/textMessageContent.ts @@ -10,31 +10,41 @@ * Do not edit the class manually. */ -import { Emoji } from "./emoji"; -import { Mention } from "./mention"; -import { MessageContent } from "./messageContent"; - -import { MessageContentBase } from "./models"; - -export type TextMessageContent = MessageContentBase & { - type: "text"; - /** - * Message text. - */ - text: string /**/; - /** - * Array of one or more LINE emoji objects. Only included in the message event when the text property contains a LINE emoji. - */ - emojis?: Array /**/; - /** - */ - mention?: Mention /**/; - /** - * Quote token to quote this message. - */ - quoteToken: string /**/; - /** - * Message ID of a quoted message. Only included when the received message quotes a past message. - */ - quotedMessageId?: string /**/; -}; + + + import { Emoji } from './emoji.js';import { Mention } from './mention.js';import { MessageContent } from './messageContent.js'; + + +import { MessageContentBase } from './models.js'; + + +export type TextMessageContent = MessageContentBase & { +type: "text", + /** + * Message text. + */ + 'text': string/**/; + /** + * Array of one or more LINE emoji objects. Only included in the message event when the text property contains a LINE emoji. + */ + 'emojis'?: Array/**/; + /** + */ + 'mention'?: Mention/**/; + /** + * Quote token to quote this message. + */ + 'quoteToken': string/**/; + /** + * Message ID of a quoted message. Only included when the received message quotes a past message. + */ + 'quotedMessageId'?: string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/thingsContent.ts b/lib/webhook/model/thingsContent.ts index 66c4d262c..460ce206b 100644 --- a/lib/webhook/model/thingsContent.ts +++ b/lib/webhook/model/thingsContent.ts @@ -10,23 +10,38 @@ * Do not edit the class manually. */ -import { LinkThingsContent } from "./models"; -import { ScenarioResultThingsContent } from "./models"; -import { UnlinkThingsContent } from "./models"; + + + + + + import { LinkThingsContent } from './models.js'; + import { ScenarioResultThingsContent } from './models.js'; + import { UnlinkThingsContent } from './models.js'; + export type ThingsContent = - | LinkThingsContent // link - | ScenarioResultThingsContent // scenarioResult - | UnlinkThingsContent // unlink - | UnknownThingsContent; + | LinkThingsContent // link + | ScenarioResultThingsContent // scenarioResult + | UnlinkThingsContent // unlink + | UnknownThingsContent +; export type UnknownThingsContent = ThingsContentBase & { - [key: string]: unknown; + [key: string]: unknown; }; + +export type ThingsContentBase = { + /** + * Type + */ + 'type': string/**/; + +} + + + + + + -export type ThingsContentBase = { - /** - * Type - */ - type: string /**/; -}; diff --git a/lib/webhook/model/thingsEvent.ts b/lib/webhook/model/thingsEvent.ts index cea3a5a6c..5060fe8c9 100644 --- a/lib/webhook/model/thingsEvent.ts +++ b/lib/webhook/model/thingsEvent.ts @@ -10,26 +10,38 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { Source } from "./source"; -import { ThingsContent } from "./thingsContent"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { Source } from './source.js';import { ThingsContent } from './thingsContent.js'; + + /** * Indicates that a user linked a device with LINE. */ -import { EventBase } from "./models"; - -export type ThingsEvent = EventBase & { - type: "things"; - /** - * Reply token used to send reply message to this event - */ - replyToken: string /**/; - /** - */ - things: ThingsContent /**/; -}; - -export namespace ThingsEvent {} +import { EventBase } from './models.js'; + + +export type ThingsEvent = EventBase & { +type: "things", + /** + * Reply token used to send reply message to this event + */ + 'replyToken': string/**/; + /** + */ + 'things': ThingsContent/**/; + +} + + + +export namespace ThingsEvent { + + + +} + + + + + diff --git a/lib/webhook/model/unfollowEvent.ts b/lib/webhook/model/unfollowEvent.ts index b167e4bba..d849bb6ae 100644 --- a/lib/webhook/model/unfollowEvent.ts +++ b/lib/webhook/model/unfollowEvent.ts @@ -10,18 +10,29 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { Source } from "./source"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { Source } from './source.js'; + + /** * Event object for when your LINE Official Account is blocked. */ -import { EventBase } from "./models"; +import { EventBase } from './models.js'; + + +export type UnfollowEvent = EventBase & { +type: "unfollow", + +} + + + +export namespace UnfollowEvent { + +} + + + -export type UnfollowEvent = EventBase & { - type: "unfollow"; -}; -export namespace UnfollowEvent {} diff --git a/lib/webhook/model/unlinkThingsContent.ts b/lib/webhook/model/unlinkThingsContent.ts index 33ccddb79..4fcc4f346 100644 --- a/lib/webhook/model/unlinkThingsContent.ts +++ b/lib/webhook/model/unlinkThingsContent.ts @@ -10,14 +10,26 @@ * Do not edit the class manually. */ -import { ThingsContent } from "./thingsContent"; -import { ThingsContentBase } from "./models"; -export type UnlinkThingsContent = ThingsContentBase & { - type: "unlink"; - /** - * Device ID of the device that has been linked with LINE. - */ - deviceId: string /**/; -}; + import { ThingsContent } from './thingsContent.js'; + + +import { ThingsContentBase } from './models.js'; + + +export type UnlinkThingsContent = ThingsContentBase & { +type: "unlink", + /** + * Device ID of the device that has been linked with LINE. + */ + 'deviceId': string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/unsendDetail.ts b/lib/webhook/model/unsendDetail.ts index b7d276347..83cc475cd 100644 --- a/lib/webhook/model/unsendDetail.ts +++ b/lib/webhook/model/unsendDetail.ts @@ -10,9 +10,22 @@ * Do not edit the class manually. */ -export type UnsendDetail = { - /** - * The message ID of the unsent message - */ - messageId: string /**/; -}; + + + + + +export type UnsendDetail = { + /** + * The message ID of the unsent message + */ + 'messageId': string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/unsendEvent.ts b/lib/webhook/model/unsendEvent.ts index 892f2acbf..3e3c7b24c 100644 --- a/lib/webhook/model/unsendEvent.ts +++ b/lib/webhook/model/unsendEvent.ts @@ -10,22 +10,33 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { Source } from "./source"; -import { UnsendDetail } from "./unsendDetail"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { Source } from './source.js';import { UnsendDetail } from './unsendDetail.js'; + + /** * Event object for when the user unsends a message. */ -import { EventBase } from "./models"; +import { EventBase } from './models.js'; + + +export type UnsendEvent = EventBase & { +type: "unsend", + /** + */ + 'unsend': UnsendDetail/**/; + +} + + + +export namespace UnsendEvent { + + +} + + + -export type UnsendEvent = EventBase & { - type: "unsend"; - /** - */ - unsend: UnsendDetail /**/; -}; -export namespace UnsendEvent {} diff --git a/lib/webhook/model/userMentionee.ts b/lib/webhook/model/userMentionee.ts index 37091e293..5623bee07 100644 --- a/lib/webhook/model/userMentionee.ts +++ b/lib/webhook/model/userMentionee.ts @@ -10,17 +10,29 @@ * Do not edit the class manually. */ -import { Mentionee } from "./mentionee"; + + import { Mentionee } from './mentionee.js'; + + /** * Mentioned target is user */ -import { MentioneeBase } from "./models"; - -export type UserMentionee = MentioneeBase & { - type: "user"; - /** - * User ID of the mentioned user. Only included if mention.mentions[].type is user and the user consents to the LINE Official Account obtaining their user profile information. - */ - userId?: string /**/; -}; +import { MentioneeBase } from './models.js'; + + +export type UserMentionee = MentioneeBase & { +type: "user", + /** + * User ID of the mentioned user. Only included if mention.mentions[].type is user and the user consents to the LINE Official Account obtaining their user profile information. + */ + 'userId'?: string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/userSource.ts b/lib/webhook/model/userSource.ts index 7213853f9..fa81f9a40 100644 --- a/lib/webhook/model/userSource.ts +++ b/lib/webhook/model/userSource.ts @@ -10,14 +10,26 @@ * Do not edit the class manually. */ -import { Source } from "./source"; -import { SourceBase } from "./models"; -export type UserSource = SourceBase & { - type: "user"; - /** - * ID of the source user - */ - userId?: string /**/; -}; + import { Source } from './source.js'; + + +import { SourceBase } from './models.js'; + + +export type UserSource = SourceBase & { +type: "user", + /** + * ID of the source user + */ + 'userId'?: string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/videoMessageContent.ts b/lib/webhook/model/videoMessageContent.ts index fbe80ccc6..f58e6de49 100644 --- a/lib/webhook/model/videoMessageContent.ts +++ b/lib/webhook/model/videoMessageContent.ts @@ -10,22 +10,33 @@ * Do not edit the class manually. */ -import { ContentProvider } from "./contentProvider"; -import { MessageContent } from "./messageContent"; - -import { MessageContentBase } from "./models"; - -export type VideoMessageContent = MessageContentBase & { - type: "video"; - /** - * Length of video file (milliseconds) - */ - duration?: number /**/; - /** - */ - contentProvider: ContentProvider /**/; - /** - * Quote token to quote this message. - */ - quoteToken: string /**/; -}; + + + import { ContentProvider } from './contentProvider.js';import { MessageContent } from './messageContent.js'; + + +import { MessageContentBase } from './models.js'; + + +export type VideoMessageContent = MessageContentBase & { +type: "video", + /** + * Length of video file (milliseconds) + */ + 'duration'?: number/**/; + /** + */ + 'contentProvider': ContentProvider/**/; + /** + * Quote token to quote this message. + */ + 'quoteToken': string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/videoPlayComplete.ts b/lib/webhook/model/videoPlayComplete.ts index aa672f57c..f43ce3caf 100644 --- a/lib/webhook/model/videoPlayComplete.ts +++ b/lib/webhook/model/videoPlayComplete.ts @@ -10,9 +10,22 @@ * Do not edit the class manually. */ -export type VideoPlayComplete = { - /** - * ID used to identify a video. Returns the same value as the trackingId assigned to the video message. - */ - trackingId: string /**/; -}; + + + + + +export type VideoPlayComplete = { + /** + * ID used to identify a video. Returns the same value as the trackingId assigned to the video message. + */ + 'trackingId': string/**/; + +} + + + + + + + diff --git a/lib/webhook/model/videoPlayCompleteEvent.ts b/lib/webhook/model/videoPlayCompleteEvent.ts index 5b7458230..353fb70a8 100644 --- a/lib/webhook/model/videoPlayCompleteEvent.ts +++ b/lib/webhook/model/videoPlayCompleteEvent.ts @@ -10,26 +10,38 @@ * Do not edit the class manually. */ -import { DeliveryContext } from "./deliveryContext"; -import { Event } from "./event"; -import { EventMode } from "./eventMode"; -import { Source } from "./source"; -import { VideoPlayComplete } from "./videoPlayComplete"; + + import { DeliveryContext } from './deliveryContext.js';import { Event } from './event.js';import { EventMode } from './eventMode.js';import { Source } from './source.js';import { VideoPlayComplete } from './videoPlayComplete.js'; + + /** * Event for when a user finishes viewing a video at least once with the specified trackingId sent by the LINE Official Account. */ -import { EventBase } from "./models"; - -export type VideoPlayCompleteEvent = EventBase & { - type: "videoPlayComplete"; - /** - * Reply token used to send reply message to this event - */ - replyToken: string /**/; - /** - */ - videoPlayComplete: VideoPlayComplete /**/; -}; - -export namespace VideoPlayCompleteEvent {} +import { EventBase } from './models.js'; + + +export type VideoPlayCompleteEvent = EventBase & { +type: "videoPlayComplete", + /** + * Reply token used to send reply message to this event + */ + 'replyToken': string/**/; + /** + */ + 'videoPlayComplete': VideoPlayComplete/**/; + +} + + + +export namespace VideoPlayCompleteEvent { + + + +} + + + + + diff --git a/package-lock.json b/package-lock.json index 2dcabe352..435e217e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,24 +8,24 @@ "name": "@line/bot-sdk", "version": "__LINE_BOT_SDK_NODEJS_VERSION__", "license": "Apache-2.0", - "dependencies": { - "@types/node": "^20.0.0" - }, "devDependencies": { "@types/express": "4.17.21", "@types/finalhandler": "1.2.3", - "@types/mocha": "10.0.6", + "@types/mocha": "^10.0.6", + "@types/node": "^20.11.30", "express": "4.18.3", "finalhandler": "1.2.0", "husky": "9.0.11", - "mocha": "10.3.0", + "mocha": "^10.3.0", "msw": "2.2.8", "nyc": "15.1.0", "prettier": "3.2.5", - "ts-node": "10.9.2", + "ts-node": "^10.9.2", + "ts-node-test-register": "^10.0.0", + "tsconfig-to-dual-package": "^1.2.0", "typedoc": "^0.25.1", "typedoc-plugin-markdown": "^3.16.0", - "typescript": "5.4.2", + "typescript": "^5.4.2", "vuepress": "^2.0.0-beta.67" }, "engines": { @@ -1753,10 +1753,17 @@ "version": "20.11.30", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz", "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==", + "dev": true, "dependencies": { "undici-types": "~5.26.4" } }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "dev": true + }, "node_modules/@types/qs": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", @@ -3466,6 +3473,15 @@ "node": ">=4" } }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, "node_modules/es-module-lexer": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.1.tgz", @@ -4089,10 +4105,13 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/gensync": { "version": "1.0.0-beta.2", @@ -4353,6 +4372,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -4368,6 +4399,12 @@ "integrity": "sha512-EWGTfnTqAO2L/j5HZgoM/3z82L7necsJ0pO9Tp0X1wil3PDLrkypTBRgVO2ExehEEvUycejZD3FuRaXpZZc3kw==", "dev": true }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -4504,6 +4541,12 @@ "node": ">= 0.10" } }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -4516,6 +4559,18 @@ "node": ">=8" } }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -4821,9 +4876,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true, - "optional": true, - "peer": true + "dev": true }, "node_modules/json-schema-traverse": { "version": "0.4.1", @@ -4881,6 +4934,12 @@ "node": ">=10" } }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, "node_modules/linkify-it": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-4.0.1.tgz", @@ -5443,6 +5502,27 @@ "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", "dev": true }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -5866,6 +5946,24 @@ "node": ">=8" } }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -5902,6 +6000,12 @@ "node": ">=8" } }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, "node_modules/path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -6138,6 +6242,30 @@ "node": ">= 0.6" } }, + "node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -6191,6 +6319,39 @@ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-tsconfig": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/resolve-tsconfig/-/resolve-tsconfig-1.3.0.tgz", + "integrity": "sha512-Ba5mo3soshb2CnIcNFz75F/80H/2eMVxrlmdgoSDNH7Lr6UAoT3BvxNtc7+VXqKSBlC0SJk2qSXOTcy0/p7cFw==", + "dev": true, + "engines": { + "node": ">=16", + "pnpm": ">=7" + }, + "funding": { + "url": "https://github.com/sponsors/skarab42" + }, + "peerDependencies": { + "typescript": "*" + } + }, "node_modules/restore-cursor": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", @@ -6606,6 +6767,38 @@ "node": ">=8" } }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", + "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", + "dev": true + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -6731,6 +6924,18 @@ "node": ">=8" } }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -6914,6 +7119,18 @@ } } }, + "node_modules/ts-node-test-register": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/ts-node-test-register/-/ts-node-test-register-10.0.0.tgz", + "integrity": "sha512-W8yzvufsG7/ulT65G1D218HMPf6uduojDXuSrGAaakkZlUtuLC+3pxphDktBe/N9w5Gi7teAxKCaTpBH5p6fkQ==", + "dev": true, + "dependencies": { + "read-pkg": "^5.2.0" + }, + "peerDependencies": { + "ts-node": "^10.0.0" + } + }, "node_modules/ts-node/node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -6923,6 +7140,24 @@ "node": ">=0.3.1" } }, + "node_modules/tsconfig-to-dual-package": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-to-dual-package/-/tsconfig-to-dual-package-1.2.0.tgz", + "integrity": "sha512-UtMinqTLfWr9fX6KidLsEcCJoA/jSLPIS00ohpQybMSxA3LlJCRf2DsGPw4AJJ8AP4FOHfbQJFJ5XgLoL7RoLw==", + "dev": true, + "dependencies": { + "resolve-tsconfig": "^1.3.0" + }, + "bin": { + "tsconfig-to-dual-package": "bin/cmd.mjs" + }, + "engines": { + "node": ">=18.3.0 || >=16.17.0" + }, + "peerDependencies": { + "typescript": ">=4.0.0" + } + }, "node_modules/type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", @@ -7046,7 +7281,8 @@ "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true }, "node_modules/unicorn-magic": { "version": "0.1.0", @@ -7160,6 +7396,16 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/package.json b/package.json index d11b4cb1c..a97c7bf9c 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,8 @@ "engines": { "node": ">=18" }, - "main": "dist/index.js", - "types": "dist/index.d.ts", - "files": [ - "dist", - "lib" - ], + "main": "./dist/index.js", + "types": "./module/index.d.ts", "scripts": { "pretest": "npm run format && npm run build", "test": "TEST_PORT=1234 TS_NODE_CACHE=0 mocha --exit", @@ -18,9 +14,9 @@ "prettier": "prettier \"{lib,test}/**/*.ts\"", "format": "npm run prettier -- --write", "format:check": "npm run prettier -- -l", - "clean": "rm -rf dist/*", + "clean": "git clean -fx dist/ module/", "prebuild": "npm run format:check && npm run clean", - "build": "tsc", + "build": "tsc -p . && tsc -p ./tsconfig.cjs.json && tsconfig-to-dual-package", "docs": "vuepress dev docs", "docs:build": "vuepress build docs", "docs:deploy": "./scripts/deploy-docs.sh", @@ -37,27 +33,27 @@ "line", "sdk" ], - "dependencies": { - "@types/node": "^20.0.0" - }, "optionalDependencies": { "axios": "^1.0.0" }, "devDependencies": { "@types/express": "4.17.21", "@types/finalhandler": "1.2.3", - "@types/mocha": "10.0.6", + "@types/mocha": "^10.0.6", + "@types/node": "^20.11.30", "express": "4.18.3", "finalhandler": "1.2.0", "husky": "9.0.11", - "mocha": "10.3.0", + "mocha": "^10.3.0", "msw": "2.2.8", "nyc": "15.1.0", "prettier": "3.2.5", - "ts-node": "10.9.2", + "ts-node": "^10.9.2", + "ts-node-test-register": "^10.0.0", + "tsconfig-to-dual-package": "^1.2.0", "typedoc": "^0.25.1", "typedoc-plugin-markdown": "^3.16.0", - "typescript": "5.4.2", + "typescript": "^5.4.2", "vuepress": "^2.0.0-beta.67" }, "husky": { @@ -87,5 +83,28 @@ "lib/**/tests/**/*.spec.ts" ] }, - "license": "Apache-2.0" + "license": "Apache-2.0", + "type": "module", + "module": "./module/index.js", + "exports": { + ".": { + "import": { + "types": "./module/index.d.ts", + "default": "./module/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "./dist/", + "./bin/", + "./module/", + "./lib/" + ], + "packageManager": "npm@9.5.1" } diff --git a/test/client.spec.ts b/test/client.spec.ts index 221e4be20..fc173e7d3 100644 --- a/test/client.spec.ts +++ b/test/client.spec.ts @@ -2,9 +2,9 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; import { deepEqual, equal, ok, strictEqual } from "node:assert"; import { URL } from "node:url"; -import Client, { OAuth } from "../lib/client"; -import * as Types from "../lib/types"; -import { getStreamData } from "./helpers/stream"; +import Client, { OAuth } from "../lib/client.js"; +import * as Types from "../lib/types.js"; +import { getStreamData } from "./helpers/stream.js"; import { http, HttpResponse } from "msw"; import { setupServer } from "msw/node"; import { @@ -12,9 +12,17 @@ import { MESSAGING_API_PREFIX, OAUTH_BASE_PREFIX, OAUTH_BASE_PREFIX_V2_1, -} from "../lib/endpoints"; +} from "../lib/endpoints.js"; -const pkg = require("../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../package.json"); + +import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); const channelAccessToken = "test_channel_access_token"; diff --git a/test/helpers/test-server.ts b/test/helpers/test-server.ts index 234e0d1d0..3b74e8014 100644 --- a/test/helpers/test-server.ts +++ b/test/helpers/test-server.ts @@ -1,13 +1,19 @@ -import * as bodyParser from "body-parser"; -import * as express from "express"; +import bodyParser from "body-parser"; +import express from "express"; import { Server } from "node:http"; import { join } from "node:path"; import { writeFileSync } from "node:fs"; import { JSONParseError, SignatureValidationFailed, -} from "../../lib/exceptions"; -import * as finalhandler from "finalhandler"; +} from "../../lib/exceptions.js"; +import finalhandler from "finalhandler"; + +import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); let server: Server | null = null; diff --git a/test/http-axios.spec.ts b/test/http-axios.spec.ts index ca8cf482c..c9ec4dcd2 100644 --- a/test/http-axios.spec.ts +++ b/test/http-axios.spec.ts @@ -1,14 +1,23 @@ import { deepEqual, equal, ok } from "node:assert"; -import { HTTPError } from "../lib/exceptions"; -import HTTPClient from "../lib/http-axios"; -import { getStreamData } from "./helpers/stream"; +import { HTTPError } from "../lib/exceptions.js"; +import HTTPClient from "../lib/http-axios.js"; +import { getStreamData } from "./helpers/stream.js"; import { http, HttpResponse } from "msw"; import { setupServer } from "msw/node"; import { createReadStream, readFileSync } from "node:fs"; import { join } from "node:path"; import * as fs from "node:fs"; -const pkg = require("../package.json"); +import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../package.json"); + const baseURL = "https://line.me"; describe("http", () => { const httpClient = new HTTPClient({ diff --git a/test/http-fetch.spec.ts b/test/http-fetch.spec.ts index f14829252..6350425e4 100644 --- a/test/http-fetch.spec.ts +++ b/test/http-fetch.spec.ts @@ -1,13 +1,24 @@ import { deepEqual, equal, ok } from "node:assert"; -import { HTTPFetchError } from "../lib"; -import HTTPFetchClient, { convertResponseToReadable } from "../lib/http-fetch"; -import { getStreamData } from "./helpers/stream"; +import { HTTPFetchError } from "../lib/index.js"; +import HTTPFetchClient, { + convertResponseToReadable, +} from "../lib/http-fetch.js"; +import { getStreamData } from "./helpers/stream.js"; import { http, HttpResponse } from "msw"; import { setupServer } from "msw/node"; import { join } from "node:path"; import * as fs from "node:fs"; -const pkg = require("../package.json"); +import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../package.json"); + const baseURL = "https://line.me"; describe("http(fetch)", () => { diff --git a/test/libs-channelAccessToken.spec.ts b/test/libs-channelAccessToken.spec.ts index e12cf5b08..d0f6dbe22 100644 --- a/test/libs-channelAccessToken.spec.ts +++ b/test/libs-channelAccessToken.spec.ts @@ -1,9 +1,11 @@ -import { channelAccessToken } from "../lib"; +import { channelAccessToken } from "../lib/index.js"; import { http, HttpResponse } from "msw"; import { setupServer } from "msw/node"; import { deepEqual, equal } from "node:assert"; -const pkg = require("../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../package.json"); const client = new channelAccessToken.ChannelAccessTokenClient({}); diff --git a/test/libs-manageAudience.spec.ts b/test/libs-manageAudience.spec.ts index 1d9fa3aad..cab1ce7fc 100644 --- a/test/libs-manageAudience.spec.ts +++ b/test/libs-manageAudience.spec.ts @@ -1,9 +1,11 @@ -import { manageAudience } from "../lib"; +import { manageAudience } from "../lib/index.js"; import { http, HttpResponse } from "msw"; import { setupServer } from "msw/node"; import { deepEqual, equal, match } from "node:assert"; -const pkg = require("../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../package.json"); const channelAccessToken = "test_channel_access_token"; diff --git a/test/libs-messagingApi.spec.ts b/test/libs-messagingApi.spec.ts index eab38cb37..79430cbc5 100644 --- a/test/libs-messagingApi.spec.ts +++ b/test/libs-messagingApi.spec.ts @@ -1,9 +1,11 @@ -import { messagingApi } from "../lib"; +import { messagingApi } from "../lib/index.js"; import { http, HttpResponse } from "msw"; import { setupServer } from "msw/node"; import { deepEqual, equal } from "node:assert"; -const pkg = require("../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../package.json"); const channelAccessToken = "test_channel_access_token"; diff --git a/test/libs-shop.spec.ts b/test/libs-shop.spec.ts index 2e423005e..1648370fb 100644 --- a/test/libs-shop.spec.ts +++ b/test/libs-shop.spec.ts @@ -1,9 +1,11 @@ -import { shop } from "../lib"; +import { shop } from "../lib/index.js"; import { http, HttpResponse } from "msw"; import { setupServer } from "msw/node"; import { deepEqual, equal } from "node:assert"; -const pkg = require("../package.json"); +import module from "node:module"; +const requireModule = module.createRequire(import.meta.url); +const pkg = requireModule("../package.json"); const channelAccessToken = "test_channel_access_token"; diff --git a/test/libs-webhook.spec.ts b/test/libs-webhook.spec.ts index ff9467a12..ab35722a8 100644 --- a/test/libs-webhook.spec.ts +++ b/test/libs-webhook.spec.ts @@ -1,4 +1,4 @@ -import { webhook } from "../lib"; +import { webhook } from "../lib/index.js"; describe("webhook", () => { it("event", async () => { diff --git a/test/middleware.spec.ts b/test/middleware.spec.ts index 75d1b6368..d2b082218 100644 --- a/test/middleware.spec.ts +++ b/test/middleware.spec.ts @@ -1,11 +1,17 @@ import { deepEqual, equal, ok } from "node:assert"; import { readFileSync } from "node:fs"; import { join } from "node:path"; -import { HTTPError } from "../lib/exceptions"; -import HTTPClient from "../lib/http-axios"; -import middleware from "../lib/middleware"; -import * as Types from "../lib/types"; -import { close, listen } from "./helpers/test-server"; +import { HTTPError } from "../lib/exceptions.js"; +import HTTPClient from "../lib/http-axios.js"; +import middleware from "../lib/middleware.js"; +import * as Types from "../lib/types.js"; +import { close, listen } from "./helpers/test-server.js"; + +import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); const TEST_PORT = parseInt(process.env.TEST_PORT || "1234", 10); diff --git a/test/utils.spec.ts b/test/utils.spec.ts index 0e6c690d2..b5df93fcc 100644 --- a/test/utils.spec.ts +++ b/test/utils.spec.ts @@ -1,5 +1,5 @@ -import { ensureJSON } from "../lib/utils"; -import { JSONParseError } from "../lib/exceptions"; +import { ensureJSON } from "../lib/utils.js"; +import { JSONParseError } from "../lib/exceptions.js"; import { equal, ok } from "node:assert"; describe("utils", () => { diff --git a/test/validate-signature.spec.ts b/test/validate-signature.spec.ts index d830db82a..7c96837f8 100644 --- a/test/validate-signature.spec.ts +++ b/test/validate-signature.spec.ts @@ -1,5 +1,5 @@ import { ok } from "node:assert"; -import validateSignature from "../lib/validate-signature"; +import validateSignature from "../lib/validate-signature.js"; const body = { hello: "world" }; const secret = "test_secret"; diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json new file mode 100644 index 000000000..60dad3f63 --- /dev/null +++ b/tsconfig.cjs.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "CommonJS", + "moduleResolution": "Node", + "outDir": "./dist/", + } +} diff --git a/tsconfig.json b/tsconfig.json index 13fb10b99..05b2cb69f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,31 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es2017", - "noImplicitAny": true, - "outDir": "dist", - "rootDirs": ["lib", "test"], + /* Basic Options */ + "module": "nodenext", + "moduleResolution": "nodenext", + "esModuleInterop": true, + "newLine": "LF", + "outDir": "./module/", + "target": "ES2018", + "sourceMap": true, "declaration": true, + "declarationMap": true, + "jsx": "preserve", + "lib": [ + "esnext", + "dom" + ], + // "strict": true, + // "noUnusedLocals": true, + // "noUnusedParameters": true, + // "noImplicitReturns": true, + // "noFallthroughCasesInSwitch": true }, "include": [ - "lib/**/*.ts", + "lib/**/*" + ], + "exclude": [ + ".git", + "node_modules" ] }