import { type OperationTypeNode } from 'graphql'; import { type ArgumentName, type DirectiveArgumentCoords, type FieldCoords, type FieldName, type TypeName } from '../types/types'; export type NatsEventType = 'subscribe' | 'publish' | 'request'; export type KafkaEventType = 'subscribe' | 'publish'; export type RedisEventType = 'subscribe' | 'publish'; export type StreamConfiguration = { consumerInactiveThreshold: number; consumerName: string; streamName: string; }; export type KafkaEventConfiguration = { fieldName: string; providerId: string; providerType: 'kafka'; topics: string[]; type: KafkaEventType; }; export type NatsEventConfiguration = { fieldName: string; providerId: string; providerType: 'nats'; subjects: string[]; type: NatsEventType; streamConfiguration?: StreamConfiguration; }; export type RedisEventConfiguration = { fieldName: string; providerId: string; providerType: 'redis'; channels: string[]; type: RedisEventType; }; export type EventConfiguration = KafkaEventConfiguration | NatsEventConfiguration | RedisEventConfiguration; export type SubscriptionFilterValue = boolean | null | number | string; export type SubscriptionFieldCondition = { fieldPath: string[]; values: SubscriptionFilterValue[]; }; export type SubscriptionCondition = { and?: SubscriptionCondition[]; in?: SubscriptionFieldCondition; not?: SubscriptionCondition; or?: SubscriptionCondition[]; }; export type FieldConfiguration = { argumentNames: string[]; fieldName: string; typeName: string; subscriptionFilterCondition?: SubscriptionCondition; requiresAuthentication?: boolean; requiredScopes?: Array>; requiredScopesByOR?: Array>; }; export type FieldSetConditionData = { fieldCoordinatesPath: Array; fieldPath: Array; }; export type FieldSetConditionDataParams = { fieldCoordinatesPath: Array; fieldPath: Array; }; export type RequiredFieldConfiguration = { fieldName: FieldName; selectionSet: string; conditions?: Array; disableEntityResolver?: boolean; }; export type ConfigurationData = { fieldNames: Set; isRootNode: boolean; typeName: TypeName; entityInterfaceConcreteTypeNames?: Set; events?: EventConfiguration[]; externalFieldNames?: Set; isInterfaceObject?: boolean; provides?: RequiredFieldConfiguration[]; keys?: RequiredFieldConfiguration[]; requireFetchReasonsFieldNames?: Array; requires?: RequiredFieldConfiguration[]; entityCaching?: EntityCachingConfiguration; }; export type EntityCacheConfiguration = { typeName: TypeName; maxAgeSeconds: number; notFoundCacheTtlSeconds: number; includeHeaders: boolean; partialCacheLoad: boolean; shadowMode: boolean; }; export type CacheInvalidateConfiguration = { entityTypeName: TypeName; fieldName: FieldName; operationType: OperationTypeNode; }; export type CachePopulateConfiguration = { entityTypeName: TypeName; fieldName: FieldName; maxAgeSeconds: number; operationType: OperationTypeNode; }; export type EntityCachingConfiguration = { cacheInvalidateConfigurations: Array; cachePopulateConfigurations: Array; entityCacheConfigurations: Array; }; export type Costs = { directiveArgumentWeights: Map; fieldWeights: Map; listSizes: Map; typeWeights: Map; }; export type FieldWeightConfiguration = { argumentWeights: Map; directiveArgumentWeights: Map; fieldName: FieldName; typeName: TypeName; weight?: number; }; export type FieldListSizeConfiguration = { fieldName: FieldName; requireOneSlicingArgument: boolean; sizedFields: Array; slicingArguments: Array; typeName: TypeName; assumedSize?: number; };