UNPKG

@unito/integration-cli

Version:

Integration CLI

226 lines (225 loc) 6.32 kB
/** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. */ /** * The configuration of an integration */ export interface Configuration { /** * The name of the integration */ name: string; /** * The base URL where the integration is located */ baseUrl?: string; /** * The relative URL (to the baseUrl) where the graph of items of the integration is located */ graphRelativeUrl?: string; /** * The relative URL (to the baseUrl) to fetch the current integration's authenticated user */ credentialAccountRelativeUrl?: string; /** * The relative URL (to the baseUrl) to parse a webhook payload */ webhookParsingRelativeUrl?: string | null; /** * The relative URL (to the baseUrl) to operate on webhook subscriptions */ webhookSubscriptionsRelativeUrl?: string | null; /** * The relative URL (to the baseUrl) to acknowledge webhook sender */ webhookAcknowledgeRelativeUrl?: string | null; /** * The UI-related information of the integration */ ui?: { /** * The name of the integration, as it should be displayed in a UI */ displayName?: string; /** * Base64-encoded SVG of the logo of the integration */ logo?: string; }; /** * The authorizations of the integration */ authorizations?: Authorization[]; /** * The test accounts of the integration */ testAccounts?: { /** * Test account for local development */ development?: { [k: string]: unknown; }; /** * Test account for compliance tests */ compliance?: { [k: string]: unknown; }; }; /** * The secrets of the integration */ secrets?: { [k: string]: string; }; /** * The environment variables of the integration */ environmentVariables?: { /** * This interface was referenced by `undefined`'s JSON-Schema definition * via the `patternProperty` "^[A-Z0-9_]+$". */ [k: string]: string; }; } /** * An authorization is a way to obtain and generate credentials for an integration */ export interface Authorization { name: string; /** * Whether the authorization is used locally for development purposes only */ development?: boolean; /** * The Base64-encoded data URL of an <img> src content or null. For example: 'data:image/png;base64,<base64>' */ instructionsImage?: null | string; /** * A string representing a markdown document or null */ instructionsMarkdown?: null | string; method: Method; oauth2?: Oauth2; /** * Variables to obtain credentials from an end-user */ variables?: { /** * This interface was referenced by `undefined`'s JSON-Schema definition * via the `patternProperty` "^(?!refreshToken$)(?!accessToken$)(?!scope$)(?!expiresIn$)(?!tokenType$)(?!oauth2ExtraParameters$).*$". */ [k: string]: { type: Type; format?: Format; /** * The JSON Schema regular expression template for the string value. Only the values that match this template will be accepted. The regular expression syntax used is from JavaScript (more specifically, ECMA 262) */ pattern?: string; label?: string; required?: boolean; defaultValue?: string | number | boolean; placeholder?: string; help?: string; documentationUrl?: string; }; }; } /** * Parameters to obtain OAuth 2 credentials from an end-user */ export interface Oauth2 { /** * The Client Secret obtained from the provider. */ clientSecret?: string; /** * The Client Id obtained from the provider. */ clientId?: string; /** * The URL to grant or deny access to the user account. */ authorizationUrl?: string; /** * The URL to obtain or refresh an access token. */ tokenUrl: string; /** * The legacy redirect callback URL used for specific connectors where an existing app definition with a predefined redirect URL must be reused. */ legacyRedirectUrl?: string; grantType?: GrantType; scopes: { /** * The name of the scope */ name: string; /** * Message to the end-user to explain the usage of the scope by Unito */ help?: string; }[]; tokenRequestParameters?: AuthorizationRequestParameters; refreshRequestParameters?: AuthorizationRequestParameters; requestContentType?: RequestContentType; responseContentType?: RequestContentType; } /** * The extra information used to communicate with the provider */ export interface AuthorizationRequestParameters { /** * Extra information to include in the HTTP request headers */ header?: { [k: string]: string | number | boolean; }; /** * Extra information to include in the HTTP request body */ body?: { [k: string]: string | number | boolean; }; } /** * The method of authorization */ export declare enum Method { CUSTOM = "custom", OAUTH2 = "oauth2" } /** * The type of grant of the OAuth 2 authorization. */ export declare enum GrantType { AUTHORIZATION_CODE = "authorization_code", PASSWORD = "password", CLIENT_CREDENTIALS = "client_credentials", JWT_BEARER = "urn:ietf:params:oauth:grant-type:jwt-bearer" } /** * The content type of exchanged information with the provider */ export declare enum RequestContentType { URL_ENCODED = "application/x-www-form-urlencoded", JSON = "application/json" } export declare enum Type { BOOLEAN = "boolean", NUMBER = "number", PASSWORD = "password", STRING = "string", TEXT = "text" } /** * The JSON Schema format that the value of the variable must comply to */ export declare enum Format { EMAIL = "email", URI = "uri" }