@aws-amplify/data-schema 0.0.0-20240412222732

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.
Files changed (92) hide show
  1. package/LICENSE +175 -0
  2. package/NOTICE +1 -0
  3. package/internals/package.json +6 -0
  4. package/lib-esm/index.d.ts +5 -0
  5. package/lib-esm/index.d.ts.map +1 -0
  6. package/lib-esm/index.js +28 -0
  7. package/lib-esm/src/Authorization.d.ts +287 -0
  8. package/lib-esm/src/Authorization.d.ts.map +1 -0
  9. package/lib-esm/src/Authorization.js +332 -0
  10. package/lib-esm/src/ClientSchema.d.ts +54 -0
  11. package/lib-esm/src/ClientSchema.d.ts.map +1 -0
  12. package/lib-esm/src/ClientSchema.js +2 -0
  13. package/lib-esm/src/CombineSchema.d.ts +19 -0
  14. package/lib-esm/src/CombineSchema.d.ts.map +1 -0
  15. package/lib-esm/src/CombineSchema.js +40 -0
  16. package/lib-esm/src/CustomOperation.d.ts +98 -0
  17. package/lib-esm/src/CustomOperation.d.ts.map +1 -0
  18. package/lib-esm/src/CustomOperation.js +67 -0
  19. package/lib-esm/src/CustomType.d.ts +36 -0
  20. package/lib-esm/src/CustomType.d.ts.map +1 -0
  21. package/lib-esm/src/CustomType.js +14 -0
  22. package/lib-esm/src/EnumType.d.ts +16 -0
  23. package/lib-esm/src/EnumType.d.ts.map +1 -0
  24. package/lib-esm/src/EnumType.js +17 -0
  25. package/lib-esm/src/Handler.d.ts +58 -0
  26. package/lib-esm/src/Handler.d.ts.map +1 -0
  27. package/lib-esm/src/Handler.js +48 -0
  28. package/lib-esm/src/MappedTypes/CustomOperations.d.ts +127 -0
  29. package/lib-esm/src/MappedTypes/CustomOperations.d.ts.map +1 -0
  30. package/lib-esm/src/MappedTypes/CustomOperations.js +2 -0
  31. package/lib-esm/src/MappedTypes/ExtractNonModelTypes.d.ts +74 -0
  32. package/lib-esm/src/MappedTypes/ExtractNonModelTypes.d.ts.map +1 -0
  33. package/lib-esm/src/MappedTypes/ExtractNonModelTypes.js +2 -0
  34. package/lib-esm/src/MappedTypes/ForeignKeys.d.ts +84 -0
  35. package/lib-esm/src/MappedTypes/ForeignKeys.d.ts.map +1 -0
  36. package/lib-esm/src/MappedTypes/ForeignKeys.js +2 -0
  37. package/lib-esm/src/MappedTypes/ImplicitFieldInjector.d.ts +38 -0
  38. package/lib-esm/src/MappedTypes/ImplicitFieldInjector.d.ts.map +1 -0
  39. package/lib-esm/src/MappedTypes/ImplicitFieldInjector.js +2 -0
  40. package/lib-esm/src/MappedTypes/MapSecondaryIndexes.d.ts +61 -0
  41. package/lib-esm/src/MappedTypes/MapSecondaryIndexes.d.ts.map +1 -0
  42. package/lib-esm/src/MappedTypes/MapSecondaryIndexes.js +2 -0
  43. package/lib-esm/src/MappedTypes/ModelMetadata.d.ts +26 -0
  44. package/lib-esm/src/MappedTypes/ModelMetadata.d.ts.map +1 -0
  45. package/lib-esm/src/MappedTypes/ModelMetadata.js +2 -0
  46. package/lib-esm/src/MappedTypes/ResolveFieldProperties.d.ts +70 -0
  47. package/lib-esm/src/MappedTypes/ResolveFieldProperties.d.ts.map +1 -0
  48. package/lib-esm/src/MappedTypes/ResolveFieldProperties.js +2 -0
  49. package/lib-esm/src/MappedTypes/ResolveSchema.d.ts +65 -0
  50. package/lib-esm/src/MappedTypes/ResolveSchema.d.ts.map +1 -0
  51. package/lib-esm/src/MappedTypes/ResolveSchema.js +2 -0
  52. package/lib-esm/src/ModelField.d.ts +162 -0
  53. package/lib-esm/src/ModelField.d.ts.map +1 -0
  54. package/lib-esm/src/ModelField.js +209 -0
  55. package/lib-esm/src/ModelIndex.d.ts +19 -0
  56. package/lib-esm/src/ModelIndex.d.ts.map +1 -0
  57. package/lib-esm/src/ModelIndex.js +33 -0
  58. package/lib-esm/src/ModelRelationalField.d.ts +119 -0
  59. package/lib-esm/src/ModelRelationalField.d.ts.map +1 -0
  60. package/lib-esm/src/ModelRelationalField.js +120 -0
  61. package/lib-esm/src/ModelSchema.d.ts +107 -0
  62. package/lib-esm/src/ModelSchema.d.ts.map +1 -0
  63. package/lib-esm/src/ModelSchema.js +162 -0
  64. package/lib-esm/src/ModelType.d.ts +85 -0
  65. package/lib-esm/src/ModelType.d.ts.map +1 -0
  66. package/lib-esm/src/ModelType.js +64 -0
  67. package/lib-esm/src/RefType.d.ts +59 -0
  68. package/lib-esm/src/RefType.d.ts.map +1 -0
  69. package/lib-esm/src/RefType.js +47 -0
  70. package/lib-esm/src/SchemaProcessor.d.ts +11 -0
  71. package/lib-esm/src/SchemaProcessor.d.ts.map +1 -0
  72. package/lib-esm/src/SchemaProcessor.js +1106 -0
  73. package/lib-esm/src/index.d.ts +13 -0
  74. package/lib-esm/src/index.d.ts.map +1 -0
  75. package/lib-esm/src/index.js +43 -0
  76. package/lib-esm/src/internals/index.d.ts +2 -0
  77. package/lib-esm/src/internals/index.d.ts.map +1 -0
  78. package/lib-esm/src/internals/index.js +5 -0
  79. package/lib-esm/src/util/Brand.d.ts +36 -0
  80. package/lib-esm/src/util/Brand.d.ts.map +1 -0
  81. package/lib-esm/src/util/Brand.js +32 -0
  82. package/lib-esm/src/util/IndexLimit.d.ts +8 -0
  83. package/lib-esm/src/util/IndexLimit.d.ts.map +1 -0
  84. package/lib-esm/src/util/IndexLimit.js +2 -0
  85. package/lib-esm/src/util/SpreadTuple.d.ts +7 -0
  86. package/lib-esm/src/util/SpreadTuple.d.ts.map +1 -0
  87. package/lib-esm/src/util/SpreadTuple.js +2 -0
  88. package/lib-esm/src/util/index.d.ts +4 -0
  89. package/lib-esm/src/util/index.d.ts.map +1 -0
  90. package/lib-esm/src/util/index.js +6 -0
  91. package/lib-esm/tsconfig.tsbuildinfo +1 -0
  92. package/package.json +62 -0
