43 lines
2.8 KiB
TypeScript
43 lines
2.8 KiB
TypeScript
import type { DerivedCombinedSchema, DerivedModelSchema as DerivedDataSchema, DerivedModelSchema } from '@aws-amplify/data-schema-types';
|
|
import { type IAmplifyDataDefinition } from '@aws-amplify/data-construct';
|
|
import type { AmplifyGen1DynamoDbTableMapping, DataSchema, DataSchemaInput } from './types.js';
|
|
import type { BackendSecretResolver, StableBackendIdentifiers } from '@aws-amplify/plugin-types';
|
|
/**
|
|
* Determine if the input schema is a derived typed schema object (data-schema), and perform type narrowing.
|
|
* @param schema the schema that might be a derived model schema
|
|
* @returns a boolean indicating whether the schema is a derived model schema, with type narrowing
|
|
*/
|
|
export declare const isDataSchema: (schema: DataSchema) => schema is DerivedDataSchema;
|
|
/**
|
|
* Determine if the input schema is a collection of typed schemas, and perform type narrowing.
|
|
* @param schema the schema that might be a collection of model schemas
|
|
* @returns a boolean indicating whether the schema is a collection of derived model schema, with type narrowing
|
|
*/
|
|
export declare const isCombinedSchema: (schema: DataSchemaInput) => schema is DerivedCombinedSchema;
|
|
/**
|
|
* Given an input schema type, produce the relevant CDK Graphql Def interface
|
|
* @param schema TS schema builder definition or string GraphQL schema
|
|
* @param backendSecretResolver secret resolver
|
|
* @param stableBackendIdentifiers backend identifiers
|
|
* @param importedTableName table name to use for imported models. If not defined the model is not imported.
|
|
* @returns the cdk graphql definition interface
|
|
*/
|
|
export declare const convertSchemaToCDK: (schema: DataSchema, backendSecretResolver: BackendSecretResolver, stableBackendIdentifiers: StableBackendIdentifiers, importedTableName?: string) => IAmplifyDataDefinition;
|
|
/**
|
|
* Given an input list of CDK Graphql Def interface schemas, produce the relevant CDK Graphql Def interface
|
|
* @param schemas the cdk graphql definition interfaces to combine
|
|
* @returns the cdk graphql definition interface
|
|
*/
|
|
export declare const combineCDKSchemas: (schemas: IAmplifyDataDefinition[]) => IAmplifyDataDefinition;
|
|
/**
|
|
* Split the schema into multiple schemas based on the table map.
|
|
* If the model corresponds to an imported table then move that model to a separate schema and include the table name
|
|
* @param schemas GraphQL schemas
|
|
* @param amplifyGen1DynamoDbTableMapping Table names for the models that should be imported.
|
|
* @returns an array of split schemas with the imported table name if applicable
|
|
*/
|
|
export declare const splitSchemasByTableMap: (schemas: (string | DerivedModelSchema)[], amplifyGen1DynamoDbTableMapping: AmplifyGen1DynamoDbTableMapping | undefined) => {
|
|
schema: string | DerivedModelSchema;
|
|
importedTableName?: string;
|
|
}[];
|
|
//# sourceMappingURL=convert_schema.d.ts.map
|