UNPKG

@line/bot-sdk

Version:
256 lines 18.5 kB
/** * Channel Access Token API * This document describes Channel Access Token API. * * The version of the OpenAPI document: 0.0.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { ChannelAccessTokenKeyIdsResponse } from "../model/channelAccessTokenKeyIdsResponse.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.js"; interface httpClientConfig { /** * Base URL for requests. * Defaults to 'https://api.line.me'. * You can override this for testing or to use a mock server. */ baseURL?: string; /** * Extra headers merged into every request. */ defaultHeaders?: Record<string, string>; } export declare class ChannelAccessTokenClient { private httpClient; /** * Initializes a new `ChannelAccessTokenClient`. * * @param config Configuration for this API client. * @param config.baseURL The base URL for requests. Defaults to `https://api.line.me`. * @param config.defaultHeaders Extra headers merged into every request. * * @example * const client = new ChannelAccessTokenClient({ * }); */ constructor(config: httpClientConfig); /** * Gets all valid channel access token key IDs. * Calls `GET https://api.line.me/oauth2/v2.1/tokens/kid`. * To inspect the HTTP status code or response headers, use {@link getsAllValidChannelAccessTokenKeyIdsWithHttpInfo}. * @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. * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-all-valid-channel-access-token-key-ids-v2-1">LINE Developers documentation</a> */ getsAllValidChannelAccessTokenKeyIds(clientAssertionType: string, clientAssertion: string): Promise<ChannelAccessTokenKeyIdsResponse>; /** * Gets all valid channel access token key IDs. * Calls `GET https://api.line.me/oauth2/v2.1/tokens/kid`. * This method returns the response body together with the underlying `httpResponse`. * @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. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-all-valid-channel-access-token-key-ids-v2-1">LINE Developers documentation</a> */ getsAllValidChannelAccessTokenKeyIdsWithHttpInfo(clientAssertionType: string, clientAssertion: string): Promise<Types.ApiResponseType<ChannelAccessTokenKeyIdsResponse>>; /** * Issue short-lived channel access token * Calls `POST https://api.line.me/v2/oauth/accessToken`. * To inspect the HTTP status code or response headers, use {@link issueChannelTokenWithHttpInfo}. * @param grantType `client_credentials` * @param clientId Channel ID. * @param clientSecret Channel secret. * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-shortlived-channel-access-token">LINE Developers documentation</a> */ issueChannelToken(grantType: string, clientId: string, clientSecret: string): Promise<IssueShortLivedChannelAccessTokenResponse>; /** * Issue short-lived channel access token * Calls `POST https://api.line.me/v2/oauth/accessToken`. * This method returns the response body together with the underlying `httpResponse`. * @param grantType `client_credentials` * @param clientId Channel ID. * @param clientSecret Channel secret. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-shortlived-channel-access-token">LINE Developers documentation</a> */ issueChannelTokenWithHttpInfo(grantType: string, clientId: string, clientSecret: string): Promise<Types.ApiResponseType<IssueShortLivedChannelAccessTokenResponse>>; /** * Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication. * Calls `POST https://api.line.me/oauth2/v2.1/token`. * To inspect the HTTP status code or response headers, use {@link issueChannelTokenByJWTWithHttpInfo}. * @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. * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-channel-access-token-v2-1">LINE Developers documentation</a> */ issueChannelTokenByJWT(grantType: string, clientAssertionType: string, clientAssertion: string): Promise<IssueChannelAccessTokenResponse>; /** * Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication. * Calls `POST https://api.line.me/oauth2/v2.1/token`. * This method returns the response body together with the underlying `httpResponse`. * @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. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-channel-access-token-v2-1">LINE Developers documentation</a> */ issueChannelTokenByJWTWithHttpInfo(grantType: string, clientAssertionType: string, clientAssertion: string): Promise<Types.ApiResponseType<IssueChannelAccessTokenResponse>>; /** * 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. * Calls `POST https://api.line.me/oauth2/v3/token`. * To inspect the HTTP status code or response headers, use {@link issueStatelessChannelTokenWithHttpInfo}. * @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. * @returns A promise resolving to the response body. * @deprecated Use {@link issueStatelessChannelTokenByJWTAssertion} or {@link issueStatelessChannelTokenByClientSecret} instead. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token">LINE Developers documentation</a> */ issueStatelessChannelToken(grantType?: string, clientAssertionType?: string, clientAssertion?: string, clientId?: string, clientSecret?: string): Promise<IssueStatelessChannelAccessTokenResponse>; /** * 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. * Calls `POST https://api.line.me/oauth2/v3/token`. * This method returns the response body together with the underlying `httpResponse`. * @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. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @deprecated Use {@link issueStatelessChannelTokenByJWTAssertionWithHttpInfo} or {@link issueStatelessChannelTokenByClientSecretWithHttpInfo} instead. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token">LINE Developers documentation</a> */ issueStatelessChannelTokenWithHttpInfo(grantType?: string, clientAssertionType?: string, clientAssertion?: string, clientId?: string, clientSecret?: string): Promise<Types.ApiResponseType<IssueStatelessChannelAccessTokenResponse>>; /** * Revoke short-lived or long-lived channel access token * Calls `POST https://api.line.me/v2/oauth/revoke`. * To inspect the HTTP status code or response headers, use {@link revokeChannelTokenWithHttpInfo}. * @param accessToken A short-lived or long-lived channel access token. * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#revoke-longlived-or-shortlived-channel-access-token">LINE Developers documentation</a> */ revokeChannelToken(accessToken: string): Promise<Types.MessageAPIResponseBase>; /** * Revoke short-lived or long-lived channel access token * Calls `POST https://api.line.me/v2/oauth/revoke`. * This method returns the response body together with the underlying `httpResponse`. * @param accessToken A short-lived or long-lived channel access token. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#revoke-longlived-or-shortlived-channel-access-token">LINE Developers documentation</a> */ revokeChannelTokenWithHttpInfo(accessToken: string): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>>; /** * Revoke channel access token v2.1 * Calls `POST https://api.line.me/oauth2/v2.1/revoke`. * To inspect the HTTP status code or response headers, use {@link revokeChannelTokenByJWTWithHttpInfo}. * @param clientId Channel ID * @param clientSecret Channel Secret * @param accessToken Channel access token * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#revoke-channel-access-token-v2-1">LINE Developers documentation</a> */ revokeChannelTokenByJWT(clientId: string, clientSecret: string, accessToken: string): Promise<Types.MessageAPIResponseBase>; /** * Revoke channel access token v2.1 * Calls `POST https://api.line.me/oauth2/v2.1/revoke`. * This method returns the response body together with the underlying `httpResponse`. * @param clientId Channel ID * @param clientSecret Channel Secret * @param accessToken Channel access token * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#revoke-channel-access-token-v2-1">LINE Developers documentation</a> */ revokeChannelTokenByJWTWithHttpInfo(clientId: string, clientSecret: string, accessToken: string): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>>; /** * Verify the validity of short-lived and long-lived channel access tokens * Calls `POST https://api.line.me/v2/oauth/verify`. * To inspect the HTTP status code or response headers, use {@link verifyChannelTokenWithHttpInfo}. * @param accessToken A short-lived or long-lived channel access token. * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#verify-channel-access-token">LINE Developers documentation</a> */ verifyChannelToken(accessToken: string): Promise<VerifyChannelAccessTokenResponse>; /** * Verify the validity of short-lived and long-lived channel access tokens * Calls `POST https://api.line.me/v2/oauth/verify`. * This method returns the response body together with the underlying `httpResponse`. * @param accessToken A short-lived or long-lived channel access token. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#verify-channel-access-token">LINE Developers documentation</a> */ verifyChannelTokenWithHttpInfo(accessToken: string): Promise<Types.ApiResponseType<VerifyChannelAccessTokenResponse>>; /** * You can verify whether a Channel access token with a user-specified expiration (Channel Access Token v2.1) is valid. * Calls `GET https://api.line.me/oauth2/v2.1/verify`. * To inspect the HTTP status code or response headers, use {@link verifyChannelTokenByJWTWithHttpInfo}. * @param accessToken Channel access token with a user-specified expiration (Channel Access Token v2.1). * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#verify-channel-access-token-v2-1">LINE Developers documentation</a> */ verifyChannelTokenByJWT(accessToken: string): Promise<VerifyChannelAccessTokenResponse>; /** * You can verify whether a Channel access token with a user-specified expiration (Channel Access Token v2.1) is valid. * Calls `GET https://api.line.me/oauth2/v2.1/verify`. * This method returns the response body together with the underlying `httpResponse`. * @param accessToken Channel access token with a user-specified expiration (Channel Access Token v2.1). * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#verify-channel-access-token-v2-1">LINE Developers documentation</a> */ verifyChannelTokenByJWTWithHttpInfo(accessToken: string): Promise<Types.ApiResponseType<VerifyChannelAccessTokenResponse>>; /** * Issues a new stateless channel access token by JWT assertion. * The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires. * Calls `POST https://api.line.me/oauth2/v3/token`. * To inspect the HTTP status code or response headers, use {@link issueStatelessChannelTokenByJWTAssertionWithHttpInfo}. * @param clientAssertion A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token">LINE Developers documentation</a> */ issueStatelessChannelTokenByJWTAssertion(clientAssertion: string): Promise<IssueStatelessChannelAccessTokenResponse>; /** * Issues a new stateless channel access token by client secret. * The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires. * Calls `POST https://api.line.me/oauth2/v3/token`. * To inspect the HTTP status code or response headers, use {@link issueStatelessChannelTokenByClientSecretWithHttpInfo}. * @param clientId Channel ID. * @param clientSecret Channel secret. * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token">LINE Developers documentation</a> */ issueStatelessChannelTokenByClientSecret(clientId: string, clientSecret: string): Promise<IssueStatelessChannelAccessTokenResponse>; /** * Issues a new stateless channel access token by JWT assertion. * The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires. * Calls `POST https://api.line.me/oauth2/v3/token`. * This method returns the response body together with the underlying `httpResponse`. * @param clientAssertion A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token">LINE Developers documentation</a> */ issueStatelessChannelTokenByJWTAssertionWithHttpInfo(clientAssertion: string): Promise<Types.ApiResponseType<IssueStatelessChannelAccessTokenResponse>>; /** * Issues a new stateless channel access token by client secret. * The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires. * Calls `POST https://api.line.me/oauth2/v3/token`. * This method returns the response body together with the underlying `httpResponse`. * @param clientId Channel ID. * @param clientSecret Channel secret. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token">LINE Developers documentation</a> */ issueStatelessChannelTokenByClientSecretWithHttpInfo(clientId: string, clientSecret: string): Promise<Types.ApiResponseType<IssueStatelessChannelAccessTokenResponse>>; } export {}; //# sourceMappingURL=channelAccessTokenClient.d.ts.map