UNPKG

atlas-app-services-admin-api

Version:
202 lines (201 loc) 7.11 kB
import * as API from '.'; /** * Logger interface for custom logging. */ export interface Logger { log: (message: string, ...optionalParams: any[]) => void; error: (message: string, ...optionalParams: any[]) => void; debug: (message: string, ...optionalParams: any[]) => void; } /** * AtlasAppServicesClient class for interacting with Atlas App Services. */ export declare class AtlasAppServicesClient { private adminApi; private appsApi; groupId: string; appId: string; clientAppId: string; private userId; private configParams; private accessToken; private refreshToken; private tokenExpiration; private logger; private apis; /** * Constructor for AtlasAppServicesClient. * @param config - Configuration object containing publicKey, privateKey, baseUrl, and groupId. * @param logger - Optional logger for custom logging. */ constructor(config: { publicKey: string; privateKey: string; baseUrl: string; groupId: string; }, logger?: Logger); /** * Initialize the client by logging in and setting up the app. */ initialize(): Promise<void>; private loginAndAppSetup; private doAdminLogin; private setAccessToken; private isAccessTokenValid; private ensureValidAccessToken; private instantiateApi; private createApiProxyHandler; private stringifyArgs; /*** Getters for the APIs */ /*** Getters for the APIs */ /** * Get an instance of the Admin API. * @returns {Promise<API.AdminApi>} An instance of the Admin API. */ atlasAdminApi(): Promise<API.AdminApi>; /** * Get an instance of the API Keys API. * @returns {Promise<API.ApikeysApi>} An instance of the API Keys API. */ atlasApikeysApi(): Promise<API.ApikeysApi>; /** * Get an instance of the Apps API. * @returns {Promise<API.AppsApi>} An instance of the Apps API. */ atlasAppsApi(): Promise<API.AppsApi>; /** * Get an instance of the Auth Providers API. * @returns {Promise<API.AuthprovidersApi>} An instance of the Auth Providers API. */ atlasAuthprovidersApi(): Promise<API.AuthprovidersApi>; /** * Get an instance of the Billing API. * @returns {Promise<API.BillingApi>} An instance of the Billing API. */ atlasBillingApi(): Promise<API.BillingApi>; /** * Get an instance of the Custom User Data API. * @returns {Promise<API.CustomUserDataApi>} An instance of the Custom User Data API. */ atlasCustomUserDataApi(): Promise<API.CustomUserDataApi>; /** * Get an instance of the Data API. * @returns {Promise<API.DataApiApi>} An instance of the Data API. */ atlasDataApiApi(): Promise<API.DataApiApi>; /** * Get an instance of the Dependencies API. * @returns {Promise<API.DependenciesApi>} An instance of the Dependencies API. */ atlasDependenciesApi(): Promise<API.DependenciesApi>; /** * Get an instance of the Deploy API. * @returns {Promise<API.DeployApi>} An instance of the Deploy API. */ atlasDeployApi(): Promise<API.DeployApi>; /** * Get an instance of the Email API. * @returns {Promise<API.EmailApi>} An instance of the Email API. */ atlasEmailApi(): Promise<API.EmailApi>; /** * Get an instance of the Endpoints API. * @returns {Promise<API.EndpointsApi>} An instance of the Endpoints API. */ atlasEndpointsApi(): Promise<API.EndpointsApi>; /** * Get an instance of the Environments API. * @returns {Promise<API.EnvironmentsApi>} An instance of the Environments API. */ atlasEnvironmentsApi(): Promise<API.EnvironmentsApi>; /** * Get an instance of the Event Subscriptions API. * @returns {Promise<API.EventSubscriptionsApi>} An instance of the Event Subscriptions API. */ atlasEventSubscriptionsApi(): Promise<API.EventSubscriptionsApi>; /** * Get an instance of the Functions API. * @returns {Promise<API.FunctionsApi>} An instance of the Functions API. */ atlasFunctionsApi(): Promise<API.FunctionsApi>; /** * Get an instance of the GraphQL API. * @returns {Promise<API.GraphqlApi>} An instance of the GraphQL API. */ atlasGraphqlApi(): Promise<API.GraphqlApi>; /** * Get an instance of the Hosting API. * @returns {Promise<API.HostingApi>} An instance of the Hosting API. */ atlasHostingApi(): Promise<API.HostingApi>; /** * Get an instance of the Log Forwarders API. * @returns {Promise<API.LogForwardersApi>} An instance of the Log Forwarders API. */ atlasLogForwardersApi(): Promise<API.LogForwardersApi>; /** * Get an instance of the Logs API. * @returns {Promise<API.LogsApi>} An instance of the Logs API. */ atlasLogsApi(): Promise<API.LogsApi>; /** * Get an instance of the Metrics API. * @returns {Promise<API.MetricsApi>} An instance of the Metrics API. */ atlasMetricsApi(): Promise<API.MetricsApi>; /** * Get an instance of the Notifications API. * @returns {Promise<API.NotificationsApi>} An instance of the Notifications API. */ atlasNotificationsApi(): Promise<API.NotificationsApi>; /** * Get an instance of the Rules API. * @returns {Promise<API.RulesApi>} An instance of the Rules API. */ atlasRulesApi(): Promise<API.RulesApi>; /** * Get an instance of the Schemas API. * @returns {Promise<API.SchemasApi>} An instance of the Schemas API. */ atlasSchemasApi(): Promise<API.SchemasApi>; /** * Get an instance of the Secrets API. * @returns {Promise<API.SecretsApi>} An instance of the Secrets API. */ atlasSecretsApi(): Promise<API.SecretsApi>; /** * Get an instance of the Security API. * @returns {Promise<API.SecurityApi>} An instance of the Security API. */ atlasSecurityApi(): Promise<API.SecurityApi>; /** * Get an instance of the Services API. * @returns {Promise<API.ServicesApi>} An instance of the Services API. */ atlasServicesApi(): Promise<API.ServicesApi>; /** * Get an instance of the Sync API. * @returns {Promise<API.SyncApi>} An instance of the Sync API. */ atlasSyncApi(): Promise<API.SyncApi>; /** * Get an instance of the Triggers API. * @returns {Promise<API.TriggersApi>} An instance of the Triggers API. */ atlasTriggersApi(): Promise<API.TriggersApi>; /** * Get an instance of the Users API. * @returns {Promise<API.UsersApi>} An instance of the Users API. */ atlasUsersApi(): Promise<API.UsersApi>; /** * Get an instance of the Values API. * @returns {Promise<API.ValuesApi>} An instance of the Values API. */ atlasValuesApi(): Promise<API.ValuesApi>; /** * Get an instance of the Webhooks API. * @returns {Promise<API.WebhooksApi>} An instance of the Webhooks API. */ atlasWebhooksApi(): Promise<API.WebhooksApi>; }