@aws-amplify/data-schema 1.2.9 → 1.3.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/cjs/ClientSchema/Core/ClientCustomOperations.js +4 -0
- package/dist/cjs/ClientSchema/Core/ClientCustomOperations.js.map +1 -0
- package/dist/cjs/{MappedTypes/CustomOperations.js → ClientSchema/Core/ClientCustomType.js} +1 -1
- package/dist/cjs/ClientSchema/Core/ClientCustomType.js.map +1 -0
- package/dist/cjs/{ClientSchema.js → ClientSchema/Core/ClientEnum.js} +1 -1
- package/dist/cjs/ClientSchema/Core/ClientEnum.js.map +1 -0
- package/dist/cjs/ClientSchema/Core/ClientModel.js +4 -0
- package/dist/cjs/ClientSchema/Core/ClientModel.js.map +1 -0
- package/dist/cjs/ClientSchema/Core/ClientSchemaProperty.js +4 -0
- package/dist/cjs/ClientSchema/Core/ClientSchemaProperty.js.map +1 -0
- package/dist/cjs/ClientSchema/Core/index.js +4 -0
- package/dist/cjs/ClientSchema/Core/index.js.map +1 -0
- package/dist/cjs/ClientSchema/index.js +4 -0
- package/dist/cjs/ClientSchema/index.js.map +1 -0
- package/dist/cjs/ClientSchema/utilities/ExtractNestedTypes.js +4 -0
- package/dist/cjs/ClientSchema/utilities/ExtractNestedTypes.js.map +1 -0
- package/dist/cjs/ClientSchema/utilities/ResolveField.js +4 -0
- package/dist/cjs/ClientSchema/utilities/ResolveField.js.map +1 -0
- package/dist/cjs/ClientSchema/utilities/ResolveRef.js +4 -0
- package/dist/cjs/ClientSchema/utilities/ResolveRef.js.map +1 -0
- package/dist/cjs/ClientSchema/utilities/SchemaMetadata.js +4 -0
- package/dist/cjs/ClientSchema/utilities/SchemaMetadata.js.map +1 -0
- package/dist/cjs/ClientSchema/utilities/index.js +9 -0
- package/dist/cjs/ClientSchema/utilities/index.js.map +1 -0
- package/dist/cjs/util/Filters.js +10 -0
- package/dist/cjs/util/Filters.js.map +1 -0
- package/dist/cjs/util/IndexShapes.js +4 -0
- package/dist/cjs/util/IndexShapes.js.map +1 -0
- package/dist/cjs/util/Select.js +4 -0
- package/dist/cjs/util/Select.js.map +1 -0
- package/dist/esm/Authorization.d.ts +3 -3
- package/dist/esm/ClientSchema/Core/ClientCustomOperations.d.ts +88 -0
- package/dist/esm/ClientSchema/Core/ClientCustomOperations.mjs +2 -0
- package/dist/esm/ClientSchema/Core/ClientCustomOperations.mjs.map +1 -0
- package/dist/esm/ClientSchema/Core/ClientCustomType.d.ts +7 -0
- package/dist/esm/ClientSchema/Core/ClientCustomType.mjs +2 -0
- package/dist/esm/ClientSchema/Core/ClientCustomType.mjs.map +1 -0
- package/dist/esm/ClientSchema/Core/ClientEnum.d.ts +5 -0
- package/dist/esm/ClientSchema/Core/ClientEnum.mjs +2 -0
- package/dist/esm/ClientSchema/Core/ClientEnum.mjs.map +1 -0
- package/dist/esm/ClientSchema/Core/ClientModel.d.ts +123 -0
- package/dist/esm/ClientSchema/Core/ClientModel.mjs +2 -0
- package/dist/esm/ClientSchema/Core/ClientModel.mjs.map +1 -0
- package/dist/esm/ClientSchema/Core/ClientSchemaProperty.d.ts +4 -0
- package/dist/esm/ClientSchema/Core/ClientSchemaProperty.mjs +2 -0
- package/dist/esm/ClientSchema/Core/ClientSchemaProperty.mjs.map +1 -0
- package/dist/esm/ClientSchema/Core/index.d.ts +5 -0
- package/dist/esm/ClientSchema/Core/index.mjs +2 -0
- package/dist/esm/ClientSchema/Core/index.mjs.map +1 -0
- package/dist/esm/ClientSchema/index.d.ts +59 -0
- package/dist/esm/ClientSchema/index.mjs +2 -0
- package/dist/esm/ClientSchema/index.mjs.map +1 -0
- package/dist/esm/ClientSchema/utilities/ExtractNestedTypes.d.ts +7 -0
- package/dist/esm/ClientSchema/utilities/ExtractNestedTypes.mjs +2 -0
- package/dist/esm/ClientSchema/utilities/ExtractNestedTypes.mjs.map +1 -0
- package/dist/esm/ClientSchema/utilities/ResolveField.d.ts +29 -0
- package/dist/esm/ClientSchema/utilities/ResolveField.mjs +2 -0
- package/dist/esm/ClientSchema/utilities/ResolveField.mjs.map +1 -0
- package/dist/esm/ClientSchema/utilities/ResolveRef.d.ts +18 -0
- package/dist/esm/ClientSchema/utilities/ResolveRef.mjs +2 -0
- package/dist/esm/ClientSchema/utilities/ResolveRef.mjs.map +1 -0
- package/dist/esm/ClientSchema/utilities/SchemaMetadata.d.ts +7 -0
- package/dist/esm/ClientSchema/utilities/SchemaMetadata.mjs +2 -0
- package/dist/esm/ClientSchema/utilities/SchemaMetadata.mjs.map +1 -0
- package/dist/esm/ClientSchema/utilities/index.d.ts +4 -0
- package/dist/esm/ClientSchema/utilities/index.mjs +2 -0
- package/dist/esm/ClientSchema/utilities/index.mjs.map +1 -0
- package/dist/esm/MappedTypes/ImplicitFieldInjector.d.ts +1 -1
- package/dist/esm/MappedTypes/ModelMetadata.d.ts +1 -1
- package/dist/esm/MappedTypes/ResolveFieldProperties.d.ts +1 -1
- package/dist/esm/ModelSchema.d.ts +6 -3
- package/dist/esm/ModelType.d.ts +9 -8
- package/dist/esm/ModelType.mjs.map +1 -1
- package/dist/esm/runtime/client/index.d.ts +77 -223
- package/dist/esm/runtime/internals/generateCustomOperationsProperty.d.ts +12 -5
- package/dist/esm/util/Filters.d.ts +94 -0
- package/dist/esm/util/Filters.mjs +2 -0
- package/dist/esm/util/Filters.mjs.map +1 -0
- package/dist/esm/util/IndexShapes.d.ts +13 -0
- package/dist/esm/util/IndexShapes.mjs +2 -0
- package/dist/esm/util/IndexShapes.mjs.map +1 -0
- package/dist/esm/util/Select.d.ts +3 -0
- package/dist/esm/util/Select.mjs +2 -0
- package/dist/esm/util/Select.mjs.map +1 -0
- package/dist/esm/util/index.d.ts +3 -0
- package/dist/meta/cjs.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/Authorization.ts +2 -2
- package/src/ClientSchema/Core/ClientCustomOperations.ts +152 -0
- package/src/ClientSchema/Core/ClientCustomType.ts +11 -0
- package/src/ClientSchema/Core/ClientEnum.ts +7 -0
- package/src/ClientSchema/Core/ClientModel.ts +299 -0
- package/src/ClientSchema/Core/ClientSchemaProperty.ts +10 -0
- package/src/ClientSchema/Core/index.ts +5 -0
- package/src/ClientSchema/index.ts +158 -0
- package/src/ClientSchema/utilities/ExtractNestedTypes.ts +15 -0
- package/src/ClientSchema/utilities/ResolveField.ts +79 -0
- package/src/ClientSchema/utilities/ResolveRef.ts +38 -0
- package/src/ClientSchema/utilities/SchemaMetadata.ts +11 -0
- package/src/ClientSchema/utilities/index.ts +4 -0
- package/src/MappedTypes/ImplicitFieldInjector.ts +1 -1
- package/src/MappedTypes/ModelMetadata.ts +2 -1
- package/src/MappedTypes/ResolveFieldProperties.ts +1 -1
- package/src/ModelSchema.ts +8 -2
- package/src/ModelType.ts +12 -3
- package/src/runtime/client/index.ts +175 -433
- package/src/runtime/internals/generateCustomOperationsProperty.ts +2 -2
- package/src/runtime/internals/utils/clientProperties/generateEnumsProperty.ts +1 -1
- package/src/util/Filters.ts +102 -0
- package/src/util/IndexShapes.ts +10 -0
- package/src/util/Select.ts +3 -0
- package/src/util/index.ts +3 -0
- package/dist/cjs/ClientSchema.js.map +0 -1
- package/dist/cjs/MappedTypes/CustomOperations.js.map +0 -1
- package/dist/esm/ClientSchema.d.ts +0 -51
- package/dist/esm/ClientSchema.mjs +0 -2
- package/dist/esm/ClientSchema.mjs.map +0 -1
- package/dist/esm/MappedTypes/CustomOperations.d.ts +0 -125
- package/dist/esm/MappedTypes/CustomOperations.mjs +0 -2
- package/dist/esm/MappedTypes/CustomOperations.mjs.map +0 -1
- package/src/ClientSchema.ts +0 -121
- package/src/MappedTypes/CustomOperations.ts +0 -254
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import { CustomMutations, CustomQueries } from '../client';
|
|
1
|
+
import { CustomMutations, CustomQueries, CustomSubscriptions } from '../client';
|
|
2
2
|
import { BaseClient, ClientInternalsGetter, GraphQLProviderConfig } from '../bridge-types';
|
|
3
3
|
type OpTypes = 'queries' | 'mutations' | 'subscriptions';
|
|
4
|
-
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
|
|
4
|
+
type CustomOpsProperty<T extends Record<any, any>, OpType extends OpTypes> = OpType extends 'queries' ? CustomQueries<T> : OpType extends 'mutations' ? CustomMutations<T> : OpType extends 'subscriptions' ? CustomSubscriptions<T> : never;
|
|
5
|
+
export declare function generateCustomOperationsProperty<T extends Record<any, any>, OpType extends OpTypes>(client: BaseClient, config: GraphQLProviderConfig['GraphQL'], operationsType: OpType, getInternals: ClientInternalsGetter): CustomOpsProperty<T, OpType>;
|
|
6
|
+
export declare function generateCustomMutationsProperty<T extends Record<any, any>>(client: BaseClient, config: GraphQLProviderConfig['GraphQL'], getInternals: ClientInternalsGetter): import("../client").CustomOperations<import("../../util").Select<T, {
|
|
7
|
+
__entityType: "customMutation";
|
|
8
|
+
}>, "CLIENT">;
|
|
9
|
+
export declare function generateCustomQueriesProperty<T extends Record<any, any>>(client: BaseClient, config: GraphQLProviderConfig['GraphQL'], getInternals: ClientInternalsGetter): import("../client").CustomOperations<import("../../util").Select<T, {
|
|
10
|
+
__entityType: "customQuery";
|
|
11
|
+
}>, "CLIENT">;
|
|
12
|
+
export declare function generateCustomSubscriptionsProperty<T extends Record<any, any>>(client: BaseClient, config: GraphQLProviderConfig['GraphQL'], getInternals: ClientInternalsGetter): import("../client").CustomOperations<import("../../util").Select<T, {
|
|
13
|
+
__entityType: "customSubscription";
|
|
14
|
+
}>, "CLIENT">;
|
|
8
15
|
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Not actually sure if/how customer can pass this through as variables yet.
|
|
3
|
+
* Leaving it out for now:
|
|
4
|
+
*
|
|
5
|
+
* attributeType: "binary" | "binarySet" | "bool" | "list" | "map" | "number" | "numberSet" | "string" | "stringSet" | "_null"
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Filters options that can be used on string-like fields.
|
|
9
|
+
*/
|
|
10
|
+
export type StringFilter<T extends string = string> = {
|
|
11
|
+
attributeExists?: boolean;
|
|
12
|
+
beginsWith?: string;
|
|
13
|
+
between?: [string, string];
|
|
14
|
+
contains?: string;
|
|
15
|
+
eq?: T;
|
|
16
|
+
ge?: string;
|
|
17
|
+
gt?: string;
|
|
18
|
+
le?: string;
|
|
19
|
+
lt?: string;
|
|
20
|
+
ne?: T;
|
|
21
|
+
notContains?: string;
|
|
22
|
+
size?: SizeFilter;
|
|
23
|
+
};
|
|
24
|
+
export type NumericFilter = {
|
|
25
|
+
attributeExists?: boolean;
|
|
26
|
+
between?: [number, number];
|
|
27
|
+
eq?: number;
|
|
28
|
+
ge?: number;
|
|
29
|
+
gt?: number;
|
|
30
|
+
le?: number;
|
|
31
|
+
lt?: number;
|
|
32
|
+
ne?: number;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Filter options that can be used on fields where size checks are supported.
|
|
36
|
+
*/
|
|
37
|
+
export type SizeFilter = {
|
|
38
|
+
between?: [number, number];
|
|
39
|
+
eq?: number;
|
|
40
|
+
ge?: number;
|
|
41
|
+
gt?: number;
|
|
42
|
+
le?: number;
|
|
43
|
+
lt?: number;
|
|
44
|
+
ne?: number;
|
|
45
|
+
};
|
|
46
|
+
export type BooleanFilters = {
|
|
47
|
+
attributeExists?: boolean;
|
|
48
|
+
eq?: boolean;
|
|
49
|
+
ne?: boolean;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* A composite SK (in an identifier or secondaryIndex) resolves to this type for
|
|
53
|
+
* list queries and index queries
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* Given
|
|
57
|
+
* ```ts
|
|
58
|
+
* MyModel: a
|
|
59
|
+
.model({
|
|
60
|
+
pk: a.string().required(),
|
|
61
|
+
sk1: a.string().required(),
|
|
62
|
+
sk2: a.integer().required(),
|
|
63
|
+
})
|
|
64
|
+
.identifier(['pk', 'sk1', 'sk2']),
|
|
65
|
+
* ```
|
|
66
|
+
* Expected list options:
|
|
67
|
+
* ```ts
|
|
68
|
+
* {
|
|
69
|
+
* pk?: string
|
|
70
|
+
* sk1Sk2?: ModelPrimaryCompositeKeyConditionInput
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
* Where ModelPrimaryCompositeKeyConditionInput resolves to:
|
|
74
|
+
* ```ts
|
|
75
|
+
* {
|
|
76
|
+
* eq: {sk1: string; sk2: number};
|
|
77
|
+
* le: {sk1: string; sk2: number};
|
|
78
|
+
* lt: {sk1: string; sk2: number};
|
|
79
|
+
* ge: {sk1: string; sk2: number};
|
|
80
|
+
* gt: {sk1: string; sk2: number};
|
|
81
|
+
* between: [ {sk1: string; sk2: number} ];
|
|
82
|
+
* beginsWith: {sk1: string; sk2: number};
|
|
83
|
+
* }
|
|
84
|
+
* ```
|
|
85
|
+
* */
|
|
86
|
+
export type ModelPrimaryCompositeKeyInput<SkIr extends Record<string, string | number>> = {
|
|
87
|
+
eq?: SkIr;
|
|
88
|
+
le?: SkIr;
|
|
89
|
+
lt?: SkIr;
|
|
90
|
+
ge?: SkIr;
|
|
91
|
+
gt?: SkIr;
|
|
92
|
+
between?: [SkIr];
|
|
93
|
+
beginsWith?: SkIr;
|
|
94
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filters.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PrimaryIndexIrShape {
|
|
2
|
+
pk: {
|
|
3
|
+
[key: string]: string | number;
|
|
4
|
+
};
|
|
5
|
+
sk: {
|
|
6
|
+
[key: string]: string | number;
|
|
7
|
+
} | never;
|
|
8
|
+
compositeSk: never | string;
|
|
9
|
+
}
|
|
10
|
+
export interface SecondaryIndexIrShape extends PrimaryIndexIrShape {
|
|
11
|
+
defaultQueryFieldSuffix: string;
|
|
12
|
+
queryField: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndexShapes.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/esm/util/index.d.ts
CHANGED