@aws-amplify/data-schema-types
Advanced tools
Comparing version 0.7.4 to 0.7.5
@@ -455,2 +455,23 @@ import { DeepReadOnlyObject, UnwrapArray, UnionToIntersection, Prettify, Equal } from '../util'; | ||
}; | ||
export type CustomQueries<Schema extends Record<any, any>, Context extends ContextType = 'CLIENT', ModelMeta extends Record<any, any> = ExtractModelMeta<Schema>> = CustomOperations<Schema, 'Query', Context, ModelMeta>; | ||
export type CustomMutations<Schema extends Record<any, any>, Context extends ContextType = 'CLIENT', ModelMeta extends Record<any, any> = ExtractModelMeta<Schema>> = CustomOperations<Schema, 'Mutation', Context, ModelMeta>; | ||
export type CustomOperations<Schema extends Record<any, any>, OperationType extends 'Query' | 'Mutation' | 'Subscription', Context extends ContextType = 'CLIENT', ModelMeta extends Record<any, any> = ExtractModelMeta<Schema>> = { | ||
[OpName in keyof ModelMeta['customOperations'] as ModelMeta['customOperations'][OpName]['typeName'] extends OperationType ? OpName : never]: { | ||
CLIENT: (input: ModelMeta['customOperations'][OpName]['arguments'], options?: { | ||
authMode?: AuthMode; | ||
authToken?: string; | ||
headers?: CustomHeaders; | ||
}) => SingularReturnValue<ModelMeta['customOperations'][OpName]['returnType']>; | ||
COOKIES: (input: ModelMeta['customOperations'][OpName]['arguments'], options?: { | ||
authMode?: AuthMode; | ||
authToken?: string; | ||
headers?: CustomHeaders; | ||
}) => SingularReturnValue<ModelMeta['customOperations'][OpName]['returnType']>; | ||
REQUEST: (contextSpec: any, input: ModelMeta['customOperations'][OpName]['arguments'], options?: { | ||
authMode?: AuthMode; | ||
authToken?: string; | ||
headers?: CustomHeaders; | ||
}) => SingularReturnValue<ModelMeta['customOperations'][OpName]['returnType']>; | ||
}[Context]; | ||
}; | ||
/** | ||
@@ -457,0 +478,0 @@ * The utility type that is used to infer the type (interface) of the generated |
@@ -12,1 +12,3 @@ export declare const __modelMeta__: unique symbol; | ||
export type CustomHeaders = Record<string, string> | (() => Promise<Record<string, string>>); | ||
export type CustomQueries<Schema extends Record<any, any>, _Context extends string = 'CLIENT', _ModelMeta extends Record<any, any> = ExtractModelMeta<Schema>> = any; | ||
export type CustomMutations<Schema extends Record<any, any>, _Context extends string = 'CLIENT', _ModelMeta extends Record<any, any> = ExtractModelMeta<Schema>> = any; |
{ | ||
"name": "@aws-amplify/data-schema-types", | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "./lib-esm/index.d.ts", |
@@ -727,2 +727,60 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
export type CustomQueries< | ||
Schema extends Record<any, any>, | ||
Context extends ContextType = 'CLIENT', | ||
ModelMeta extends Record<any, any> = ExtractModelMeta<Schema>, | ||
> = CustomOperations<Schema, 'Query', Context, ModelMeta>; | ||
export type CustomMutations< | ||
Schema extends Record<any, any>, | ||
Context extends ContextType = 'CLIENT', | ||
ModelMeta extends Record<any, any> = ExtractModelMeta<Schema>, | ||
> = CustomOperations<Schema, 'Mutation', Context, ModelMeta>; | ||
export type CustomOperations< | ||
Schema extends Record<any, any>, | ||
OperationType extends 'Query' | 'Mutation' | 'Subscription', | ||
Context extends ContextType = 'CLIENT', | ||
ModelMeta extends Record<any, any> = ExtractModelMeta<Schema>, | ||
> = { | ||
[OpName in keyof ModelMeta['customOperations'] as ModelMeta['customOperations'][OpName]['typeName'] extends OperationType | ||
? OpName | ||
: never]: { | ||
CLIENT: ( | ||
input: ModelMeta['customOperations'][OpName]['arguments'], | ||
options?: { | ||
// selectionSet?: SelectionSet; | ||
authMode?: AuthMode; | ||
authToken?: string; | ||
headers?: CustomHeaders; | ||
}, | ||
) => SingularReturnValue< | ||
ModelMeta['customOperations'][OpName]['returnType'] | ||
>; | ||
COOKIES: ( | ||
input: ModelMeta['customOperations'][OpName]['arguments'], | ||
options?: { | ||
// selectionSet?: SelectionSet; | ||
authMode?: AuthMode; | ||
authToken?: string; | ||
headers?: CustomHeaders; | ||
}, | ||
) => SingularReturnValue< | ||
ModelMeta['customOperations'][OpName]['returnType'] | ||
>; | ||
REQUEST: ( | ||
contextSpec: any, | ||
input: ModelMeta['customOperations'][OpName]['arguments'], | ||
options?: { | ||
// selectionSet?: SelectionSet; | ||
authMode?: AuthMode; | ||
authToken?: string; | ||
headers?: CustomHeaders; | ||
}, | ||
) => SingularReturnValue< | ||
ModelMeta['customOperations'][OpName]['returnType'] | ||
>; | ||
}[Context]; | ||
}; | ||
/** | ||
@@ -729,0 +787,0 @@ * The utility type that is used to infer the type (interface) of the generated |
@@ -29,1 +29,13 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| (() => Promise<Record<string, string>>); | ||
export type CustomQueries< | ||
Schema extends Record<any, any>, | ||
_Context extends string = 'CLIENT', | ||
_ModelMeta extends Record<any, any> = ExtractModelMeta<Schema>, | ||
> = any; | ||
export type CustomMutations< | ||
Schema extends Record<any, any>, | ||
_Context extends string = 'CLIENT', | ||
_ModelMeta extends Record<any, any> = ExtractModelMeta<Schema>, | ||
> = any; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70179
1609