@aws-amplify/data-schema 0.17.1 → 0.18.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.
- package/dist/esm/ClientSchema.d.ts +5 -1
- package/dist/esm/MappedTypes/CustomOperations.d.ts +2 -2
- package/dist/esm/runtime/client/index.d.ts +1 -1
- package/dist/meta/cjs.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/ClientSchema.ts +10 -7
- package/src/MappedTypes/CustomOperations.ts +2 -2
- package/src/runtime/client/index.ts +7 -3
package/package.json
CHANGED
package/src/ClientSchema.ts
CHANGED
|
@@ -74,14 +74,17 @@ type InternalClientSchema<
|
|
|
74
74
|
ResolvedFields,
|
|
75
75
|
NonModelTypes
|
|
76
76
|
>['customOperations']
|
|
77
|
-
> &
|
|
78
|
-
ResolvedFields
|
|
79
|
-
[
|
|
80
|
-
SecondaryIndexes &
|
|
81
|
-
RelationalMetadata<ResolvedSchema, ResolvedFields, IdentifierMeta> &
|
|
82
|
-
NonModelTypes &
|
|
83
|
-
ResolveCustomOperations<Schema, ResolvedFields, NonModelTypes>;
|
|
77
|
+
> & {
|
|
78
|
+
[K in keyof ResolvedFields]: {
|
|
79
|
+
type: ResolvedFields[K];
|
|
84
80
|
};
|
|
81
|
+
} & {
|
|
82
|
+
[__modelMeta__]: IdentifierMeta &
|
|
83
|
+
SecondaryIndexes &
|
|
84
|
+
RelationalMetadata<ResolvedSchema, ResolvedFields, IdentifierMeta> &
|
|
85
|
+
NonModelTypes &
|
|
86
|
+
ResolveCustomOperations<Schema, ResolvedFields, NonModelTypes>;
|
|
87
|
+
};
|
|
85
88
|
|
|
86
89
|
type GetInternalClientSchema<Schema> =
|
|
87
90
|
Schema extends GenericModelSchema<any> ? InternalClientSchema<Schema> : never;
|
|
@@ -200,7 +200,7 @@ type IndividualCustomHandlerTypes<Op extends CustomOperationMinimalDef> = {
|
|
|
200
200
|
* }
|
|
201
201
|
* ```
|
|
202
202
|
*/
|
|
203
|
-
|
|
203
|
+
args: Op['arguments'];
|
|
204
204
|
|
|
205
205
|
/**
|
|
206
206
|
* The return type expected by a lambda function handler.
|
|
@@ -217,7 +217,7 @@ type IndividualCustomHandlerTypes<Op extends CustomOperationMinimalDef> = {
|
|
|
217
217
|
* }
|
|
218
218
|
* ```
|
|
219
219
|
*/
|
|
220
|
-
|
|
220
|
+
returnType: LambdaReturnType<Op['returnType']>;
|
|
221
221
|
};
|
|
222
222
|
|
|
223
223
|
/**
|
|
@@ -720,17 +720,21 @@ export type ModelTypes<
|
|
|
720
720
|
>]: ModelName extends string
|
|
721
721
|
? Schema[ModelName] extends Record<string, unknown>
|
|
722
722
|
? Context extends 'CLIENT'
|
|
723
|
-
? ModelTypesClient<
|
|
723
|
+
? ModelTypesClient<
|
|
724
|
+
ModelName,
|
|
725
|
+
Schema[ModelName]['type'],
|
|
726
|
+
ModelMeta[ModelName]
|
|
727
|
+
>
|
|
724
728
|
: Context extends 'COOKIES'
|
|
725
729
|
? ModelTypesSSRCookies<
|
|
726
730
|
ModelName,
|
|
727
|
-
Schema[ModelName],
|
|
731
|
+
Schema[ModelName]['type'],
|
|
728
732
|
ModelMeta[ModelName]
|
|
729
733
|
>
|
|
730
734
|
: Context extends 'REQUEST'
|
|
731
735
|
? ModelTypesSSRRequest<
|
|
732
736
|
ModelName,
|
|
733
|
-
Schema[ModelName],
|
|
737
|
+
Schema[ModelName]['type'],
|
|
734
738
|
ModelMeta[ModelName]
|
|
735
739
|
>
|
|
736
740
|
: never
|