UNPKG

@zeplin/sdk

Version:
195 lines (194 loc) 7.54 kB
/** * Zeplin API * Access your resources in Zeplin * * Contact: support@zeplin.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { AxiosPromise, AxiosInstance, AxiosResponse } from 'axios'; import { Configuration } from '../configuration'; import { RequestArgs, BaseAPI } from '../base'; import { TokenCreateBody } from '../models'; import { TokenResponse } from '../models'; /** * AuthorizationApi - axios parameter creator * @export */ export declare const AuthorizationApiAxiosParamCreator: (configuration?: Configuration | undefined) => { /** * Users are redirected to web app to authenticate themselves and authorize the app with `client_id` to act on behalf of themselves. * @summary Authorization endpoint * @param {string} responseType Only &#x60;code&#x60; flow is supported * @param {string} clientId Identifier of the Zeplin app requesting user authentication * @param {string} redirectUri User is redirected to this endpoint after authorization * @param {string} [state] RECOMMENDED. An opaque value used by the client to maintain state between the request and callback. * @param {*} [options] Override http request option. * @throws {RequiredError} */ oAuthAuthorize: (responseType: string, clientId: string, redirectUri: string, state?: string | undefined, codeChallenge?: string | undefined, codeChallengeMethod?: "plain" | "S256" | undefined, options?: any) => RequestArgs; /** * If `grant_type` is given as `authorization_code`; handles code flow. If `grant_type` is given as `refresh_token` handles refresh token flow. * @summary Access token endpoint * @param {TokenCreateBody} tokenCreateBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ oAuthPostToken: (tokenCreateBody: TokenCreateBody, options?: any) => RequestArgs; }; /** * AuthorizationApi - functional programming interface * @export */ export declare const AuthorizationApiFp: (configuration?: Configuration | undefined) => { /** * If `grant_type` is given as `authorization_code`; handles code flow. If `grant_type` is given as `refresh_token` handles refresh token flow. * @summary Access token endpoint * @param {TokenCreateBody} tokenCreateBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ oAuthPostToken(tokenCreateBody: TokenCreateBody, options?: any): Promise<(axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<any>>; }; /** * Search parameters for getAuthorizeUrl operation in AuthorizationApi. * @export * @interface AuthorizationApiGetAuthorizationUrlSearchParams */ export interface AuthorizationApiGetAuthorizationUrlSearchParams { /** * Identifier of the Zeplin app requesting user authentication * @type {string} * @memberof AuthorizationApiGetAuthorizationUrlSearchParams */ readonly clientId: string; /** * User is redirected to this endpoint after authorization * @type {string} * @memberof AuthorizationApiGetAuthorizationUrlSearchParams */ readonly redirectUri: string; /** * RECOMMENDED. An opaque value used by the client to maintain state between the request and callback. * @type {string} * @memberof AuthorizationApiGetAuthorizationUrlSearchParams */ readonly state?: string; /** * RECOMMENDED. A PKCE code challenge derived from the code verifier, to be verified against later. * @type {string} * @memberof AuthorizationApiGetAuthorizationUrlSearchParams */ readonly codeChallenge?: string; /** * RECOMMENDED. PKCE code verifier transformation method. * @type {string} * @memberof AuthorizationApiGetAuthorizationUrlSearchParams */ readonly codeChallengeMethod?: "plain" | "S256"; } /** * Search parameters for createToken operation in AuthorizationApi. * @export * @interface AuthorizationApiCreateTokenParams */ export interface AuthorizationApiCreateTokenParams { /** * Applies when `grant_type` is `authorization_code`. The `code` obtained after `authorization` request * @type {string} * @memberof AuthorizationApiCreateTokenParams */ code: string; /** * The URL where users will be redirected after authorization * @type {string} * @memberof AuthorizationApiCreateTokenParams */ redirectUri: string; /** * The `client_id` of your Zeplin app * @type {string} * @memberof AuthorizationApiCreateTokenParams */ clientId: string; /** * The `client_secret` of your Zeplin app * @type {string} * @memberof AuthorizationApiCreateTokenParams */ clientSecret?: string; /** * A cryptographically random string that is used to correlate the authorization request to the token request * @type {string} * @memberof AuthorizationApiCreateTokenParams */ codeVerifier?: string; } /** * Search parameters for refreshToken operation in AuthorizationApi. * @export * @interface AuthorizationApiRefreshTokenParams */ export interface AuthorizationApiRefreshTokenParams { /** * The `refresh_token` you obtained while generating the access token in the first place * @type {string} * @memberof AuthorizationApiRefreshTokenParams */ refreshToken: string; /** * The `client_id` of your Zeplin app * @type {string} * @memberof AuthorizationApiRefreshTokenParams */ clientId: string; /** * The `client_secret` of your Zeplin app * @type {string} * @memberof AuthorizationApiRefreshTokenParams */ clientSecret?: string; /** * A cryptographically random string that is used to correlate the authorization request to the token request * @type {string} * @memberof AuthorizationApiRefreshTokenParams */ codeVerifier?: string; } /** * AuthorizationApi - object-oriented interface * @export * @class AuthorizationApi * @extends {BaseAPI} */ export declare class AuthorizationApi extends BaseAPI { /** * Users are redirected to web app to authenticate themselves and authorize the app with `client_id` to act on behalf of themselves. * @summary Authorization endpoint * @param {AuthorizationApiGetAuthorizationUrlSearchParams} searchParams Search parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthorizationApi */ getAuthorizationUrl(searchParams: AuthorizationApiGetAuthorizationUrlSearchParams, options?: any): string; /** * Handles code flow * @summary Access token endpoint * @param {AuthorizationApiCreateTokenParams} params * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthorizationApi */ createToken(params: AuthorizationApiCreateTokenParams, options?: any): Promise<AxiosResponse<TokenResponse>>; /** * Handles refresh token flow * @summary Access token endpoint * @param {AuthorizationApiCreateTokenParams} params * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthorizationApi */ refreshToken(params: AuthorizationApiRefreshTokenParams, options?: any): Promise<AxiosResponse<TokenResponse>>; }