@aws-amplify/data-schema-types
Advanced tools
Comparing version 0.6.7 to 0.6.8
@@ -452,2 +452,13 @@ import { DeepReadOnlyObject, UnwrapArray, UnionToIntersection, Prettify, Equal } from '../util'; | ||
/** | ||
* Request options that are passed to custom header functions. | ||
* `method` and `headers` are not included in custom header functions passed to | ||
* subscriptions. | ||
*/ | ||
export type RequestOptions = { | ||
url: string; | ||
queryString: string; | ||
headers?: Record<string, string>; | ||
method?: string; | ||
}; | ||
/** | ||
* Custom headers that can be passed either to the client or to individual | ||
@@ -457,3 +468,3 @@ * model operations, either as a static object or a function that returns a | ||
*/ | ||
export type CustomHeaders = Record<string, string> | (() => Promise<Record<string, string>>); | ||
export type CustomHeaders = Record<string, string> | ((requestOptions?: RequestOptions) => Promise<Record<string, string>>); | ||
export {}; |
{ | ||
"name": "@aws-amplify/data-schema-types", | ||
"version": "0.6.7", | ||
"version": "0.6.8", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "./lib-esm/index.d.ts", |
@@ -53,4 +53,4 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
: FlatModel[K] extends Record<string, any> | ||
? RestoreArrays<Result[K], FlatModel[K]> | ||
: Result[K] | ||
? RestoreArrays<Result[K], FlatModel[K]> | ||
: Result[K] | ||
: never; | ||
@@ -120,14 +120,14 @@ }; | ||
: FlatModel extends null | ||
? DeepPickFromPath<NonNullable<FlatModel>, Path> | null | ||
: FlatModel extends any[] | ||
? DeepPickFromPath<UnwrapArray<FlatModel>, Path> | ||
: Path extends `${infer Head}.${infer Tail}` | ||
? Head extends keyof FlatModel | ||
? Tail extends '*' | ||
? { [k in Head]: NonRelationalFields<UnwrapArray<FlatModel[Head]>> } | ||
: { [k in Head]: DeepPickFromPath<FlatModel[Head], Tail> } | ||
: never | ||
: Path extends keyof FlatModel | ||
? { [K in Path]: FlatModel[Path] } | ||
: never; | ||
? DeepPickFromPath<NonNullable<FlatModel>, Path> | null | ||
: FlatModel extends any[] | ||
? DeepPickFromPath<UnwrapArray<FlatModel>, Path> | ||
: Path extends `${infer Head}.${infer Tail}` | ||
? Head extends keyof FlatModel | ||
? Tail extends '*' | ||
? { [k in Head]: NonRelationalFields<UnwrapArray<FlatModel[Head]>> } | ||
: { [k in Head]: DeepPickFromPath<FlatModel[Head], Tail> } | ||
: never | ||
: Path extends keyof FlatModel | ||
? { [K in Path]: FlatModel[Path] } | ||
: never; | ||
@@ -245,6 +245,6 @@ /** | ||
: Model[Field] extends (...args: any) => SingularReturnValue<infer M> | ||
? NonNullable<M> extends Record<string, any> | ||
? ResolvedModel<NonNullable<M>, RecursionLoop[Depth]> | ||
: never | ||
: Model[Field]; | ||
? NonNullable<M> extends Record<string, any> | ||
? ResolvedModel<NonNullable<M>, RecursionLoop[Depth]> | ||
: never | ||
: Model[Field]; | ||
}; | ||
@@ -478,4 +478,4 @@ }[Depth extends -1 ? 'done' : 'recur']; | ||
: Model[K] extends number | ||
? NumericFilter | ||
: StringFilter; | ||
? NumericFilter | ||
: StringFilter; | ||
}; | ||
@@ -710,6 +710,6 @@ | ||
: Context extends 'COOKIES' | ||
? ModelTypesSSRCookies<Schema[ModelName], ModelMeta[ModelName]> | ||
: Context extends 'REQUEST' | ||
? ModelTypesSSRRequest<Schema[ModelName], ModelMeta[ModelName]> | ||
: never | ||
? ModelTypesSSRCookies<Schema[ModelName], ModelMeta[ModelName]> | ||
: Context extends 'REQUEST' | ||
? ModelTypesSSRRequest<Schema[ModelName], ModelMeta[ModelName]> | ||
: never | ||
: never | ||
@@ -720,2 +720,14 @@ : never; | ||
/** | ||
* Request options that are passed to custom header functions. | ||
* `method` and `headers` are not included in custom header functions passed to | ||
* subscriptions. | ||
*/ | ||
export type RequestOptions = { | ||
url: string; | ||
queryString: string; | ||
headers?: Record<string, string>; | ||
method?: string; | ||
}; | ||
/** | ||
* Custom headers that can be passed either to the client or to individual | ||
@@ -727,2 +739,2 @@ * model operations, either as a static object or a function that returns a | ||
| Record<string, string> | ||
| (() => Promise<Record<string, string>>); | ||
| ((requestOptions?: RequestOptions) => Promise<Record<string, string>>); |
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
60689
1382