import * as cdk from "@aws-cdk/core"; import * as rds from "@aws-cdk/aws-rds"; import * as appsync from "@aws-cdk/aws-appsync"; import * as dynamodb from "@aws-cdk/aws-dynamodb"; import * as secretsmanager from "@aws-cdk/aws-secretsmanager"; import { Table } from "./Table"; import { Function as Fn, FunctionProps, FunctionDefinition } from "./Function"; import { Permissions } from "./util/permission"; export interface AppSyncApiProps { readonly graphqlApi?: appsync.IGraphqlApi | AppSyncApiCdkGraphqlProps; readonly dataSources?: { [key: string]: FunctionDefinition | AppSyncApiLambdaDataSourceProps | AppSyncApiDynamoDbDataSourceProps | AppSyncApiRdsDataSourceProps | AppSyncApiHttpDataSourceProps; }; readonly resolvers?: { [key: string]: string | FunctionDefinition | AppSyncApiResolverProps; }; readonly defaultFunctionProps?: FunctionProps; } export interface AppSyncApiLambdaDataSourceProps { readonly function: FunctionDefinition; readonly options?: appsync.DataSourceOptions; } export interface AppSyncApiDynamoDbDataSourceProps { readonly table: Table | dynamodb.Table; readonly options?: appsync.DataSourceOptions; } export interface AppSyncApiRdsDataSourceProps { readonly serverlessCluster: rds.IServerlessCluster; readonly secretStore: secretsmanager.ISecret; readonly databaseName?: string; readonly options?: appsync.DataSourceOptions; } export interface AppSyncApiHttpDataSourceProps { readonly endpoint: string; readonly options?: appsync.HttpDataSourceOptions; } export interface AppSyncApiResolverProps { readonly dataSource?: string; readonly function?: FunctionDefinition; readonly resolverProps?: AppSyncApiCdkResolverProps; } export interface AppSyncApiCdkGraphqlProps extends Omit { readonly name?: string; readonly schema?: string | appsync.Schema; } export declare type AppSyncApiCdkResolverProps = Omit; export declare class AppSyncApi extends cdk.Construct { readonly graphqlApi: appsync.GraphqlApi; private readonly functionsByDsKey; private readonly dataSourcesByDsKey; private readonly dsKeysByResKey; private readonly resolversByResKey; private readonly permissionsAttachedForAllFunctions; private readonly defaultFunctionProps?; constructor(scope: cdk.Construct, id: string, props?: AppSyncApiProps); get url(): string; addDataSources(scope: cdk.Construct, dataSources: { [key: string]: FunctionDefinition | AppSyncApiLambdaDataSourceProps | AppSyncApiDynamoDbDataSourceProps | AppSyncApiRdsDataSourceProps | AppSyncApiHttpDataSourceProps; }): void; addResolvers(scope: cdk.Construct, resolvers: { [key: string]: FunctionDefinition | AppSyncApiResolverProps; }): void; private addDataSource; private addResolver; private isLambdaResolverProps; private isDataSourceResolverProps; private normalizeResolverKey; private buildDataSourceKey; getFunction(key: string): Fn | undefined; getDataSource(key: string): appsync.BaseDataSource | undefined; getResolver(key: string): appsync.Resolver | undefined; attachPermissions(permissions: Permissions): void; attachPermissionsToDataSource(key: string, permissions: Permissions): void; }