@@ -0,0 +1,36 @@
1
+ import type { Brand } from './util';
2
+ import type { ModelField, InternalField, ModelFieldTypeParamOuter } from './ModelField';
3
+ import type { RefType } from './RefType';
4
+ import type { EnumType, EnumTypeParamShape } from './EnumType';
5
+ /**
6
+ * Custom Types
7
+ *
8
+ * can be defined in-line to strongly type object types
9
+ *
10
+ */
11
+ export type CustomTypeAllowedModifiers = 'authorization' | 'array' | 'required';
12
+ type CustomTypeFields = Record<string, ModelField<ModelFieldTypeParamOuter, CustomTypeAllowedModifiers, any> | RefType<any, any, any> | EnumType<EnumTypeParamShape> | CustomType<CustomTypeParamShape>>;
13
+ type InternalModelFields = Record<string, InternalField>;
14
+ type CustomTypeData = {
15
+ fields: CustomTypeFields;
16
+ type: 'customType';
17
+ };
18
+ type InternalCustomTypeData = CustomTypeData & {
19
+ fields: InternalModelFields;
20
+ };
21
+ export type CustomTypeParamShape = {
22
+ fields: CustomTypeFields;
23
+ };
24
+ export type CustomType<T extends CustomTypeParamShape> = T & Brand<'customType'>;
25
+ /**
26
+ * Internal representation of CustomType that exposes the `data` property.
27
+ * Used at buildtime.
28
+ */
29
+ export type InternalCustomType = CustomType<any> & {
30
+ data: InternalCustomTypeData;
31
+ };
32
+ export declare function customType<T extends CustomTypeFields>(fields: T): CustomType<{
33
+ fields: T;
34
+ }>;
35
+ export {};
36
+ //# sourceMappingURL=CustomType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomType.d.ts","sourceRoot":"","sources":["../../src/CustomType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE/D;;;;;GAKG;AAGH,MAAM,MAAM,0BAA0B,GAAG,eAAe,GAAG,OAAO,GAAG,UAAU,CAAC;AAEhF,KAAK,gBAAgB,GAAG,MAAM,CAC5B,MAAM,EACJ,UAAU,CAAC,wBAAwB,EAAE,0BAA0B,EAAE,GAAG,CAAC,GACrE,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GACtB,QAAQ,CAAC,kBAAkB,CAAC,GAC5B,UAAU,CAAC,oBAAoB,CAAC,CACnC,CAAC;AAEF,KAAK,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAEzD,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAEF,KAAK,sBAAsB,GAAG,cAAc,GAAG;IAC7C,MAAM,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,oBAAoB,IAAI,CAAC,GACxD,KAAK,CAAC,YAAY,CAAC,CAAC;AAEtB;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG;IACjD,IAAI,EAAE,sBAAsB,CAAC;CAC9B,CAAC;AAWF,wBAAgB,UAAU,CAAC,CAAC,SAAS,gBAAgB,EACnD,MAAM,EAAE,CAAC,GACR,UAAU,CAAC;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAAC,CAE3B"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.customType = void 0;
4
+ function _customType(fields) {
5
+ const data = {
6
+ fields,
7
+ type: 'customType',
8
+ };
9
+ return { data };
10
+ }
11
+ function customType(fields) {
12
+ return _customType(fields);
13
+ }
14
+ exports.customType = customType;
@@ -0,0 +1,16 @@
1
+ import { Brand } from './util';
2
+ export type EnumTypeParamShape = {
3
+ type: 'enum';
4
+ values: readonly string[];
5
+ };
6
+ export type EnumType<T extends EnumTypeParamShape> = T & Brand<'enum'>;
7
+ type EnumTypeArgFactory<Values extends readonly string[]> = {
8
+ type: 'enum';
9
+ values: Values;
10
+ };
11
+ /**
12
+ * this type param pattern allows us to infer literal type values from the array without using the `as const` suffix
13
+ */
14
+ export declare function enumType<Value extends string, T extends readonly Value[]>(values: T): EnumType<EnumTypeArgFactory<T>>;
15
+ export {};
16
+ //# sourceMappingURL=EnumType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnumType.d.ts","sourceRoot":"","sources":["../../src/EnumType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAO/B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,kBAAkB,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAWvE,KAAK,kBAAkB,CAAC,MAAM,SAAS,SAAS,MAAM,EAAE,IAAI;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,SAAS,MAAM,EAAE,CAAC,SAAS,SAAS,KAAK,EAAE,EACvE,MAAM,EAAE,CAAC,mCAGV"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.enumType = void 0;
4
+ function _enum(values) {
5
+ const data = {
6
+ type: 'enum',
7
+ values,
8
+ };
9
+ return data;
10
+ }
11
+ /**
12
+ * this type param pattern allows us to infer literal type values from the array without using the `as const` suffix
13
+ */
14
+ function enumType(values) {
15
+ return _enum(values);
16
+ }
17
+ exports.enumType = enumType;
@@ -0,0 +1,58 @@
1
+ import type { DefineFunction } from '@aws-amplify/data-schema-types';
2
+ import { Brand } from './util';
3
+ import { RefType } from './RefType';
4
+ export type HandlerType = InlineSqlHandler | SqlReferenceHandler | CustomHandler | FunctionHandler;
5
+ declare const dataSymbol: unique symbol;
6
+ type AllHandlers = InlineSqlHandler | SqlReferenceHandler | CustomHandler | FunctionHandler;
7
+ export declare function getHandlerData<H extends AllHandlers>(handler: H): H[typeof dataSymbol];
8
+ declare const inlineSqlBrand = "inlineSql";
9
+ export type InlineSqlHandler = {
10
+ [dataSymbol]: string;
11
+ } & Brand<typeof inlineSqlBrand>;
12
+ declare function inlineSql(sql: string): InlineSqlHandler;
13
+ declare const sqlReferenceBrand = "sqlReference";
14
+ export type SqlReferenceHandlerData = {
15
+ entry: string;
16
+ stack: string | undefined;
17
+ };
18
+ export type SqlReferenceHandler = {
19
+ [dataSymbol]: SqlReferenceHandlerData;
20
+ } & Brand<typeof sqlReferenceBrand>;
21
+ declare function sqlReference(sqlFilePath: string): SqlReferenceHandler;
22
+ type CustomHandlerInput = {
23
+ /**
24
+ * The data source used by the function.
25
+ * Can reference a model in the schema with a.ref('ModelName') or any string data source name configured in your API
26
+ *
27
+ * Defaults to 'NONE_DS'
28
+ *
29
+ */
30
+ dataSource?: string | RefType<any>;
31
+ /**
32
+ * The path to the file that contains the function entry point.
33
+ * If this is a relative path, it is computed relative to the file where this handler is defined
34
+ */
35
+ entry: string;
36
+ };
37
+ export type CustomHandlerData = CustomHandlerInput & {
38
+ stack: string | undefined;
39
+ };
40
+ declare const customHandlerBrand = "customHandler";
41
+ export type CustomHandler = {
42
+ [dataSymbol]: CustomHandlerData;
43
+ } & Brand<typeof customHandlerBrand>;
44
+ declare function custom(customHandler: CustomHandlerInput): CustomHandler;
45
+ export type FunctionHandlerData = DefineFunction | string;
46
+ declare const functionHandlerBrand = "functionHandler";
47
+ export type FunctionHandler = {
48
+ [dataSymbol]: FunctionHandlerData;
49
+ } & Brand<typeof functionHandlerBrand>;
50
+ declare function fcn(fn: FunctionHandlerData): FunctionHandler;
51
+ export declare const handler: {
52
+ inlineSql: typeof inlineSql;
53
+ sqlReference: typeof sqlReference;
54
+ custom: typeof custom;
55
+ function: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IACH,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACnC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,GAAG;IACnD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,kBAAkB,kBAAkB,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG;IAAE,CAAC,UAAU,CAAC,EAAE,iBAAiB,CAAA;CAAE,GAAG,KAAK,CACrE,OAAO,kBAAkB,CAC1B,CAAC;AAEF,iBAAS,MAAM,CAAC,aAAa,EAAE,kBAAkB,GAAG,aAAa,CAOhE;AAMD,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG,MAAM,CAAC;AAE1D,QAAA,MAAM,oBAAoB,oBAAoB,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,UAAU,CAAC,EAAE,mBAAmB,CAAC;CACnC,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvC,iBAAS,GAAG,CAAC,EAAE,EAAE,mBAAmB,GAAG,eAAe,CAErD;AAID,eAAO,MAAM,OAAO;;;;;CAKnB,CAAC"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handler = exports.getHandlerData = void 0;
4
+ const util_1 = require("./util");
5
+ const dataSymbol = Symbol('Data');
6
+ function buildHandler(brandName) {
7
+ return (0, util_1.brand)(brandName);
8
+ }
9
+ function getHandlerData(handler) {
10
+ return handler[dataSymbol];
11
+ }
12
+ exports.getHandlerData = getHandlerData;
13
+ //#region handler.inlineSql
14
+ const inlineSqlBrand = 'inlineSql';
15
+ function inlineSql(sql) {
16
+ return { [dataSymbol]: sql, ...buildHandler(inlineSqlBrand) };
17
+ }
18
+ //#endregion
19
+ //#region handler.sqlReference
20
+ const sqlReferenceBrand = 'sqlReference';
21
+ function sqlReference(sqlFilePath) {
22
+ // used to determine caller directory in order to resolve relative path downstream
23
+ const stack = new Error().stack;
24
+ return {
25
+ [dataSymbol]: { stack, entry: sqlFilePath },
26
+ ...buildHandler(sqlReferenceBrand),
27
+ };
28
+ }
29
+ const customHandlerBrand = 'customHandler';
30
+ function custom(customHandler) {
31
+ // used to determine caller directory in order to resolve relative path downstream
32
+ const stack = new Error().stack;
33
+ return {
34
+ [dataSymbol]: { ...customHandler, stack },
35
+ ...buildHandler(customHandlerBrand),
36
+ };
37
+ }
38
+ const functionHandlerBrand = 'functionHandler';
39
+ function fcn(fn) {
40
+ return { [dataSymbol]: fn, ...buildHandler(functionHandlerBrand) };
41
+ }
42
+ //#endregion
43
+ exports.handler = {
44
+ inlineSql,
45
+ sqlReference,
46
+ custom,
47
+ function: fcn,
48
+ };
@@ -0,0 +1,127 @@
1
+ import type { GenericModelSchema } from '../ModelSchema';
2
+ import type { NonModelTypesShape } from './ExtractNonModelTypes';
3
+ import type { CustomOperation, CustomOperationParamShape } from '../CustomOperation';
4
+ import type { ModelField } from '../ModelField';
5
+ import type { RefType, RefTypeParamShape } from '../RefType';
6
+ import type { ResolveCustomTypeFieldsRequirements, ResolveRefsOfCustomType, ResolveRefValueArrayTraits } from './ResolveFieldProperties';
7
+ import type { AppSyncResolverHandler } from 'aws-lambda';
8
+ import type { CustomType } from '../CustomType';
9
+ import type { FieldTypesOfCustomType } from './ResolveSchema';
10
+ /**
11
+ * Creates meta types for custom operations from a schema.
12
+ */
13
+ export type ResolveCustomOperations<Schema extends GenericModelSchema<any>, FullyResolvedSchema extends Record<string, unknown>, NonModelTypes extends NonModelTypesShape, CustomOperations extends Record<string, CustomOperationParamShape> = CustomOpShapes<Schema>> = {
14
+ customOperations: {
15
+ [OpName in keyof CustomOperations]: {
16
+ arguments: CustomOpArguments<CustomOperations[OpName]>;
17
+ returnType: CustomOpReturnType<CustomOperations[OpName], FullyResolvedSchema, NonModelTypes, CustomOperations>;
18
+ functionRef: CustomOperations[OpName]['functionRef'];
19
+ typeName: CustomOperations[OpName]['typeName'];
20
+ authorization: CustomOperations[OpName]['authorization'];
21
+ };
22
+ };
23
+ };
24
+ /**
25
+ * Filtered, mapped list of custom operations shapes from a schema.
26
+ */
27
+ export type CustomOpShapes<Schema extends GenericModelSchema<any>> = {
28
+ [K in keyof Schema['data']['types'] as Schema['data']['types'][K] extends CustomOperation<any, any> ? K : never]: Schema['data']['types'][K] extends CustomOperation<infer Shape, any> ? Shape : never;
29
+ };
30
+ /**
31
+ * Digs out custom operation arguments, mapped to the intended graphql types.
32
+ */
33
+ export type CustomOpArguments<Shape extends CustomOperationParamShape> = Shape['arguments'] extends null ? never : {
34
+ [FieldName in keyof Shape['arguments']]: Shape['arguments'][FieldName] extends ModelField<infer R, any, any> ? R : never;
35
+ };
36
+ /**
37
+ * Computes the return type from the `returnType` of a custom operation shape.
38
+ *
39
+ * This entails dereferencing refs and inferring graphql types from field-type defs.
40
+ */
41
+ export type CustomOpReturnType<Shape extends CustomOperationParamShape, FullyResolvedSchema extends Record<string, unknown>, NonModelTypes extends NonModelTypesShape, CustomOperations extends Record<string, CustomOperationParamShape>> = Shape['returnType'] extends RefType<infer RefShape, any, any> ? RefShape['link'] extends keyof CustomOperations ? CustomOpReturnType<CustomOperations[RefShape['link']], FullyResolvedSchema, NonModelTypes, CustomOperations> : ResolveRef<RefShape, FullyResolvedSchema, NonModelTypes, CustomOperations> : Shape['returnType'] extends ModelField<infer R, any, any> ? R : Shape['returnType'] extends CustomType<infer R> ? ResolveCustomTypeFieldsRequirements<FieldTypesOfCustomType<{
42
+ thisCustomType: R['fields'];
43
+ }>['thisCustomType']> | null : never;
44
+ /**
45
+ * `a.ref()` resolution specific to custom operations, for which `a.ref()`
46
+ * can refer to a model, custom type, or enum.
47
+ *
48
+ * This utility is a duplication of ResolveRef (src/MappedTypes/ResolveFieldProperties.ts)
49
+ * with the addition that allows .ref() a model with custom operations.
50
+ */
51
+ export type ResolveRef<Shape extends RefTypeParamShape, FullyResolvedSchema extends Record<string, unknown>, NonModelTypes extends NonModelTypesShape, CustomOperations extends Record<string, CustomOperationParamShape>, Link = Shape['link'], RefValue = Link extends keyof FullyResolvedSchema ? FullyResolvedSchema[Link] : Link extends keyof NonModelTypes['enums'] ? NonModelTypes['enums'][Link] : Link extends keyof NonModelTypes['customTypes'] ? ResolveRefsOfCustomType<NonModelTypes, NonModelTypes['customTypes'][Link]> : Link extends keyof CustomOperations ? CustomOpReturnType<CustomOperations[Link], FullyResolvedSchema, NonModelTypes, CustomOperations> : never, Value = Shape['valueRequired'] extends true ? RefValue : RefValue | null> = ResolveRefValueArrayTraits<Shape, Value>;
52
+ /**
53
+ * The kind of shape we need to map to custom handler (e.g., lambda) function
54
+ * signatures.
55
+ */
56
+ type CustomOperationsMap = Record<string, CustomOperationMinimalDef>;
57
+ /**
58
+ * The minimal amount of structure needed to extract types for a custom handler.
59
+ */
60
+ type CustomOperationMinimalDef = {
61
+ arguments: any;
62
+ returnType: any;
63
+ };
64
+ /**
65
+ * Derives the signature and types for a lambda handler for a particular
66
+ * custom Query or Mutation from a Schema.
67
+ */
68
+ type IndividualCustomHandlerTypes<Op extends CustomOperationMinimalDef> = {
69
+ /**
70
+ * Handler type for lambda function implementations. E.g.,
71
+ *
72
+ * ```typescript
73
+ * import type { Schema } from './resource';
74
+ *
75
+ * export const handler: Schema['echo']['functionHandler'] = async (event, context) => {
76
+ * // event and context will be fully typed inside here.
77
+ * }
78
+ * ```
79
+ */
80
+ functionHandler: AppSyncResolverHandler<Op['arguments'], LambdaReturnType<Op['returnType']>>;
81
+ /**
82
+ * The `context.arguments` type for lambda function implementations.
83
+ *
84
+ * ```typescript
85
+ * import type { Schema } from './resource';
86
+ *
87
+ * export const handler: Schema['echo']['functionHandler'] = async (event, context) => {
88
+ * // Provides this type, if needed:
89
+ * const args: Schema['echo']['functionHandlerArguments'] = event.arguments;
90
+ * }
91
+ * ```
92
+ */
93
+ functionHandlerArguments: Op['arguments'];
94
+ /**
95
+ * The return type expected by a lambda function handler.
96
+ *
97
+ * ```typescript
98
+ * import type { Schema } from './resource';
99
+ *
100
+ * export const handler: Schema['echo']['functionHandler'] = async (event, context) => {
101
+ * // Result type enforced here:
102
+ * const result: Schema['echo']['functionHandlerResult'] = buildResult(...);
103
+ *
104
+ * // `Result` type matches expected function return type here:
105
+ * return result;
106
+ * }
107
+ * ```
108
+ */
109
+ functionHandlerResult: LambdaReturnType<Op['returnType']>;
110
+ };
111
+ /**
112
+ * Derives the function signatures for a lambda handlers for all the provided
113
+ * custom queries and mutations.
114
+ */
115
+ export type CustomOperationHandlerTypes<CustomOperations extends CustomOperationsMap> = {
116
+ [K in keyof CustomOperations]: IndividualCustomHandlerTypes<CustomOperations[K]>;
117
+ };
118
+ /**
119
+ * Returns a return type with lazy loaders removed.
120
+ *
121
+ * (Custom handlers should not return lazy loaded fields -- they're *lazy loaded*.)
122
+ */
123
+ type LambdaReturnType<T> = T extends Record<string, any> ? {
124
+ [K in keyof Exclude<T, null | undefined> as Exclude<T, null | undefined>[K] extends (...args: any) => any ? never : K]: Exclude<T, null | undefined>[K];
125
+ } : T | (null extends T ? null : never) | (undefined extends T ? undefined : never);
126
+ export {};
127
+ //# sourceMappingURL=CustomOperations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomOperations.d.ts","sourceRoot":"","sources":["../../../src/MappedTypes/CustomOperations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EACV,eAAe,EACf,yBAAyB,EAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EACV,mCAA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E,sBAAsB,CACrC,EAAE,CAAC,WAAW,CAAC,EACf,gBAAgB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CACnC,CAAC;IAEF;;;;;;;;;;;OAWG;IACH,wBAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC;IAE1C;;;;;;;;;;;;;;OAcG;IACH,qBAAqB,EAAE,gBAAgB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;CAC3D,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,2BAA2B,CACrC,gBAAgB,SAAS,mBAAmB,IAC1C;KACD,CAAC,IAAI,MAAM,gBAAgB,GAAG,4BAA4B,CACzD,gBAAgB,CAAC,CAAC,CAAC,CACpB;CACF,CAAC;AAEF;;;;GAIG;AACH,KAAK,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACpD;KAGG,CAAC,IAAI,MAAM,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,IAAI,OAAO,CACjD,CAAC,EACD,IAAI,GAAG,SAAS,CACjB,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,GAC9B,KAAK,GACL,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;CACxC,GAEG,CAAC,GAGD,CAAC,IAAI,SAAS,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,GAC/B,CAAC,SAAS,SAAS,CAAC,GAAG,SAAS,GAAG,KAAK,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,74 @@
1
+ import type { UnionToIntersection } from '@aws-amplify/data-schema-types';
2
+ import type { CustomType, CustomTypeParamShape } from '../CustomType';
3
+ import type { EnumType, EnumTypeParamShape } from '../EnumType';
4
+ import type { SchemaTypes, ModelAndCustomTypes, FieldTypesOfCustomType } from './ResolveSchema';
5
+ import type { ModelType, ModelTypeParamShape } from '../ModelType';
6
+ export type NonModelTypesShape = {
7
+ enums: Record<string, EnumType<any>>;
8
+ customTypes: Record<string, any>;
9
+ };
10
+ export type ExtractNonModelTypes<Schema> = ResolveNonModelFields<ResolveNonModelTypes<Schema, ExtractImplicitNonModelTypes<Schema>>>;
11
+ /**
12
+ * Extract all implicit non-model types a `FieldName: Field` map recursively,
13
+ * and store them in a flat map. The keys are serialized property path.
14
+ *
15
+ * For example, with the following schema structure:
16
+ * ```
17
+ * ExtractAndFlattenImplicitNonModelTypesFromFields<
18
+ * 'Post',
19
+ * {
20
+ * content: string,
21
+ * status: enum(['reviewing'], ['published']),
22
+ * meta: customType({
23
+ * tag: enum(['internal', 'external']),
24
+ * views: number
25
+ * }),
26
+ * tag: ref('SomeExplicitEnum'),
27
+ * }
28
+ * >
29
+ * ```
30
+ * It generates the result as:
31
+ * ```
32
+ * {
33
+ * PostStatus: enum(['reviewing'], ['published']),
34
+ * PostMeta: customType({
35
+ * tag: enum(['internal', 'external']),
36
+ * views: number
37
+ * }),
38
+ * PostMetaTag: enum(['internal', 'external']),
39
+ * }
40
+ * ```
41
+ */
42
+ export type ExtractAndFlattenImplicitNonModelTypesFromFields<ParentTypeName extends string, Fields> = {
43
+ [FieldProp in keyof Fields as Fields[FieldProp] extends EnumType<EnumTypeParamShape> | CustomType<CustomTypeParamShape> ? FieldProp : never]: (x: NonNullable<Fields[FieldProp]> extends infer FieldType ? FieldType extends EnumType<EnumTypeParamShape> ? {
44
+ [Key in `${ParentTypeName}${Capitalize<FieldProp & string>}`]: Fields[FieldProp];
45
+ } : FieldType extends CustomType<infer CustomTypeShape extends CustomTypeParamShape> ? // recursively extract to the Nested CustomType, and return the
46
+ ExtractAndFlattenImplicitNonModelTypesFromFields<`${ParentTypeName}${Capitalize<FieldProp & string>}`, CustomTypeShape['fields']> & {
47
+ [Key in `${ParentTypeName}${Capitalize<FieldProp & string>}`]: Fields[FieldProp];
48
+ } : never : never) => void;
49
+ } extends Record<string, infer Func> ? Func extends (x: infer P) => void ? P : Record<never, never> : Record<never, never>;
50
+ /**
51
+ * Pulls out implicit, i.e. field-level non-model types from `ModelType` and
52
+ * `CustomType` which may contain deeply nested implicit (inline) non-model
53
+ * types.
54
+ */
55
+ export type ExtractImplicitNonModelTypes<Schema, Targets = ModelAndCustomTypes<SchemaTypes<Schema>>> = UnionToIntersection<{
56
+ [Model in keyof Targets]: Targets[Model] extends CustomType<infer R extends CustomTypeParamShape> ? // extract nested non-model types from it, and include itself
57
+ ExtractAndFlattenImplicitNonModelTypesFromFields<Capitalize<Model & string>, R['fields']> & {
58
+ [key in Model]: Targets[Model];
59
+ } : Targets[Model] extends ModelType<infer R extends ModelTypeParamShape, any> ? ExtractAndFlattenImplicitNonModelTypesFromFields<Capitalize<Model & string>, R['fields']> : Targets[Model];
60
+ }[keyof Targets]>;
61
+ type ResolveNonModelTypes<Schema, Extracted, ResolvedSchema = SchemaTypes<Schema> & Extracted> = {
62
+ enums: {
63
+ [Model in keyof ResolvedSchema as ResolvedSchema[Model] extends EnumType<EnumTypeParamShape> ? Model : never]: ResolvedSchema[Model] extends EnumType<infer R extends EnumTypeParamShape> ? R['values'][number] : never;
64
+ };
65
+ customTypes: {
66
+ [Model in keyof ResolvedSchema as ResolvedSchema[Model] extends CustomType<CustomTypeParamShape> ? Model : never]: ResolvedSchema[Model] extends CustomType<infer R extends CustomTypeParamShape> ? R['fields'] : never;
67
+ };
68
+ };
69
+ type ResolveNonModelFields<T extends NonModelTypesShape> = {
70
+ enums: T['enums'];
71
+ customTypes: FieldTypesOfCustomType<T['customTypes']>;
72
+ };
73
+ export {};
74
+ //# sourceMappingURL=ExtractNonModelTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtractNonModelTypes.d.ts","sourceRoot":"","sources":["../../../src/MappedTypes/ExtractNonModelTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EA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AAS,EACT,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,IAC9C;IACF,KAAK,EAAE;SACJ,KAAK,IAAI,MAAM,cAAc,IAAI,cAAc,CAAC,KAAK,CAAC,SAAS,QAAQ,CAAC,kBAAkB,CAAC,GACxF,KAAK,GACL,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,SAAS,QAAQ,CAChD,MAAM,CAAC,SAAS,kBAAkB,CACnC,GACG,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GACnB,KAAK;KACV,CAAC;IACF,WAAW,EAAE;SACV,KAAK,IAAI,MAAM,cAAc,IAAI,cAAc,CAAC,KAAK,CAAC,SAAS,UAAU,CAAC,oBAAoB,CAAC,GAC5F,KAAK,GACL,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,SAAS,UAAU,CAClD,MAAM,CAAC,SAAS,oBAAoB,CACrC,GACG,CAAC,CAAC,QAAQ,CAAC,GACX,KAAK;KACV,CAAC;CACH,CAAC;AAEF,KAAK,qBAAqB,CAAC,CAAC,SAAS,kBAAkB,IAAI;IACzD,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;IAClB,WAAW,EAAE,sBAAsB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;CACvD,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,84 @@
1
+ import { ResolveSchema } from './ResolveSchema';
2
+ import { UnionToIntersection } from '@aws-amplify/data-schema-types';
3
+ import { ModelRelationalFieldParamShape, ModelRelationshipTypes } from '../ModelRelationalField';
4
+ export type AllImpliedFKs<ResolvedSchema, Identifiers extends Record<string, {
5
+ identifier: string;
6
+ }>, Schema extends Record<any, any> = ResolvedSchema extends ResolveSchema<any> ? ResolvedSchema : object, DenormalizedSchema extends Denormalized<Schema, Identifiers> = Denormalized<Schema, Identifiers>, AllModels = DenormalizedSchema['model'] | DenormalizedSchema['relationName']> = {
7
+ [K in Extract<AllModels, string>]: ImpliedFKs<ResolvedSchema, Identifiers, K> extends never ? object : ImpliedFKs<ResolvedSchema, Identifiers, K>;
8
+ };
9
+ export type Denormalized<Schema extends Record<any, any>, Identifiers extends Record<string, {
10
+ identifier: string;
11
+ }>> = {
12
+ [ModelName in keyof Schema]: {
13
+ [FieldName in keyof Schema[ModelName]]: {
14
+ model: ModelName;
15
+ identifier: IdentifierFields<Identifiers, ModelName>;
16
+ field: FieldName;
17
+ type: Schema[ModelName][FieldName];
18
+ } & RelatedModelFields<Schema[ModelName][FieldName], Identifiers>;
19
+ }[keyof Schema[ModelName]];
20
+ }[keyof Schema];
21
+ export type ImpliedFKs<ResolvedSchema, Identifiers extends Record<string, {
22
+ identifier: string;
23
+ }>, ModelName, Schema extends Record<any, any> = ResolvedSchema extends ResolveSchema<any> ? ResolvedSchema : object, DenormalizedSchema = Denormalized<Schema, Identifiers>, HasMany_Model = Extract<DenormalizedSchema, {
24
+ relatedModel: ModelName;
25
+ relationshipType: ModelRelationshipTypes.hasMany;
26
+ }>, HasOne_Model = Extract<DenormalizedSchema, {
27
+ model: ModelName;
28
+ relationshipType: ModelRelationshipTypes.hasOne;
29
+ }>, Model_BelongsTo = Exclude<Extract<DenormalizedSchema, {
30
+ model: ModelName;
31
+ relationshipType: ModelRelationshipTypes.belongsTo;
32
+ }>, ImpliedHasManyBelongsTos<HasMany_Model>>, ManyToManys = Extract<DenormalizedSchema, {
33
+ relationName: ModelName;
34
+ relationshipType: ModelRelationshipTypes.manyToMany;
35
+ }>, InferredFields = HasMany_Model_Keys<Schema, HasMany_Model> | HasOne_Model_Keys<Schema, HasOne_Model> | Model_BelongsTo_Keys<Schema, Model_BelongsTo> | ManyToManyKeys<Schema, ManyToManys>> = unknown extends UnionToIntersection<InferredFields> ? never : UnionToIntersection<InferredFields>;
36
+ type IdentifierFields<Identifiers extends Record<string, {
37
+ identifier: string;
38
+ }>, ModelName> = ModelName extends keyof Identifiers ? Identifiers[ModelName]['identifier'] : 'id';
39
+ type RelatedModelFields<ModelField, Identifiers extends Record<string, {
40
+ identifier: string;
41
+ }>> = ModelField extends ModelRelationalFieldParamShape ? {
42
+ relatedModel: ModelField['relatedModel'];
43
+ relationshipType: ModelField['relationshipType'];
44
+ relationName: ModelField['relationName'];
45
+ relatedModelIdentifier: IdentifierFields<Identifiers, ModelField['relatedModel']>;
46
+ } : {
47
+ relatedModel: undefined;
48
+ relationshipType: undefined;
49
+ relationName: undefined;
50
+ relatedModelIdentifier: never;
51
+ };
52
+ type FieldWithRelationship = {
53
+ model: string;
54
+ identifier: string;
55
+ field: string;
56
+ relatedModel: string;
57
+ relatedModelIdentifier: string;
58
+ relationName: string | undefined;
59
+ };
60
+ /**
61
+ * I.e., creates a "matcher" to identify the belongsTo entries that correspond with
62
+ * the given hasMany relationship.
63
+ *
64
+ * The `belongsTo` side of these relationships can be ignored. The FK comes from the
65
+ * `hasMany` side of the relationship.
66
+ */
67
+ type ImpliedHasManyBelongsTos<Relationship> = Relationship extends FieldWithRelationship ? {
68
+ model: Relationship['relatedModel'];
69
+ } : never;
70
+ type FKName<Model extends string, Field extends string, Identifier extends string> = `${Uncapitalize<Model>}${Capitalize<Field>}${Capitalize<Identifier>}`;
71
+ type HasMany_Model_Keys<Schema extends Record<any, any>, RelDef> = RelDef extends FieldWithRelationship ? {
72
+ [IDField in RelDef['identifier'] as FKName<RelDef['model'], RelDef['field'], IDField>]?: IDField extends keyof Schema[RelDef['model']] ? Schema[RelDef['model']][IDField] : string;
73
+ } : never;
74
+ type HasOne_Model_Keys<Schema extends Record<any, any>, RelDef> = RelDef extends FieldWithRelationship ? {
75
+ [IDField in RelDef['relatedModelIdentifier'] as FKName<RelDef['model'], RelDef['field'], IDField>]?: IDField extends keyof Schema[RelDef['relatedModel']] ? Schema[RelDef['relatedModel']][IDField] : string;
76
+ } : never;
77
+ type Model_BelongsTo_Keys<Schema extends Record<any, any>, RelDef> = RelDef extends FieldWithRelationship ? {
78
+ [IDField in RelDef['relatedModelIdentifier'] as FKName<RelDef['model'], RelDef['field'], IDField>]?: IDField extends keyof Schema[RelDef['model']] ? Schema[RelDef['model']][IDField] : string;
79
+ } : never;
80
+ type ManyToManyKeys<Schema extends Record<any, any>, RelDef> = RelDef extends FieldWithRelationship ? {
81
+ [IDField in RelDef['identifier'] as FKName<RelDef['model'], '', IDField>]?: IDField extends keyof Schema[RelDef['model']] ? Schema[RelDef['model']][IDField] : string;
82
+ } : never;
83
+ export {};
84
+ //# sourceMappingURL=ForeignKeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForeignKeys.d.ts","sourceRoot":"","sources":["../../../src/MappedTypes/ForeignKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,aAAa,CACvB,cAAc,EACd,WAAW,SAAS,MAAM,CAAC,MAAM,EAAE;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1D,MAAM,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,cAAc,SAAS,aAAa,CAAC,GAAG,CAAC,GACvE,cAAc,GACd,MAAM,EACV,kBAAkB,SAAS,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,YAAY,CACzE,MAAM,EACN,WAAW,CACZ,EACD,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,cAAc,CAAC,IAC1E;KACD,CAAC,IAAI,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,UAAU,CAC3C,cAAc,EACd,WAAW,EACX,CAAC,CACF,SAAS,KAAK,GACX,MAAM,GACN,UAAU,CAAC,cAAc,EAAE,WAAW,EAAE,CAAC,CAAC;CAC/C,CAA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,IAAI,MAAM,CACpD,MAAM,CAAC,OAAO,CAAC,EACf,MAAM,CAAC,OAAO,CAAC,EACf,OAAO,CACR,CAAC,CAAC,EAAE,OAAO,SAAS,MAAM,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,GACrD,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,GACvC,MAAM;CACX,GACD,KAAK,CAAC;AAEV,KAAK,oBAAoB,CACvB,MAAM,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAC/B,MAAM,IACJ,MAAM,SAAS,qBAAqB,GACpC;KACG,OAAO,IAAI,MAAM,CAAC,wBAAwB,CAAC,IAAI,MAAM,CACpD,MAAM,CAAC,OAAO,CAAC,EACf,MAAM,CAAC,OAAO,CAAC,EACf,OAAO,CACR,CAAC,CAAC,EAAE,OAAO,SAAS,MAAM,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAC9C,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAChC,MAAM;CACX,GACD,KAAK,CAAC;AAEV,KAAK,cAAc,CACjB,MAAM,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAC/B,MAAM,IACJ,MAAM,SAAS,qBAAqB,GACpC;KACG,OAAO,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,MAAM,CACxC,MAAM,CAAC,OAAO,CAAC,EACf,EAAE,EACF,OAAO,CACR,CAAC,CAAC,EAAE,OAAO,SAAS,MAAM,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAC9C,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAChC,MAAM;CACX,GACD,KAAK,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,38 @@
1
+ type DefaultIdentifierFields = {
2
+ readonly id: string;
3
+ };
4
+ type DefaultTimestampFields = {
5
+ readonly createdAt: string;
6
+ readonly updatedAt: string;
7
+ };
8
+ type InitialImplicitFields<Identifier> = Identifier extends 'id' ? DefaultIdentifierFields & DefaultTimestampFields : DefaultTimestampFields;
9
+ /**
10
+ * @returns true if a string union `ExplicitFieldNames` contains a given string `FieldName`
11
+ */
12
+ type FieldExists<ExplicitFieldNames extends string, FieldName extends string> = Extract<ExplicitFieldNames, FieldName> extends never ? false : true;
13
+ /**
14
+ * @returns union of explicitly defined field names for a model
15
+ */
16
+ type GetModelFieldNames<FlatModel> = FlatModel extends Record<infer R, any> ? R : never;
17
+ /**
18
+ * Generate Record type containing all implicit fields for a given model
19
+ */
20
+ type ImplicitFields<FlatModel, Identifier, ModelFieldNames = GetModelFieldNames<FlatModel>> = {
21
+ [ImplicitField in keyof InitialImplicitFields<Identifier> as FieldExists<ModelFieldNames & string, ImplicitField & string> extends true ? never : ImplicitField]: InitialImplicitFields<Identifier>[ImplicitField];
22
+ };
23
+ /**
24
+ * @returns intersection of explicit and implicit model fields
25
+ */
26
+ type InjectDefaultFieldsForModel<FlatModel, ModelIdentifier> = FlatModel & ImplicitFields<FlatModel, 'identifier' extends keyof ModelIdentifier ? ModelIdentifier['identifier'] : never>;
27
+ /**
28
+ * Mapped type that injects default implicit fields for a model
29
+ * 1. Add "id" field to models with neither an explicit field named "id" nor a custom identifier (`.identifier(['some-field'])`)
30
+ * 2. Add default timestamp fields ("createdAt", "updatedAt") unless they're already explicitly defined
31
+ *
32
+ * @typeParam FlattenedSchema - resolved schema type (TODO: add detail/example/link to type)
33
+ */
34
+ export type InjectImplicitModelFields<FlattenedSchema, IdentifierMeta> = {
35
+ [ModelName in keyof FlattenedSchema]: InjectDefaultFieldsForModel<FlattenedSchema[ModelName], ModelName extends keyof IdentifierMeta ? IdentifierMeta[ModelName] : object>;
36
+ };
37
+ export {};
38
+ //# sourceMappingURL=ImplicitFieldInjector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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