@netlify/config
Version:
Netlify config module
55 lines (54 loc) • 1.92 kB
TypeScript
import { NetlifyAPI } from '@netlify/api';
import { IntegrationResponse } from '../types/api.js';
import { ModeOption, TestOptions } from '../types/options.js';
type GetSiteInfoOpts = {
siteId: string;
accountId?: string;
mode: ModeOption;
offline?: boolean;
api?: NetlifyAPI;
context?: string;
featureFlags?: Record<string, boolean>;
testOpts?: TestOptions;
siteFeatureFlagPrefix: string;
token: string;
extensionApiBaseUrl: string;
};
/**
* Retrieve Netlify Site information, if available.
* Used to retrieve local build environment variables and UI build settings.
* This is not used in production builds since the buildbot passes this
* information instead.
* Requires knowing the `siteId` and having the access `token`.
* Silently ignore API errors. For example the network connection might be down,
* but local builds should still work regardless.
*/
export declare const getSiteInfo: ({ api, siteId, accountId, mode, context, offline, testOpts, siteFeatureFlagPrefix, token, featureFlags, extensionApiBaseUrl, }: GetSiteInfoOpts) => Promise<{
siteInfo: any;
accounts: MinimalAccount[];
integrations: IntegrationResponse[];
}>;
export type MinimalAccount = {
id: string;
name: string;
slug: string;
default: boolean;
team_logo_url: string | null;
on_pro_trial: boolean;
organization_id: string | null;
type_name: string;
type_slug: string;
members_count: number;
};
type GetIntegrationsOpts = {
siteId?: string;
accountId?: string;
testOpts: TestOptions;
offline: boolean;
token?: string;
featureFlags?: Record<string, boolean>;
extensionApiBaseUrl: string;
mode: ModeOption;
};
export declare const getIntegrations: ({ siteId, accountId, testOpts, offline, token, featureFlags, extensionApiBaseUrl, mode, }: GetIntegrationsOpts) => Promise<IntegrationResponse[]>;
export {};