@aws-amplify/data-schema 1.25.5 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ import type { EnumType } from '../../EnumType';
9
9
  import type { CustomType, CustomTypeParamShape } from '../../CustomType';
10
10
  import type { RefType } from '../../RefType';
11
11
  import type { StringFilter, NumericFilter, ModelPrimaryCompositeKeyInput, PrimaryIndexIrShape, SecondaryIndexIrShape, KindaPretty } from '../../util';
12
- export interface ClientModel<Bag extends Record<string, unknown>, Metadata extends SchemaMetadata<any>, IsRDS extends boolean, T extends ModelTypeParamShape, K extends keyof Bag & string> extends ClientSchemaProperty {
12
+ export interface ClientModel<Bag extends Record<string, unknown>, Metadata extends SchemaMetadata<any, any>, IsRDS extends boolean, T extends ModelTypeParamShape, K extends keyof Bag & string> extends ClientSchemaProperty {
13
13
  __entityType: 'model';
14
14
  type: KindaPretty<ClientFields<Bag, Metadata, IsRDS, T>>;
15
15
  createType: Prettify<CreateModelInput<ClientModel<Bag, Metadata, IsRDS, T, K>>>;
@@ -43,8 +43,8 @@ export interface ClientModel<Bag extends Record<string, unknown>, Metadata exten
43
43
  type DisabledOpsToMap<Ops extends ReadonlyArray<DisableOperationsOptions>> = {
44
44
  [Op in Ops[number] as Op extends 'queries' ? 'list' | 'get' | 'observeQuery' : Op extends 'mutations' ? 'create' | 'update' | 'delete' : Op extends 'subscriptions' ? 'onCreate' | 'onUpdate' | 'onDelete' | 'observeQuery' : Op extends 'list' ? 'list' | 'observeQuery' : Op]: true;
45
45
  };
46
- type ClientFields<Bag extends Record<string, unknown>, Metadata extends SchemaMetadata<any>, IsRDS extends boolean, T extends ModelTypeParamShape> = ResolveFields<Bag, T['fields']> & If<Not<IsRDS>, ImplicitIdentifier<T>> & AuthFields<Metadata, T> & Omit<SystemFields<IsRDS>, keyof ResolveFields<Bag, T['fields']>>;
47
- type FlatClientFields<Bag extends Record<string, unknown>, Metadata extends SchemaMetadata<any>, IsRDS extends boolean, T extends ModelTypeParamShape, ModelName extends keyof Bag & string> = FlatResolveFields<Bag, T['fields'], ModelName> & If<Not<IsRDS>, ImplicitIdentifier<T>> & AuthFields<Metadata, T> & Omit<SystemFields<IsRDS>, keyof ResolveFields<Bag, T['fields']>>;
46
+ type ClientFields<Bag extends Record<string, unknown>, Metadata extends SchemaMetadata<any, any>, IsRDS extends boolean, T extends ModelTypeParamShape> = ResolveFields<Bag, T['fields']> & If<Not<IsRDS>, ImplicitIdentifier<T>> & AuthFields<Metadata, T> & Omit<SystemFields<IsRDS>, keyof ResolveFields<Bag, T['fields']>>;
47
+ type FlatClientFields<Bag extends Record<string, unknown>, Metadata extends SchemaMetadata<any, any>, IsRDS extends boolean, T extends ModelTypeParamShape, ModelName extends keyof Bag & string> = FlatResolveFields<Bag, T['fields'], ModelName, Metadata['selectionSetDepth']> & If<Not<IsRDS>, ImplicitIdentifier<T>> & AuthFields<Metadata, T> & Omit<SystemFields<IsRDS>, keyof ResolveFields<Bag, T['fields']>>;
48
48
  type SystemFields<IsRDS extends boolean> = IsRDS extends false ? {
49
49
  readonly createdAt: string;
50
50
  readonly updatedAt: string;
@@ -71,7 +71,7 @@ type Not<T extends boolean> = T extends true ? false : true;
71
71
  *
72
72
  */
73
73
  export type ListOptionsPkParams<Bag extends Record<string, unknown>, T extends ModelTypeParamShape> = T['identifier']['sk'] extends never ? unknown : Prettify<Partial<IndexQueryInput<Bag, T['identifier']>>>;
74
- type AuthFields<SchemaMeta extends SchemaMetadata<any>, Model extends ModelTypeParamShape> = (Model['authorization'][number] extends never ? SchemaMeta['authFields'] extends never ? object : SchemaMeta['authFields'] : ImpliedAuthFields<Model['authorization'][number]> extends never ? object : ImpliedAuthFields<Model['authorization'][number]>) & ImpliedAuthFieldsFromFields<Model>;
74
+ type AuthFields<SchemaMeta extends SchemaMetadata<any, any>, Model extends ModelTypeParamShape> = (Model['authorization'][number] extends never ? SchemaMeta['authFields'] extends never ? object : SchemaMeta['authFields'] : ImpliedAuthFields<Model['authorization'][number]> extends never ? object : ImpliedAuthFields<Model['authorization'][number]>) & ImpliedAuthFieldsFromFields<Model>;
75
75
  type ImpliedAuthFieldsFromFields<T> = UnionToIntersection<T extends ModelTypeParamShape ? T['fields'][keyof T['fields']] extends ModelField<any, any, infer Auth> | ModelRelationshipField<any, any, any, infer Auth> | RefType<any, any, infer Auth> ? Auth extends Authorization<any, any, any> ? ImpliedAuthFields<Auth> : object : object : object>;
76
76
  type NestedTypes<Bag extends Record<string, unknown>, T extends ModelTypeParamShape> = {
77
77
  [K in keyof T['fields'] as T['fields'][K] extends EnumType | CustomType<CustomTypeParamShape> ? K : never]: K extends keyof Bag ? {
@@ -1,23 +1,24 @@
1
1
  import type { __modelMeta__ } from '../runtime/client';
2
- import type { BaseSchema, ConversationType, CustomOperation, CustomType, EnumType, GenericModelSchema, ModelSchemaContents, ModelType } from '../ModelSchema';
2
+ import type { BaseSchema, ClientSchemaOptions, ConversationType, CustomOperation, CustomType, EnumType, GenericModelSchema, ModelSchemaContents, ModelType } from '../ModelSchema';
3
3
  import type { ClientCustomOperation, ClientCustomType, ClientEnum, ClientModel } from './Core';
4
4
  import type { CombinedModelSchema, CombinedSchemaIndexesUnion } from '../CombineSchema';
5
5
  import type { SchemaMetadata } from './utilities/SchemaMetadata';
6
6
  import type { Brand, Select, SpreadTuple } from '../util';
7
7
  import { ClientConversation } from './ai/ClientConversation';
8
- export type ClientSchema<Schema extends GenericModelSchema<any> | CombinedModelSchema<any>> = Schema extends GenericModelSchema<any> ? InternalClientSchema<Schema> : Schema extends CombinedModelSchema<any> ? InternalCombinedSchema<Schema> : never;
9
- type InternalClientSchema<CustomerSchema extends ModelSchemaContents | BaseSchema<any, any>, Metadata extends SchemaMetadata<any> = never, IsRDS extends boolean = never> = CustomerSchema extends ModelSchemaContents ? {
8
+ export type { ClientSchemaOptions } from '../ModelSchema';
9
+ export type ClientSchema<Schema extends GenericModelSchema<any> | CombinedModelSchema<any>, Options extends ClientSchemaOptions = ClientSchemaOptions> = Schema extends GenericModelSchema<any> ? InternalClientSchema<Schema, Options> : Schema extends CombinedModelSchema<any> ? InternalCombinedSchema<Schema, Options> : never;
10
+ type InternalClientSchema<CustomerSchema extends ModelSchemaContents | BaseSchema<any, any>, Options extends ClientSchemaOptions = ClientSchemaOptions, Metadata extends SchemaMetadata<any, any> = never, IsRDS extends boolean = never> = CustomerSchema extends ModelSchemaContents ? {
10
11
  [K in keyof CustomerSchema as K extends string ? K : never]: K extends string ? ClientSchemaProperty<CustomerSchema, Metadata, IsRDS, K> : never;
11
- } : CustomerSchema extends BaseSchema<any, any> ? InternalClientSchema<CustomerSchema['data']['types'], SchemaMetadata<CustomerSchema>, CustomerSchema extends Brand<'RDSSchema'> ? true : false> : never;
12
- type ClientSchemaProperty<T extends ModelSchemaContents, Metadata extends SchemaMetadata<any>, IsRDS extends boolean, K extends keyof T & string> = T[K] extends Brand<'enum'> ? RemapEnum<T, T[K]> : T[K] extends Brand<'customType'> ? RemapCustomType<T, Metadata, IsRDS, T[K]> : T[K] extends Brand<'queryCustomOperation' | 'mutationCustomOperation' | 'subscriptionCustomOperation' | 'generationCustomOperation'> ? RemapCustomOperation<T, Metadata, IsRDS, T[K]> : T[K] extends Brand<'modelType'> ? RemapModel<T, Metadata, IsRDS, T[K], K> : T[K] extends Brand<'conversationCustomOperation'> ? RemapAIRoute<T, T[K]> : never;
12
+ } : CustomerSchema extends BaseSchema<any, any> ? InternalClientSchema<CustomerSchema['data']['types'], Options, SchemaMetadata<CustomerSchema, Options>, CustomerSchema extends Brand<'RDSSchema'> ? true : false> : never;
13
+ type ClientSchemaProperty<T extends ModelSchemaContents, Metadata extends SchemaMetadata<any, any>, IsRDS extends boolean, K extends keyof T & string> = T[K] extends Brand<'enum'> ? RemapEnum<T, T[K]> : T[K] extends Brand<'customType'> ? RemapCustomType<T, Metadata, IsRDS, T[K]> : T[K] extends Brand<'queryCustomOperation' | 'mutationCustomOperation' | 'subscriptionCustomOperation' | 'generationCustomOperation'> ? RemapCustomOperation<T, Metadata, IsRDS, T[K]> : T[K] extends Brand<'modelType'> ? RemapModel<T, Metadata, IsRDS, T[K], K> : T[K] extends Brand<'conversationCustomOperation'> ? RemapAIRoute<T, T[K]> : never;
13
14
  type RemapEnum<_T extends ModelSchemaContents, E> = E extends EnumType<infer values> ? ClientEnum<values> : never;
14
- type RemapCustomType<T extends ModelSchemaContents, Metadata extends SchemaMetadata<any>, IsRDS extends boolean, E> = E extends CustomType<infer CT> ? ClientCustomType<InternalClientSchema<T, Metadata, IsRDS>, CT> : never;
15
- type RemapCustomOperation<T extends ModelSchemaContents, Metadata extends SchemaMetadata<any>, IsRDS extends boolean, E> = E extends CustomOperation<infer CO, any> ? ClientCustomOperation<InternalClientSchema<T, Metadata, IsRDS>, CO> : never;
16
- type RemapModel<T extends ModelSchemaContents, Metadata extends SchemaMetadata<any>, IsRDS extends boolean, E, K extends keyof T & string> = E extends ModelType<infer MT, any> ? ClientModel<InternalClientSchema<T, Metadata, IsRDS>, Metadata, IsRDS, MT, K> : never;
15
+ type RemapCustomType<T extends ModelSchemaContents, Metadata extends SchemaMetadata<any, any>, IsRDS extends boolean, E> = E extends CustomType<infer CT> ? ClientCustomType<InternalClientSchema<T, ClientSchemaOptions, Metadata, IsRDS>, CT> : never;
16
+ type RemapCustomOperation<T extends ModelSchemaContents, Metadata extends SchemaMetadata<any, any>, IsRDS extends boolean, E> = E extends CustomOperation<infer CO, any> ? ClientCustomOperation<InternalClientSchema<T, ClientSchemaOptions, Metadata, IsRDS>, CO> : never;
17
+ type RemapModel<T extends ModelSchemaContents, Metadata extends SchemaMetadata<any, any>, IsRDS extends boolean, E, K extends keyof T & string> = E extends ModelType<infer MT, any> ? ClientModel<InternalClientSchema<T, ClientSchemaOptions, Metadata, IsRDS>, Metadata, IsRDS, MT, K> : never;
17
18
  type RemapAIRoute<_T extends ModelSchemaContents, E> = E extends ConversationType ? ClientConversation : never;
18
- type GetInternalClientSchema<Schema> = Schema extends GenericModelSchema<any> ? InternalClientSchema<Schema> : never;
19
- type CombinedClientSchemas<Schemas extends CombinedModelSchema<any>['schemas']> = {
20
- [Index in keyof Schemas]: Index extends CombinedSchemaIndexesUnion ? GetInternalClientSchema<Schemas[Index]> : never;
19
+ type GetInternalClientSchema<Schema, Options extends ClientSchemaOptions = ClientSchemaOptions> = Schema extends GenericModelSchema<any> ? InternalClientSchema<Schema, Options> : never;
20
+ type CombinedClientSchemas<Schemas extends CombinedModelSchema<any>['schemas'], Options extends ClientSchemaOptions = ClientSchemaOptions> = {
21
+ [Index in keyof Schemas]: Index extends CombinedSchemaIndexesUnion ? GetInternalClientSchema<Schemas[Index], Options> : never;
21
22
  };
22
23
  /**
23
24
  * Types for unwrapping and combining generic type args into client-consumable types
@@ -27,7 +28,7 @@ type CombinedClientSchemas<Schemas extends CombinedModelSchema<any>['schemas']>
27
28
  *
28
29
  * @internal @typeParam ClientSchemas - The tuple of client schemas to combine
29
30
  */
30
- type InternalCombinedSchema<Combined extends CombinedModelSchema<any>, ClientSchemas extends [...any] = CombinedClientSchemas<Combined['schemas']>> = SpreadTuple<{
31
+ type InternalCombinedSchema<Combined extends CombinedModelSchema<any>, Options extends ClientSchemaOptions = ClientSchemaOptions, ClientSchemas extends [...any] = CombinedClientSchemas<Combined['schemas'], Options>> = SpreadTuple<{
31
32
  [I in keyof ClientSchemas]: I extends CombinedSchemaIndexesUnion ? Omit<ClientSchemas[I], typeof __modelMeta__> : never;
32
33
  }>;
33
34
  export type ClientSchemaByEntityTypeBaseShape = {
@@ -66,4 +67,3 @@ export type ClientSchemaByEntityType<T> = {
66
67
  __entityType: 'customGeneration';
67
68
  }>;
68
69
  };
69
- export {};
@@ -5,6 +5,7 @@ import { CustomType } from '../../CustomType';
5
5
  import { RefType, RefTypeParamShape } from '../../RefType';
6
6
  import { ResolveRef } from './ResolveRef';
7
7
  import { LazyLoader } from '../../runtime';
8
+ import type { DefaultSelectionSetDepth } from '../../ModelSchema';
8
9
  import type { ModelTypeParamShape } from '../../ModelType';
9
10
  type ExtendsNever<T> = [T] extends [never] ? true : false;
10
11
  /**
@@ -21,13 +22,13 @@ export type ResolveFields<Bag extends Record<string, any>, T> = ShallowPretty<{
21
22
  } & {
22
23
  [K in keyof T as IsRequired<T[K]> extends true ? never : K]+?: ResolveIndividualField<Bag, T[K]>;
23
24
  }>;
24
- export type FlatResolveFields<Bag extends Record<string, any>, T, FlatModelName extends keyof Bag & string = never> = ShallowPretty<{
25
- [K in keyof T]: ResolveIndividualField<Bag, T[K], FlatModelName>;
25
+ export type FlatResolveFields<Bag extends Record<string, any>, T, FlatModelName extends keyof Bag & string = never, Depth extends number = DefaultSelectionSetDepth> = ShallowPretty<{
26
+ [K in keyof T]: ResolveIndividualField<Bag, T[K], FlatModelName, Depth>;
26
27
  }>;
27
28
  type ShallowPretty<T> = {
28
29
  [K in keyof T]: T[K];
29
30
  };
30
- export type ResolveIndividualField<Bag extends Record<string, any>, T, FlatModelName extends keyof Bag & string = never> = T extends BaseModelField<infer FieldShape> ? FieldShape : T extends RefType<infer RefShape, any, any> ? ResolveRef<RefShape, Bag> : T extends ModelRelationshipField<infer RelationshipShape, any, any, any> ? ResolveRelationship<Bag, RelationshipShape, FlatModelName> : T extends CustomType<infer CT> ? ResolveFields<Bag, CT['fields']> | null : T extends EnumType<infer values> ? values[number] | null : never;
31
+ export type ResolveIndividualField<Bag extends Record<string, any>, T, FlatModelName extends keyof Bag & string = never, Depth extends number = DefaultSelectionSetDepth> = T extends BaseModelField<infer FieldShape> ? FieldShape : T extends RefType<infer RefShape, any, any> ? ResolveRef<RefShape, Bag> : T extends ModelRelationshipField<infer RelationshipShape, any, any, any> ? ResolveRelationship<Bag, RelationshipShape, FlatModelName, Depth> : T extends CustomType<infer CT> ? ResolveFields<Bag, CT['fields']> | null : T extends EnumType<infer values> ? values[number] | null : never;
31
32
  /**
32
33
  * This mapped type eliminates redundant recursive types when
33
34
  * generating the ['__meta']['flatModel'] type that serves as the
@@ -56,7 +57,24 @@ export type ResolveIndividualField<Bag extends Record<string, any>, T, FlatModel
56
57
  type ShortCircuitBiDirectionalRelationship<Model extends Record<string, any>, ParentModelName extends string, Raw extends ModelTypeParamShape['fields']> = {
57
58
  [Field in keyof Model as Field extends keyof Raw ? Raw[Field] extends ModelRelationshipField<infer RelationshipShape, any, any, any> ? RelationshipShape['relationshipType'] extends 'belongsTo' ? RelationshipShape['relatedModel'] extends ParentModelName ? never : Field : Field : Field : Field]: Model[Field];
58
59
  };
59
- type ResolveRelationship<Bag extends Record<string, any>, RelationshipShape extends ModelRelationshipFieldParamShape, ParentModelName extends keyof Bag & string = never> = ExtendsNever<ParentModelName> extends true ? DependentLazyLoaderOpIsAvailable<Bag, RelationshipShape> extends true ? LazyLoader<RelationshipShape['valueRequired'] extends true ? Bag[RelationshipShape['relatedModel']]['type'] : Bag[RelationshipShape['relatedModel']]['type'] | null, RelationshipShape['array']> : never : RelationshipShape['array'] extends true ? Array<ShortCircuitBiDirectionalRelationship<Bag[RelationshipShape['relatedModel']]['__meta']['flatModel'], ParentModelName, Bag[RelationshipShape['relatedModel']]['__meta']['rawType']['fields']>> : ShortCircuitBiDirectionalRelationship<Bag[RelationshipShape['relatedModel']]['__meta']['flatModel'], ParentModelName, Bag[RelationshipShape['relatedModel']]['__meta']['rawType']['fields']>;
60
+ /** Subtract 1 from a depth counter, bounded at 0. Outside 0–5 falls through to 0. */
61
+ type Decrement<N extends number> = N extends 5 ? 4 : N extends 4 ? 3 : N extends 3 ? 2 : N extends 2 ? 1 : N extends 1 ? 0 : 0;
62
+ /**
63
+ * Replaces each relationship field on the inlined related-model `type` with the
64
+ * related model's `type` recursively flattened, decrementing `Depth` per hop.
65
+ * At `Depth=0`, strips relationships entirely so ModelPathInner can't recurse
66
+ * into a LazyLoader leaf and the cascade terminates.
67
+ */
68
+ type FlattenRelationships<Bag extends Record<string, any>, Model extends Record<string, any>, RawFields extends Record<string, any>, Depth extends number = DefaultSelectionSetDepth> = Depth extends 0 ? OmitRelationships<Model, RawFields> : {
69
+ [K in keyof Model]: K extends keyof RawFields ? RawFields[K] extends ModelRelationshipField<infer RS, any, any, any> ? RS['array'] extends true ? Array<FlattenRelationships<Bag, Bag[RS['relatedModel']]['type'], Bag[RS['relatedModel']]['__meta']['rawType']['fields'], Decrement<Depth>>> : FlattenRelationships<Bag, Bag[RS['relatedModel']]['type'], Bag[RS['relatedModel']]['__meta']['rawType']['fields'], Decrement<Depth>> : Model[K] : Model[K];
70
+ };
71
+ /** Terminal case at the depth boundary: drop relationships entirely. */
72
+ type OmitRelationships<Model extends Record<string, any>, RawFields extends Record<string, any>> = {
73
+ [K in keyof Model as K extends keyof RawFields ? RawFields[K] extends ModelRelationshipField<any, any, any, any> ? never : K : K]: Model[K];
74
+ };
75
+ /** Shared `LazyLoader` shape used by the non-flat branch and the depth=0 short-circuit. */
76
+ type LazyLoaderForRelationship<Bag extends Record<string, any>, RelationshipShape extends ModelRelationshipFieldParamShape> = DependentLazyLoaderOpIsAvailable<Bag, RelationshipShape> extends true ? LazyLoader<RelationshipShape['valueRequired'] extends true ? Bag[RelationshipShape['relatedModel']]['type'] : Bag[RelationshipShape['relatedModel']]['type'] | null, RelationshipShape['array']> : never;
77
+ type ResolveRelationship<Bag extends Record<string, any>, RelationshipShape extends ModelRelationshipFieldParamShape, ParentModelName extends keyof Bag & string = never, Depth extends number = DefaultSelectionSetDepth> = ExtendsNever<ParentModelName> extends true ? LazyLoaderForRelationship<Bag, RelationshipShape> : Depth extends 0 ? LazyLoaderForRelationship<Bag, RelationshipShape> : RelationshipShape['array'] extends true ? Array<ShortCircuitBiDirectionalRelationship<FlattenRelationships<Bag, Bag[RelationshipShape['relatedModel']]['type'], Bag[RelationshipShape['relatedModel']]['__meta']['rawType']['fields'], Decrement<Depth>>, ParentModelName, Bag[RelationshipShape['relatedModel']]['__meta']['rawType']['fields']>> : ShortCircuitBiDirectionalRelationship<FlattenRelationships<Bag, Bag[RelationshipShape['relatedModel']]['type'], Bag[RelationshipShape['relatedModel']]['__meta']['rawType']['fields'], Decrement<Depth>>, ParentModelName, Bag[RelationshipShape['relatedModel']]['__meta']['rawType']['fields']>;
60
78
  type DependentLazyLoaderOpIsAvailable<Bag extends Record<string, any>, RelationshipShape extends ModelRelationshipFieldParamShape> = RelationshipShape['relationshipType'] extends 'hasOne' | 'hasMany' ? 'list' extends keyof Bag[RelationshipShape['relatedModel']]['__meta']['disabledOperations'] ? false : true : 'get' extends keyof Bag[RelationshipShape['relatedModel']]['__meta']['disabledOperations'] ? false : true;
61
79
  type IsRequired<T> = T extends BaseModelField<infer FieldShape> ? null extends FieldShape ? false : true : T extends RefType<infer RefShape, any, any> ? IsRefRequired<RefShape> : T extends ModelRelationshipField<any, any, any, any> ? true : T extends CustomType<any> | EnumType<any> ? false : never;
62
80
  type IsRefRequired<T extends RefTypeParamShape> = T['array'] extends true ? T['arrayRequired'] : T['valueRequired'];
@@ -1,7 +1,8 @@
1
- import { ImpliedAuthFields } from '../../Authorization';
2
- import { BaseSchema } from '../../ModelSchema';
3
- export interface SchemaMetadata<Schema extends BaseSchema<any, any>> {
1
+ import type { ImpliedAuthFields } from '../../Authorization';
2
+ import type { BaseSchema, ClientSchemaOptions, DefaultSelectionSetDepth, SelectionSetDepthValue } from '../../ModelSchema';
3
+ export interface SchemaMetadata<Schema extends BaseSchema<any, any>, Options extends ClientSchemaOptions = ClientSchemaOptions> {
4
4
  authFields: AuthFields<Schema>;
5
+ selectionSetDepth: [Options['selectionSetDepth']] extends [SelectionSetDepthValue] ? Options['selectionSetDepth'] : DefaultSelectionSetDepth;
5
6
  }
6
7
  type AuthFields<Schema extends Record<string, any>> = Schema['data']['authorization'][number] extends never ? object : ImpliedAuthFields<Schema['data']['authorization'][number]>;
7
8
  export {};
@@ -21,6 +21,12 @@ type SchemaContent = BaseModelType | CustomType<CustomTypeParamShape> | EnumType
21
21
  type AddToSchemaContent = Exclude<SchemaContent, BaseModelType>;
22
22
  type AddToSchemaContents = Record<string, AddToSchemaContent>;
23
23
  type NonEmpty<T> = keyof T extends never ? never : T;
24
+ export type SelectionSetDepthValue = 0 | 1 | 2 | 3 | 4 | 5;
25
+ /** Default depth applied when ClientSchema is used without an explicit Options arg. */
26
+ export type DefaultSelectionSetDepth = 5;
27
+ export type ClientSchemaOptions = {
28
+ selectionSetDepth?: SelectionSetDepthValue;
29
+ };
24
30
  export type ModelSchemaContents = Record<string, SchemaContent>;
25
31
  type InternalSchemaModels = Record<string, InternalModel | EnumType | CustomType<any> | InternalCustom>;
26
32
  export type ModelSchemaParamShape = {
@@ -129,5 +129,5 @@ export type ModelPrimaryCompositeKeyInput<SkIr extends Record<string, string | n
129
129
  ge?: SkIr;
130
130
  gt?: SkIr;
131
131
  between?: [SkIr, SkIr];
132
- beginsWith?: SkIr;
132
+ beginsWith?: Partial<SkIr>;
133
133
  };