UNPKG

@aws-amplify/appsync-modelgen-plugin

Version:
128 lines 4.18 kB
export declare type ModelIntrospectionSchema = { version: 1; models: SchemaModels; nonModels: SchemaNonModels; enums: SchemaEnums; queries?: SchemaQueries; mutations?: SchemaMutations; subscriptions?: SchemaSubscriptions; inputs?: SchemaInputs; generations?: SchemaGenerations; conversations?: SchemaConversationRoutes; }; export declare type SchemaModels = Record<string, SchemaModel>; export declare type SchemaNonModels = Record<string, SchemaNonModel>; export declare type SchemaEnums = Record<string, SchemaEnum>; export declare type SchemaQueries = Record<string, SchemaQuery>; export declare type SchemaMutations = Record<string, SchemaMutation>; export declare type SchemaSubscriptions = Record<string, SchemaSubscription>; export declare type SchemaInputs = Record<string, Input>; export declare type SchemaGenerations = SchemaQueries; export declare type SchemaConversationRoutes = Record<string, SchemaConversationRoute>; export declare type SchemaConversationRoute = { name: string; models: SchemaModels; nonModels: SchemaNonModels; enums: SchemaEnums; conversation: SchemaConversation; message: SchemaConversationMessage; }; export declare type SchemaConversation = { modelName: string; }; export declare type SchemaConversationMessage = { modelName: string; subscribe: SchemaSubscription; send: SchemaMutation; }; export declare type SchemaModel = { name: string; attributes?: ModelAttribute[]; fields: Fields; pluralName: string; syncable?: boolean; primaryKeyInfo: PrimaryKeyInfo; }; export declare type SchemaNonModel = { name: string; fields: Fields; }; export declare type SchemaEnum = { name: string; values: string[]; }; export declare type SchemaQuery = Pick<Field, 'name' | 'type' | 'isArray' | 'isRequired' | 'isArrayNullable' | 'arguments'>; export declare type SchemaMutation = SchemaQuery; export declare type SchemaSubscription = SchemaQuery; export declare type ModelAttribute = { type: string; properties?: { [key: string]: any; }; }; export declare type Fields = Record<string, Field>; export declare type Field = { name: string; type: FieldType; isArray: boolean; isRequired: boolean; isReadOnly?: boolean; isArrayNullable?: boolean; attributes?: FieldAttribute[]; association?: AssociationType; arguments?: Arguments; }; export declare type ScalarType = 'ID' | 'String' | 'Int' | 'Float' | 'AWSDate' | 'AWSTime' | 'AWSDateTime' | 'AWSTimestamp' | 'AWSEmail' | 'AWSURL' | 'AWSIPAddress' | 'Boolean' | 'AWSJSON' | 'AWSPhone'; export declare type InputFieldType = ScalarType | { enum: string; } | { input: string; }; export declare type FieldType = ScalarType | { enum: string; } | { model: string; } | { nonModel: string; }; export declare type FieldAttribute = ModelAttribute; export declare type Input = { name: string; attributes: Arguments; }; export declare enum CodeGenConnectionType { HAS_ONE = "HAS_ONE", BELONGS_TO = "BELONGS_TO", HAS_MANY = "HAS_MANY" } export declare type AssociationBaseType = { connectionType: CodeGenConnectionType; }; export declare type AssociationHasMany = AssociationBaseType & { connectionType: CodeGenConnectionType.HAS_MANY; associatedWith: string[]; }; export declare type AssociationHasOne = AssociationBaseType & { connectionType: CodeGenConnectionType.HAS_ONE; associatedWith: string[]; targetNames: string[]; }; export declare type AssociationBelongsTo = AssociationBaseType & { connectionType: CodeGenConnectionType.BELONGS_TO; targetNames: string[]; }; export declare type AssociationType = AssociationHasMany | AssociationHasOne | AssociationBelongsTo; export declare type PrimaryKeyInfo = { isCustomPrimaryKey: boolean; primaryKeyFieldName: string; sortKeyFieldNames: string[]; }; export declare type Arguments = Record<string, Argument>; export declare type Argument = { name: string; type: InputFieldType; isArray: boolean; isRequired: boolean; isArrayNullable?: boolean; }; //# sourceMappingURL=model-schema.d.ts.map