@aws-amplify/data-schema 1.1.3 → 1.1.4

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.
@@ -1,4 +1,4 @@
1
1
  'use strict';
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=MapSecondaryIndexes.js.map
4
+ //# sourceMappingURL=MapIndexes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapIndexes.js","sources":["../../../src/MappedTypes/MapIndexes.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;"}
@@ -812,7 +812,9 @@ const schemaPreprocessor = (schema) => {
812
812
  const { gqlFields, implicitTypes } = processFields(typeName, fields, authFields, fieldLevelAuthRules, identifier, partitionKey);
813
813
  topLevelTypes.push(...implicitTypes);
814
814
  const joined = gqlFields.join('\n ');
815
- const refersToString = typeDef.data.originalName ? ` @refersTo(name: "${typeDef.data.originalName}")` : '';
815
+ const refersToString = typeDef.data.originalName
816
+ ? ` @refersTo(name: "${typeDef.data.originalName}")`
817
+ : '';
816
818
  // TODO: update @model(timestamps: null) once a longer term solution gets
817
819
  // determined.
818
820
  //
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaProcessor.js","sources":["../../src/SchemaProcessor.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.processSchema = void 0;\nconst tslib_1 = require(\"tslib\");\nconst ModelField_1 = require(\"./ModelField\");\nconst Authorization_1 = require(\"./Authorization\");\nconst CustomOperation_1 = require(\"./CustomOperation\");\nconst util_1 = require(\"./util\");\nconst Handler_1 = require(\"./Handler\");\nconst os = tslib_1.__importStar(require(\"os\"));\nconst path = tslib_1.__importStar(require(\"path\"));\nfunction isInternalModel(model) {\n if (model.data &&\n !isCustomType(model) &&\n !isCustomOperation(model)) {\n return true;\n }\n return false;\n}\nfunction isEnumType(data) {\n if (data?.type === 'enum') {\n return true;\n }\n return false;\n}\nfunction isCustomType(data) {\n if (data?.data?.type === 'customType') {\n return true;\n }\n return false;\n}\nfunction isCustomOperation(type) {\n if (CustomOperation_1.CustomOperationNames.includes(type?.data?.typeName)) {\n return true;\n }\n return false;\n}\nfunction isModelFieldDef(data) {\n return data?.fieldType === 'model';\n}\nfunction isScalarFieldDef(data) {\n return data?.fieldType !== 'model';\n}\nfunction isRefFieldDef(data) {\n return data?.type === 'ref';\n}\nfunction isModelField(field) {\n return isModelFieldDef(field?.data);\n}\nfunction dataSourceIsRef(dataSource) {\n return (typeof dataSource !== 'string' &&\n dataSource?.data &&\n dataSource.data.type === 'ref');\n}\nfunction isScalarField(field) {\n return isScalarFieldDef(field?.data);\n}\nfunction isRefField(field) {\n return isRefFieldDef(field?.data);\n}\nfunction scalarFieldToGql(fieldDef, identifier, secondaryIndexes = []) {\n const { fieldType, required, array, arrayRequired, default: _default, } = fieldDef;\n let field = fieldType;\n if (identifier !== undefined) {\n field += '!';\n if (identifier.length > 1) {\n const [_pk, ...sk] = identifier;\n field += ` @primaryKey(sortKeyFields: [${sk\n .map((sk) => `\"${sk}\"`)\n .join(', ')}])`;\n }\n else {\n field += ' @primaryKey';\n }\n for (const index of secondaryIndexes) {\n field += ` ${index}`;\n }\n return field;\n }\n if (required === true) {\n field += '!';\n }\n if (array) {\n field = `[${field}]`;\n if (arrayRequired === true) {\n field += '!';\n }\n }\n if (_default !== undefined) {\n field += ` @default(value: \"${_default?.toString()}\")`;\n }\n for (const index of secondaryIndexes) {\n field += ` ${index}`;\n }\n return field;\n}\nfunction modelFieldToGql(fieldDef) {\n const { type, relatedModel, array, valueRequired, arrayRequired, references, } = fieldDef;\n let field = relatedModel;\n if (valueRequired === true) {\n field += '!';\n }\n if (array) {\n field = `[${field}]`;\n }\n if (arrayRequired === true) {\n field += '!';\n }\n if (references && Array.isArray(references) && references.length > 0) {\n field += ` @${type}(references: [${references.map((s) => `\"${String(s)}\"`)}])`;\n }\n else {\n field += ` @${type}`;\n }\n return field;\n}\nfunction refFieldToGql(fieldDef, secondaryIndexes = []) {\n const { link, valueRequired, array, arrayRequired } = fieldDef;\n let field = link;\n if (valueRequired === true) {\n field += '!';\n }\n if (array === true) {\n field = `[${field}]`;\n }\n if (arrayRequired === true) {\n field += '!';\n }\n for (const index of secondaryIndexes) {\n field += ` ${index}`;\n }\n return field;\n}\nfunction enumFieldToGql(enumName, secondaryIndexes = []) {\n let field = enumName;\n for (const index of secondaryIndexes) {\n field += ` ${index}`;\n }\n return field;\n}\nfunction transformFunctionHandler(handlers, functionFieldName) {\n let gqlHandlerContent = '';\n const lambdaFunctionDefinition = {};\n handlers.forEach((handler, idx) => {\n const handlerData = (0, Handler_1.getHandlerData)(handler);\n if (typeof handlerData === 'string') {\n gqlHandlerContent += `@function(name: \"${handlerData}\") `;\n }\n else if (typeof handlerData.getInstance === 'function') {\n const fnName = `Fn${capitalize(functionFieldName)}${idx === 0 ? '' : `${idx + 1}`}`;\n lambdaFunctionDefinition[fnName] = handlerData;\n gqlHandlerContent += `@function(name: \"${fnName}\") `;\n }\n else {\n throw new Error(`Invalid value specified for ${functionFieldName} handler.function(). Expected: defineFunction or string.`);\n }\n });\n return { gqlHandlerContent, lambdaFunctionDefinition };\n}\nfunction customOperationToGql(typeName, typeDef, authorization, isCustom = false, databaseType, getRefType) {\n const { arguments: fieldArgs, typeName: opType, returnType, handlers, subscriptionSource, } = typeDef.data;\n let callSignature = typeName;\n const implicitTypes = [];\n // When Custom Operations are defined with a Custom Type return type,\n // the Custom Type inherits the operation's auth rules\n let customTypeAuthRules = undefined;\n const { authString } = isCustom\n ? mapToNativeAppSyncAuthDirectives(authorization, true)\n : calculateAuth(authorization);\n /**\n *\n * @param returnType The return type from the `data` field of a customer operation.\n * @param refererTypeName The type the refers {@link returnType} by `a.ref()`.\n * @param shouldAddCustomTypeToImplicitTypes A flag indicates wether it should push\n * the return type resolved CustomType to the `implicitTypes` list.\n * @returns\n */\n const resolveReturnTypeNameFromReturnType = (returnType, { refererTypeName, shouldAddCustomTypeToImplicitTypes = true, }) => {\n if (isRefField(returnType)) {\n const { type } = getRefType(returnType.data.link, typeName);\n if (type === 'CustomType') {\n customTypeAuthRules = {\n typeName: returnType.data.link,\n authRules: authorization,\n };\n }\n return refFieldToGql(returnType?.data);\n }\n else if (isCustomType(returnType)) {\n const returnTypeName = `${capitalize(refererTypeName)}ReturnType`;\n if (shouldAddCustomTypeToImplicitTypes) {\n customTypeAuthRules = {\n typeName: returnTypeName,\n authRules: authorization,\n };\n implicitTypes.push([returnTypeName, returnType]);\n }\n return returnTypeName;\n }\n else if (isEnumType(returnType)) {\n const returnTypeName = `${capitalize(refererTypeName)}ReturnType`;\n implicitTypes.push([returnTypeName, returnType]);\n return returnTypeName;\n }\n else if (isScalarField(returnType)) {\n return scalarFieldToGql(returnType?.data);\n }\n else {\n throw new Error(`Unrecognized return type on ${typeName}`);\n }\n };\n let returnTypeName;\n if (opType === 'Subscription' && returnType === null) {\n // up to this point, we've validated that each subscription resource resolves\n // the same return type, so it's safe to use subscriptionSource[0] here.\n const { type, def } = getRefType(subscriptionSource[0].data.link, typeName);\n if (type === 'CustomOperation') {\n returnTypeName = resolveReturnTypeNameFromReturnType(def.data.returnType, {\n refererTypeName: subscriptionSource[0].data.link,\n shouldAddCustomTypeToImplicitTypes: false,\n });\n }\n else {\n returnTypeName = refFieldToGql(subscriptionSource[0].data);\n }\n }\n else {\n returnTypeName = resolveReturnTypeNameFromReturnType(returnType, {\n refererTypeName: typeName,\n });\n }\n if (Object.keys(fieldArgs).length > 0) {\n const { gqlFields, implicitTypes } = processFields(typeName, fieldArgs, {}, {});\n callSignature += `(${gqlFields.join(', ')})`;\n implicitTypes.push(...implicitTypes);\n }\n const handler = handlers && handlers[0];\n const brand = handler && (0, util_1.getBrand)(handler);\n let gqlHandlerContent = '';\n let lambdaFunctionDefinition = {};\n let customSqlDataSourceStrategy;\n if (isFunctionHandler(handlers)) {\n ({ gqlHandlerContent, lambdaFunctionDefinition } = transformFunctionHandler(handlers, typeName));\n }\n else if (databaseType === 'sql' && handler && brand === 'inlineSql') {\n gqlHandlerContent = `@sql(statement: ${escapeGraphQlString(String((0, Handler_1.getHandlerData)(handler)))}) `;\n customSqlDataSourceStrategy = {\n typeName: opType,\n fieldName: typeName,\n };\n }\n else if (isSqlReferenceHandler(handlers)) {\n const handlerData = (0, Handler_1.getHandlerData)(handlers[0]);\n const entry = resolveEntryPath(handlerData, 'Could not determine import path to construct absolute code path for sql reference handler. Consider using an absolute path instead.');\n const reference = typeof entry === 'string' ? entry : entry.relativePath;\n customSqlDataSourceStrategy = {\n typeName: opType,\n fieldName: typeName,\n entry,\n };\n gqlHandlerContent = `@sql(reference: \"${reference}\") `;\n }\n if (opType === 'Subscription') {\n const subscriptionSources = subscriptionSource\n .flatMap((source) => {\n const refTarget = source.data.link;\n const { type } = getRefType(refTarget, typeName);\n if (type === 'CustomOperation') {\n return refTarget;\n }\n if (type === 'Model') {\n return source.data.mutationOperations.map(\n // capitalize explicitly in case customer used lowercase model name\n (op) => `${op}${capitalize(refTarget)}`);\n }\n })\n .join('\", \"');\n gqlHandlerContent += `@aws_subscribe(mutations: [\"${subscriptionSources}\"]) `;\n }\n const gqlField = `${callSignature}: ${returnTypeName} ${gqlHandlerContent}${authString}`;\n return {\n gqlField,\n implicitTypes: implicitTypes,\n customTypeAuthRules,\n lambdaFunctionDefinition,\n customSqlDataSourceStrategy,\n };\n}\n/**\n * Escape a string that will be used inside of a graphql string.\n * @param str The input string to be escaped\n * @returns The string with special charactars escaped\n */\nfunction escapeGraphQlString(str) {\n return JSON.stringify(str);\n}\n/**\n * Tests whether two ModelField definitions are in conflict.\n *\n * This is a shallow check intended to catch conflicts between defined fields\n * and fields implied by authorization rules. Hence, it only compares type\n * and plurality.\n *\n * @param left\n * @param right\n * @returns\n */\nfunction areConflicting(left, right) {\n // These are the only props we care about for this comparison, because the others\n // (required, arrayRequired, etc) are not specified on auth or FK directives.\n const relevantProps = ['array', 'fieldType'];\n for (const prop of relevantProps) {\n if (left.data[prop] !== right.data[prop]) {\n return true;\n }\n }\n return false;\n}\n/**\n * Merges one field defition object onto an existing one, performing\n * validation (conflict detection) along the way.\n *\n * @param existing An existing field map\n * @param additions A field map to merge in\n */\nfunction addFields(existing, additions) {\n for (const [k, addition] of Object.entries(additions)) {\n if (!existing[k]) {\n existing[k] = addition;\n }\n else if (areConflicting(existing[k], addition)) {\n throw new Error(`Field ${k} defined twice with conflicting definitions.`);\n }\n else {\n // fields are defined on both sides, but match.\n }\n }\n}\n/**\n * Validate that no implicit fields are used by the model definition\n *\n * @param existing An existing field map\n * @param implicitFields A field map inferred from other schema usage\n *\n * @throws An error when an undefined field is used or when a field is used in a way that conflicts with its generated definition\n */\nfunction validateStaticFields(existing, implicitFields) {\n if (implicitFields === undefined) {\n return;\n }\n for (const [k, field] of Object.entries(implicitFields)) {\n if (!existing[k]) {\n throw new Error(`Field ${k} isn't defined.`);\n }\n else if (areConflicting(existing[k], field)) {\n throw new Error(`Field ${k} defined twice with conflicting definitions.`);\n }\n }\n}\n/**\n * Validate that no implicit fields conflict with explicitly defined fields.\n *\n * @param existing An existing field map\n * @param implicitFields A field map inferred from other schema usage\n *\n * @throws An error when an undefined field is used or when a field is used in a way that conflicts with its generated definition\n */\nfunction validateImpliedFields(existing, implicitFields) {\n if (implicitFields === undefined) {\n return;\n }\n for (const [k, field] of Object.entries(implicitFields)) {\n if (existing[k] && areConflicting(existing[k], field)) {\n throw new Error(`Implicit field ${k} conflicts with the explicit field definition.`);\n }\n }\n}\nfunction validateRefUseCases(referrerName, referrerType, fields, getRefType) {\n const check = (fieldName, refLink, targetType) => {\n const { def } = getRefType(refLink, referrerName);\n if (isInternalModel(def)) {\n throw new Error(`Cannot use \\`.ref()\\` to refer a model from a \\`${targetType}\\`. Field \\`${fieldName}\\` of \\`${referrerName}\\` refers to model \\`${refLink}\\``);\n }\n };\n for (const [fieldName, field] of Object.entries(fields)) {\n if (isRefField(field)) {\n check(fieldName, field.data.link, referrerType === 'customType' ? 'custom type' : 'model');\n }\n }\n}\n/**\n * Given a list of authorization rules, produces a set of the implied owner and/or\n * group fields, along with the associated graphql `@auth` string directive.\n *\n * This is intended to be called for each model and field to collect the implied\n * fields and directives from that individual \"item's\" auth rules.\n *\n * The computed directives are intended to be appended to the graphql field definition.\n *\n * The computed fields will be used to confirm no conflicts between explicit field definitions\n * and implicit auth fields.\n *\n * @param authorization A list of authorization rules.\n * @returns\n */\nfunction calculateAuth(authorization) {\n const authFields = {};\n const rules = [];\n for (const entry of authorization) {\n const rule = (0, Authorization_1.accessData)(entry);\n const ruleParts = [];\n if (rule.strategy) {\n ruleParts.push([`allow: ${rule.strategy}`]);\n }\n else {\n return {\n authFields,\n authString: '',\n };\n }\n if (rule.provider) {\n // identityPool maps to iam in the transform\n const provider = rule.provider === 'identityPool' ? 'iam' : rule.provider;\n ruleParts.push(`provider: ${provider}`);\n }\n if (rule.operations) {\n ruleParts.push(`operations: [${rule.operations.join(', ')}]`);\n }\n if (rule.groupOrOwnerField) {\n // directive attribute, depending whether it's owner or group auth\n if (rule.strategy === 'groups') {\n // does this need to be escaped?\n ruleParts.push(`groupsField: \"${rule.groupOrOwnerField}\"`);\n }\n else {\n // does this need to be escaped?\n ruleParts.push(`ownerField: \"${rule.groupOrOwnerField}\"`);\n }\n // model field dep, type of which depends on whether multiple owner/group\n // is required.\n if (rule.multiOwner) {\n addFields(authFields, { [rule.groupOrOwnerField]: (0, ModelField_1.string)().array() });\n }\n else {\n addFields(authFields, { [rule.groupOrOwnerField]: (0, ModelField_1.string)() });\n }\n }\n if (rule.groups) {\n // does `group` need to be escaped?\n ruleParts.push(`groups: [${rule.groups.map((group) => `\"${group}\"`).join(', ')}]`);\n }\n // identityClaim\n if (rule.identityClaim) {\n // does this need to be escaped?\n ruleParts.push(`identityClaim: \"${rule.identityClaim}\"`);\n }\n // groupClaim\n if (rule.groupClaim) {\n // does this need to be escaped?\n ruleParts.push(`groupClaim: \"${rule.groupClaim}\"`);\n }\n rules.push(`{${ruleParts.join(', ')}}`);\n }\n const authString = rules.length > 0 ? `@auth(rules: [${rules.join(',\\n ')}])` : '';\n return { authString, authFields };\n}\nfunction validateCustomHandlerAuthRule(rule) {\n if (rule.groups && rule.provider === 'oidc') {\n throw new Error('OIDC group auth is not supported with a.handler.custom');\n }\n // not currently supported with handler.custom (JS Resolvers), but will be in the future\n if (rule.provider === 'identityPool' || rule.provider === 'iam') {\n throw new Error(\"identityPool-based auth (allow.guest() and allow.authenticated('identityPool')) is not supported with a.handler.custom\");\n }\n}\nfunction getAppSyncAuthDirectiveFromRule(rule) {\n const strategyDict = {\n public: {\n default: '@aws_api_key',\n apiKey: '@aws_api_key',\n iam: '@aws_iam',\n identityPool: '@aws_iam',\n },\n private: {\n default: '@aws_cognito_user_pools',\n userPools: '@aws_cognito_user_pools',\n oidc: '@aws_oidc',\n iam: '@aws_iam',\n identityPool: '@aws_iam',\n },\n groups: {\n default: '@aws_cognito_user_pools',\n userPools: '@aws_cognito_user_pools',\n },\n custom: {\n default: '@aws_lambda',\n function: '@aws_lambda',\n },\n };\n const stratProviders = strategyDict[rule.strategy];\n if (stratProviders === undefined) {\n throw new Error(`Unsupported auth strategy for custom handlers: ${rule.strategy}`);\n }\n const provider = rule.provider || 'default';\n const stratProvider = stratProviders[provider];\n if (stratProvider === undefined) {\n throw new Error(`Unsupported provider for custom handlers: ${rule.provider}`);\n }\n return stratProvider;\n}\nfunction mapToNativeAppSyncAuthDirectives(authorization, isCustomHandler) {\n const rules = new Set();\n for (const entry of authorization) {\n const rule = (0, Authorization_1.accessData)(entry);\n isCustomHandler && validateCustomHandlerAuthRule(rule);\n const provider = getAppSyncAuthDirectiveFromRule(rule);\n if (rule.groups) {\n // example: (cognito_groups: [\"Bloggers\", \"Readers\"])\n rules.add(`${provider}(cognito_groups: [${rule.groups\n .map((group) => `\"${group}\"`)\n .join(', ')}])`);\n }\n else {\n rules.add(provider);\n }\n }\n const authString = [...rules].join(' ');\n return { authString };\n}\nfunction capitalize(s) {\n return `${s[0].toUpperCase()}${s.slice(1)}`;\n}\nfunction processFieldLevelAuthRules(fields, authFields) {\n const fieldLevelAuthRules = {};\n for (const [fieldName, fieldDef] of Object.entries(fields)) {\n const fieldAuth = fieldDef?.data?.authorization || [];\n const { authString, authFields: fieldAuthField } = calculateAuth(fieldAuth);\n if (authString)\n fieldLevelAuthRules[fieldName] = authString;\n if (fieldAuthField) {\n addFields(authFields, fieldAuthField);\n }\n }\n return fieldLevelAuthRules;\n}\nfunction processFields(typeName, fields, impliedFields, fieldLevelAuthRules, identifier, partitionKey, secondaryIndexes = {}) {\n const gqlFields = [];\n // stores nested, field-level type definitions (custom types and enums)\n // the need to be hoisted to top-level schema types and processed accordingly\n const implicitTypes = [];\n validateImpliedFields(fields, impliedFields);\n for (const [fieldName, fieldDef] of Object.entries(fields)) {\n const fieldAuth = fieldLevelAuthRules[fieldName]\n ? ` ${fieldLevelAuthRules[fieldName]}`\n : '';\n if (isModelField(fieldDef)) {\n gqlFields.push(`${fieldName}: ${modelFieldToGql(fieldDef.data)}${fieldAuth}`);\n }\n else if (isScalarField(fieldDef)) {\n if (fieldName === partitionKey) {\n gqlFields.push(`${fieldName}: ${scalarFieldToGql(fieldDef.data, identifier, secondaryIndexes[fieldName])}${fieldAuth}`);\n }\n else if (isRefField(fieldDef)) {\n gqlFields.push(`${fieldName}: ${refFieldToGql(fieldDef.data, secondaryIndexes[fieldName])}${fieldAuth}`);\n }\n else if (isEnumType(fieldDef)) {\n // The inline enum type name should be `<TypeName><FieldName>` to avoid\n // enum type name conflicts\n const enumName = `${capitalize(typeName)}${capitalize(fieldName)}`;\n implicitTypes.push([enumName, fieldDef]);\n gqlFields.push(`${fieldName}: ${enumFieldToGql(enumName, secondaryIndexes[fieldName])}`);\n }\n else if (isCustomType(fieldDef)) {\n // The inline CustomType name should be `<TypeName><FieldName>` to avoid\n // CustomType name conflicts\n const customTypeName = `${capitalize(typeName)}${capitalize(fieldName)}`;\n implicitTypes.push([customTypeName, fieldDef]);\n gqlFields.push(`${fieldName}: ${customTypeName}`);\n }\n else {\n gqlFields.push(`${fieldName}: ${scalarFieldToGql(fieldDef.data, undefined, secondaryIndexes[fieldName])}${fieldAuth}`);\n }\n }\n else {\n throw new Error(`Unexpected field definition: ${fieldDef}`);\n }\n }\n return { gqlFields, implicitTypes };\n}\n/**\n *\n * @param pk - partition key field name\n * @param sk - (optional) array of sort key field names\n * @returns default query field name\n */\nconst secondaryIndexDefaultQueryField = (modelName, pk, sk) => {\n const skName = sk?.length ? 'And' + sk?.map(capitalize).join('And') : '';\n const queryField = `list${capitalize(modelName)}By${capitalize(pk)}${skName}`;\n return queryField;\n};\n/**\n * Given InternalModelIndexType[] returns a map where the key is the model field to be annotated with an @index directive\n * and the value is an array of transformed Amplify @index directives with all supplied attributes\n */\nconst transformedSecondaryIndexesForModel = (modelName, secondaryIndexes, modelFields, getRefType) => {\n const indexDirectiveWithAttributes = (partitionKey, sortKeys, indexName, queryField) => {\n for (const keyName of [partitionKey, ...sortKeys]) {\n const field = modelFields[keyName];\n if (isRefField(field)) {\n const { def } = getRefType(field.data.link, modelName);\n if (!isEnumType(def)) {\n throw new Error(`The ref field \\`${keyName}\\` used in the secondary index of \\`${modelName}\\` should refer to an enum type. \\`${field.data.link}\\` is not a enum type.`);\n }\n }\n }\n if (!sortKeys.length && !indexName && !queryField) {\n return `@index(queryField: \"${secondaryIndexDefaultQueryField(modelName, partitionKey)}\")`;\n }\n const attributes = [];\n if (indexName) {\n attributes.push(`name: \"${indexName}\"`);\n }\n if (sortKeys.length) {\n attributes.push(`sortKeyFields: [${sortKeys.map((sk) => `\"${sk}\"`).join(', ')}]`);\n }\n if (queryField) {\n attributes.push(`queryField: \"${queryField}\"`);\n }\n else {\n attributes.push(`queryField: \"${secondaryIndexDefaultQueryField(modelName, partitionKey, sortKeys)}\"`);\n }\n return `@index(${attributes.join(', ')})`;\n };\n return secondaryIndexes.reduce((acc, { data: { partitionKey, sortKeys, indexName, queryField } }) => {\n acc[partitionKey] = acc[partitionKey] || [];\n acc[partitionKey].push(indexDirectiveWithAttributes(partitionKey, sortKeys, indexName, queryField));\n return acc;\n }, {});\n};\nconst ruleIsResourceAuth = (authRule) => {\n const data = (0, Authorization_1.accessSchemaData)(authRule);\n return data.strategy === 'resource';\n};\n/**\n * Separates out lambda resource auth rules from remaining schema rules.\n *\n * @param authRules schema auth rules\n */\nconst extractFunctionSchemaAccess = (authRules) => {\n const schemaAuth = [];\n const functionSchemaAccess = [];\n const defaultActions = [\n 'query',\n 'mutate',\n 'listen',\n ];\n for (const rule of authRules) {\n if (ruleIsResourceAuth(rule)) {\n const ruleData = (0, Authorization_1.accessSchemaData)(rule);\n const fnAccess = {\n resourceProvider: ruleData.resource,\n actions: ruleData.operations || defaultActions,\n };\n functionSchemaAccess.push(fnAccess);\n }\n else {\n schemaAuth.push(rule);\n }\n }\n return { schemaAuth, functionSchemaAccess };\n};\n/**\n * Returns a closure for retrieving reference type and definition from schema\n */\nconst getRefTypeForSchema = (schema) => {\n const getRefType = (source, target) => {\n const typeDef = schema.data.types[source];\n if (typeDef === undefined) {\n throw new Error(`Invalid ref. ${target} is referencing ${source} which is not defined in the schema`);\n }\n if (isInternalModel(typeDef)) {\n return { type: 'Model', def: typeDef };\n }\n if (isCustomOperation(typeDef)) {\n return { type: 'CustomOperation', def: typeDef };\n }\n if (isCustomType(typeDef)) {\n return { type: 'CustomType', def: typeDef };\n }\n if (isEnumType(typeDef)) {\n return { type: 'Enum', def: typeDef };\n }\n throw new Error(`Invalid ref. ${target} is referencing ${source} which is neither a Model, Custom Operation, Custom Type, or Enum`);\n };\n return getRefType;\n};\n/**\n * Sorts top-level schema types to where Custom Types are processed last\n * This allows us to accrue and then apply inherited auth rules for custom types from custom operations\n * that reference them in their return values\n */\nconst sortTopLevelTypes = (topLevelTypes) => {\n return topLevelTypes.sort(([_typeNameA, typeDefA], [_typeNameB, typeDefB]) => {\n if ((isCustomType(typeDefA) && isCustomType(typeDefB)) ||\n (!isCustomType(typeDefA) && !isCustomType(typeDefB))) {\n return 0;\n }\n else if (isCustomType(typeDefA) && !isCustomType(typeDefB)) {\n return 1;\n }\n else {\n return -1;\n }\n });\n};\n/**\n * Builds up dictionary of Custom Type name - array of inherited auth rules\n */\nconst mergeCustomTypeAuthRules = (existing, added) => {\n if (!added)\n return;\n const { typeName, authRules } = added;\n if (typeName in existing) {\n existing[typeName] = [...existing[typeName], ...authRules];\n }\n else {\n existing[typeName] = authRules;\n }\n};\nconst schemaPreprocessor = (schema) => {\n const gqlModels = [];\n const customQueries = [];\n const customMutations = [];\n const customSubscriptions = [];\n // Dict of auth rules to be applied to custom types\n // Inherited from the auth configured on the custom operations that return these custom types\n const customTypeInheritedAuthRules = {};\n const jsFunctions = [];\n const lambdaFunctions = {};\n const customSqlDataSourceStrategies = [];\n const databaseType = schema.data.configuration.database.engine === 'dynamodb'\n ? 'dynamodb'\n : 'sql';\n const staticSchema = schema.data.configuration.database.engine === 'dynamodb' ? false : true;\n const topLevelTypes = sortTopLevelTypes(Object.entries(schema.data.types));\n const { schemaAuth, functionSchemaAccess } = extractFunctionSchemaAccess(schema.data.authorization);\n const getRefType = getRefTypeForSchema(schema);\n for (const [typeName, typeDef] of topLevelTypes) {\n const mostRelevantAuthRules = typeDef.data?.authorization?.length > 0\n ? typeDef.data.authorization\n : schemaAuth;\n if (!isInternalModel(typeDef)) {\n if (isEnumType(typeDef)) {\n if (typeDef.values.some((value) => /\\s/.test(value))) {\n throw new Error(`Values of the enum type ${typeName} should not contain any whitespace.`);\n }\n const enumType = `enum ${typeName} {\\n ${typeDef.values.join('\\n ')}\\n}`;\n gqlModels.push(enumType);\n }\n else if (isCustomType(typeDef)) {\n const fields = typeDef.data.fields;\n validateRefUseCases(typeName, 'customType', fields, getRefType);\n const fieldAuthApplicableFields = Object.fromEntries(Object.entries(fields).filter((pair) => isModelField(pair[1])));\n let customAuth = '';\n if (typeName in customTypeInheritedAuthRules) {\n const { authString } = mapToNativeAppSyncAuthDirectives(customTypeInheritedAuthRules[typeName], false);\n customAuth = authString;\n }\n const authFields = {};\n const fieldLevelAuthRules = processFieldLevelAuthRules(fieldAuthApplicableFields, authFields);\n const { gqlFields, implicitTypes } = processFields(typeName, fields, authFields, fieldLevelAuthRules);\n topLevelTypes.push(...implicitTypes);\n const joined = gqlFields.join('\\n ');\n const model = `type ${typeName} ${customAuth}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n else if (isCustomOperation(typeDef)) {\n const { typeName: opType } = typeDef.data;\n const { gqlField, implicitTypes, customTypeAuthRules, jsFunctionForField, lambdaFunctionDefinition, customSqlDataSourceStrategy, } = transformCustomOperations(typeDef, typeName, mostRelevantAuthRules, databaseType, getRefType);\n mergeCustomTypeAuthRules(customTypeInheritedAuthRules, customTypeAuthRules);\n Object.assign(lambdaFunctions, lambdaFunctionDefinition);\n topLevelTypes.push(...implicitTypes);\n if (jsFunctionForField) {\n jsFunctions.push(jsFunctionForField);\n }\n if (customSqlDataSourceStrategy) {\n customSqlDataSourceStrategies.push(customSqlDataSourceStrategy);\n }\n switch (opType) {\n case 'Query':\n customQueries.push(gqlField);\n break;\n case 'Mutation':\n customMutations.push(gqlField);\n break;\n case 'Subscription':\n customSubscriptions.push(gqlField);\n break;\n default:\n break;\n }\n }\n }\n else if (staticSchema) {\n const fields = { ...typeDef.data.fields };\n validateRefUseCases(typeName, 'model', fields, getRefType);\n const identifier = typeDef.data.identifier;\n const [partitionKey] = identifier;\n const { authString, authFields } = calculateAuth(mostRelevantAuthRules);\n if (authString == '') {\n throw new Error(`Model \\`${typeName}\\` is missing authorization rules. Add global rules to the schema or ensure every model has its own rules.`);\n }\n const fieldLevelAuthRules = processFieldLevelAuthRules(fields, authFields);\n validateStaticFields(fields, authFields);\n const { gqlFields, implicitTypes } = processFields(typeName, fields, authFields, fieldLevelAuthRules, identifier, partitionKey);\n topLevelTypes.push(...implicitTypes);\n const joined = gqlFields.join('\\n ');\n const refersToString = typeDef.data.originalName ? ` @refersTo(name: \"${typeDef.data.originalName}\")` : '';\n // TODO: update @model(timestamps: null) once a longer term solution gets\n // determined.\n //\n // Context: SQL schema should not be automatically inserted with timestamp fields,\n // passing (timestamps: null) to @model to suppress this behavior as a short\n // term solution.\n const model = `type ${typeName} @model(timestamps: null) ${authString}${refersToString}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n else {\n const fields = typeDef.data.fields;\n validateRefUseCases(typeName, 'model', fields, getRefType);\n const identifier = typeDef.data.identifier;\n const [partitionKey] = identifier;\n const transformedSecondaryIndexes = transformedSecondaryIndexesForModel(typeName, typeDef.data.secondaryIndexes, fields, getRefType);\n const { authString, authFields } = calculateAuth(mostRelevantAuthRules);\n if (authString == '') {\n throw new Error(`Model \\`${typeName}\\` is missing authorization rules. Add global rules to the schema or ensure every model has its own rules.`);\n }\n const fieldLevelAuthRules = processFieldLevelAuthRules(fields, authFields);\n const { gqlFields, implicitTypes } = processFields(typeName, fields, authFields, fieldLevelAuthRules, identifier, partitionKey, transformedSecondaryIndexes);\n topLevelTypes.push(...implicitTypes);\n const joined = gqlFields.join('\\n ');\n const model = `type ${typeName} @model ${authString}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n }\n const customOperations = {\n queries: customQueries,\n mutations: customMutations,\n subscriptions: customSubscriptions,\n };\n gqlModels.push(...generateCustomOperationTypes(customOperations));\n const processedSchema = gqlModels.join('\\n\\n');\n return {\n schema: processedSchema,\n jsFunctions,\n functionSchemaAccess,\n lambdaFunctions,\n customSqlDataSourceStrategies,\n };\n};\nfunction validateCustomOperations(typeDef, typeName, authRules, getRefType) {\n const { handlers, typeName: opType, subscriptionSource } = typeDef.data;\n const handlerConfigured = handlers?.length;\n const authConfigured = authRules.length > 0;\n if ((authConfigured && !handlerConfigured) ||\n (handlerConfigured && !authConfigured)) {\n // Deploying a custom operation with auth and no handler reference OR\n // with a handler reference but no auth\n // causes the CFN stack to reach an unrecoverable state. Ideally, this should be fixed\n // in the CDK construct, but we're catching it early here as a stopgap\n throw new Error(`Custom operation ${typeName} requires both an authorization rule and a handler reference`);\n }\n // Handlers must all be of the same type\n if (handlers?.length) {\n const configuredHandlers = new Set();\n for (const handler of handlers) {\n configuredHandlers.add((0, util_1.getBrand)(handler));\n }\n if (configuredHandlers.size > 1) {\n const configuredHandlersStr = JSON.stringify(Array.from(configuredHandlers));\n throw new Error(`Field handlers must be of the same type. ${typeName} has been configured with ${configuredHandlersStr}`);\n }\n }\n if (opType !== 'Subscription' && subscriptionSource.length > 0) {\n throw new Error(`The .for() modifier function can only be used with a custom subscription. ${typeName} is not a custom subscription.`);\n }\n if (opType === 'Subscription') {\n if (subscriptionSource.length < 1) {\n throw new Error(`${typeName} is missing a mutation source. Custom subscriptions must reference a mutation source via subscription().for(a.ref('ModelOrOperationName')) `);\n }\n let expectedReturnType;\n for (const source of subscriptionSource) {\n const sourceName = source.data.link;\n const { type, def } = getRefType(sourceName, typeName);\n if (type !== 'Model' && source.data.mutationOperations.length > 0) {\n throw new Error(`Invalid subscription definition. .mutations() modifier can only be used with a Model ref. ${typeName} is referencing ${type}`);\n }\n let resolvedReturnType;\n if (type === 'Model') {\n if (source.data.mutationOperations.length === 0) {\n throw new Error(`Invalid subscription definition. .mutations() modifier must be used with a Model ref subscription source. ${typeName} is referencing ${sourceName} without specifying a mutation`);\n }\n else {\n resolvedReturnType = def;\n }\n }\n if (type === 'CustomOperation') {\n if (def.data.typeName !== 'Mutation') {\n throw new Error(`Invalid subscription definition. .for() can only reference a mutation. ${typeName} is referencing ${sourceName} which is a ${def.data.typeName}`);\n }\n else {\n const returnType = def.data.returnType;\n if (isRefField(returnType)) {\n ({ def: resolvedReturnType } = getRefType(returnType.data.link, typeName));\n }\n else {\n resolvedReturnType = returnType;\n }\n }\n }\n expectedReturnType = expectedReturnType ?? resolvedReturnType;\n // As the return types are resolved from the root `schema` object and they should\n // not be mutated, we compare by references here.\n if (expectedReturnType !== resolvedReturnType) {\n throw new Error(`Invalid subscription definition. .for() can only reference resources that have the same return type. ${typeName} is referencing resources that have different return types.`);\n }\n }\n }\n}\nconst isSqlReferenceHandler = (handler) => {\n return Array.isArray(handler) && (0, util_1.getBrand)(handler[0]) === 'sqlReference';\n};\nconst isCustomHandler = (handler) => {\n return Array.isArray(handler) && (0, util_1.getBrand)(handler[0]) === 'customHandler';\n};\nconst isFunctionHandler = (handler) => {\n return Array.isArray(handler) && (0, util_1.getBrand)(handler[0]) === 'functionHandler';\n};\nconst normalizeDataSourceName = (dataSource) => {\n // default data source\n const noneDataSourceName = 'NONE_DS';\n if (dataSource === undefined) {\n return noneDataSourceName;\n }\n if (dataSourceIsRef(dataSource)) {\n return `${dataSource.data.link}Table`;\n }\n return dataSource;\n};\nconst sanitizeStackTrace = (stackTrace) => {\n // normalize EOL to \\n so that parsing is consistent across platforms\n const normalizedStackTrace = stackTrace.replace(new RegExp(os.EOL), '\\n');\n return (normalizedStackTrace\n .split('\\n')\n .map((line) => line.trim())\n // filters out noise not relevant to the stack trace. All stack trace lines begin with 'at'\n .filter((line) => line.startsWith('at')) || []);\n};\n// copied from the defineFunction path resolution impl:\n// https://github.com/aws-amplify/amplify-backend/blob/main/packages/backend-function/src/get_caller_directory.ts\nconst resolveEntryPath = (data, errorMessage) => {\n if (path.isAbsolute(data.entry)) {\n return data.entry;\n }\n if (!data.stack) {\n throw new Error(errorMessage);\n }\n const stackTraceLines = sanitizeStackTrace(data.stack);\n if (stackTraceLines.length < 2) {\n throw new Error(errorMessage);\n }\n const stackTraceImportLine = stackTraceLines[1]; // the first entry is the file where the error was initialized (our code). The second entry is where the customer called our code which is what we are interested in\n // if entry is relative, compute with respect to the caller directory\n return { relativePath: data.entry, importLine: stackTraceImportLine };\n};\nconst handleCustom = (handlers, opType, typeName) => {\n const transformedHandlers = handlers.map((handler) => {\n const handlerData = (0, Handler_1.getHandlerData)(handler);\n return {\n dataSource: normalizeDataSourceName(handlerData.dataSource),\n entry: resolveEntryPath(handlerData, 'Could not determine import path to construct absolute code path for custom handler. Consider using an absolute path instead.'),\n };\n });\n const jsFn = {\n typeName: opType,\n fieldName: typeName,\n handlers: transformedHandlers,\n };\n return jsFn;\n};\nfunction transformCustomOperations(typeDef, typeName, authRules, databaseType, getRefType) {\n const { typeName: opType, handlers } = typeDef.data;\n let jsFunctionForField = undefined;\n validateCustomOperations(typeDef, typeName, authRules, getRefType);\n if (isCustomHandler(handlers)) {\n jsFunctionForField = handleCustom(handlers, opType, typeName);\n }\n const isCustom = Boolean(jsFunctionForField);\n const { gqlField, implicitTypes, customTypeAuthRules, lambdaFunctionDefinition, customSqlDataSourceStrategy, } = customOperationToGql(typeName, typeDef, authRules, isCustom, databaseType, getRefType);\n return {\n gqlField,\n implicitTypes,\n customTypeAuthRules,\n jsFunctionForField,\n lambdaFunctionDefinition,\n customSqlDataSourceStrategy,\n };\n}\nfunction generateCustomOperationTypes({ queries, mutations, subscriptions, }) {\n const types = [];\n if (mutations.length > 0) {\n types.push(`type Mutation {\\n ${mutations.join('\\n ')}\\n}`);\n }\n if (queries.length > 0) {\n types.push(`type Query {\\n ${queries.join('\\n ')}\\n}`);\n }\n if (subscriptions.length > 0) {\n types.push(`type Subscription {\\n ${subscriptions.join('\\n ')}\\n}`);\n }\n return types;\n}\n/**\n * Returns API definition from ModelSchema or string schema\n * @param arg - { schema }\n * @returns DerivedApiDefinition that conforms to IAmplifyGraphqlDefinition\n */\nfunction processSchema(arg) {\n const { schema, jsFunctions, functionSchemaAccess, lambdaFunctions, customSqlDataSourceStrategies, } = schemaPreprocessor(arg.schema);\n return {\n schema,\n functionSlots: [],\n jsFunctions,\n functionSchemaAccess,\n lambdaFunctions,\n customSqlDataSourceStrategies,\n };\n}\nexports.processSchema = processSchema;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,E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AC,gBAAgB,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACjE,KAAK;AACL,IAAI,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;AAClC,QAAQ,KAAK,CAAC,IAAI,CAAC,CAAC,uBAAuB,EAAE,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9E,KAAK;AACL,IAAI,OAAO,KAAK,CAAC;AACjB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,GAAG,EAAE;AAC5B,IAAI,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,oBAAoB,EAAE,eAAe,EAAE,6BAA6B,GAAG,GAAG,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC1I,IAAI,OAAO;AACX,QAAQ,MAAM;AACd,QAAQ,aAAa,EAAE,EAAE;AACzB,QAAQ,WAAW;AACnB,QAAQ,oBAAoB;AAC5B,QAAQ,eAAe;AACvB,QAAQ,6BAA6B;AACrC,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
1
+ {"version":3,"file":"SchemaProcessor.js","sources":["../../src/SchemaProcessor.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.processSchema = void 0;\nconst tslib_1 = require(\"tslib\");\nconst ModelField_1 = require(\"./ModelField\");\nconst Authorization_1 = require(\"./Authorization\");\nconst CustomOperation_1 = require(\"./CustomOperation\");\nconst util_1 = require(\"./util\");\nconst Handler_1 = require(\"./Handler\");\nconst os = tslib_1.__importStar(require(\"os\"));\nconst path = tslib_1.__importStar(require(\"path\"));\nfunction isInternalModel(model) {\n if (model.data &&\n !isCustomType(model) &&\n !isCustomOperation(model)) {\n return true;\n }\n return false;\n}\nfunction isEnumType(data) {\n if (data?.type === 'enum') {\n return true;\n }\n return false;\n}\nfunction isCustomType(data) {\n if (data?.data?.type === 'customType') {\n return true;\n }\n return false;\n}\nfunction isCustomOperation(type) {\n if (CustomOperation_1.CustomOperationNames.includes(type?.data?.typeName)) {\n return true;\n }\n return false;\n}\nfunction isModelFieldDef(data) {\n return data?.fieldType === 'model';\n}\nfunction isScalarFieldDef(data) {\n return data?.fieldType !== 'model';\n}\nfunction isRefFieldDef(data) {\n return data?.type === 'ref';\n}\nfunction isModelField(field) {\n return isModelFieldDef(field?.data);\n}\nfunction dataSourceIsRef(dataSource) {\n return (typeof dataSource !== 'string' &&\n dataSource?.data &&\n dataSource.data.type === 'ref');\n}\nfunction isScalarField(field) {\n return isScalarFieldDef(field?.data);\n}\nfunction isRefField(field) {\n return isRefFieldDef(field?.data);\n}\nfunction scalarFieldToGql(fieldDef, identifier, secondaryIndexes = []) {\n const { fieldType, required, array, arrayRequired, default: _default, } = fieldDef;\n let field = fieldType;\n if (identifier !== undefined) {\n field += '!';\n if (identifier.length > 1) {\n const [_pk, ...sk] = identifier;\n field += ` @primaryKey(sortKeyFields: [${sk\n .map((sk) => `\"${sk}\"`)\n .join(', ')}])`;\n }\n else {\n field += ' @primaryKey';\n }\n for (const index of secondaryIndexes) {\n field += ` ${index}`;\n }\n return field;\n }\n if (required === true) {\n field += '!';\n }\n if (array) {\n field = `[${field}]`;\n if (arrayRequired === true) {\n field += '!';\n }\n }\n if (_default !== undefined) {\n field += ` @default(value: \"${_default?.toString()}\")`;\n }\n for (const index of secondaryIndexes) {\n field += ` ${index}`;\n }\n return field;\n}\nfunction modelFieldToGql(fieldDef) {\n const { type, relatedModel, array, valueRequired, arrayRequired, references, } = fieldDef;\n let field = relatedModel;\n if (valueRequired === true) {\n field += '!';\n }\n if (array) {\n field = `[${field}]`;\n }\n if (arrayRequired === true) {\n field += '!';\n }\n if (references && Array.isArray(references) && references.length > 0) {\n field += ` @${type}(references: [${references.map((s) => `\"${String(s)}\"`)}])`;\n }\n else {\n field += ` @${type}`;\n }\n return field;\n}\nfunction refFieldToGql(fieldDef, secondaryIndexes = []) {\n const { link, valueRequired, array, arrayRequired } = fieldDef;\n let field = link;\n if (valueRequired === true) {\n field += '!';\n }\n if (array === true) {\n field = `[${field}]`;\n }\n if (arrayRequired === true) {\n field += '!';\n }\n for (const index of secondaryIndexes) {\n field += ` ${index}`;\n }\n return field;\n}\nfunction enumFieldToGql(enumName, secondaryIndexes = []) {\n let field = enumName;\n for (const index of secondaryIndexes) {\n field += ` ${index}`;\n }\n return field;\n}\nfunction transformFunctionHandler(handlers, functionFieldName) {\n let gqlHandlerContent = '';\n const lambdaFunctionDefinition = {};\n handlers.forEach((handler, idx) => {\n const handlerData = (0, Handler_1.getHandlerData)(handler);\n if (typeof handlerData === 'string') {\n gqlHandlerContent += `@function(name: \"${handlerData}\") `;\n }\n else if (typeof handlerData.getInstance === 'function') {\n const fnName = `Fn${capitalize(functionFieldName)}${idx === 0 ? '' : `${idx + 1}`}`;\n lambdaFunctionDefinition[fnName] = handlerData;\n gqlHandlerContent += `@function(name: \"${fnName}\") `;\n }\n else {\n throw new Error(`Invalid value specified for ${functionFieldName} handler.function(). Expected: defineFunction or string.`);\n }\n });\n return { gqlHandlerContent, lambdaFunctionDefinition };\n}\nfunction customOperationToGql(typeName, typeDef, authorization, isCustom = false, databaseType, getRefType) {\n const { arguments: fieldArgs, typeName: opType, returnType, handlers, subscriptionSource, } = typeDef.data;\n let callSignature = typeName;\n const implicitTypes = [];\n // When Custom Operations are defined with a Custom Type return type,\n // the Custom Type inherits the operation's auth rules\n let customTypeAuthRules = undefined;\n const { authString } = isCustom\n ? mapToNativeAppSyncAuthDirectives(authorization, true)\n : calculateAuth(authorization);\n /**\n *\n * @param returnType The return type from the `data` field of a customer operation.\n * @param refererTypeName The type the refers {@link returnType} by `a.ref()`.\n * @param shouldAddCustomTypeToImplicitTypes A flag indicates wether it should push\n * the return type resolved CustomType to the `implicitTypes` list.\n * @returns\n */\n const resolveReturnTypeNameFromReturnType = (returnType, { refererTypeName, shouldAddCustomTypeToImplicitTypes = true, }) => {\n if (isRefField(returnType)) {\n const { type } = getRefType(returnType.data.link, typeName);\n if (type === 'CustomType') {\n customTypeAuthRules = {\n typeName: returnType.data.link,\n authRules: authorization,\n };\n }\n return refFieldToGql(returnType?.data);\n }\n else if (isCustomType(returnType)) {\n const returnTypeName = `${capitalize(refererTypeName)}ReturnType`;\n if (shouldAddCustomTypeToImplicitTypes) {\n customTypeAuthRules = {\n typeName: returnTypeName,\n authRules: authorization,\n };\n implicitTypes.push([returnTypeName, returnType]);\n }\n return returnTypeName;\n }\n else if (isEnumType(returnType)) {\n const returnTypeName = `${capitalize(refererTypeName)}ReturnType`;\n implicitTypes.push([returnTypeName, returnType]);\n return returnTypeName;\n }\n else if (isScalarField(returnType)) {\n return scalarFieldToGql(returnType?.data);\n }\n else {\n throw new Error(`Unrecognized return type on ${typeName}`);\n }\n };\n let returnTypeName;\n if (opType === 'Subscription' && returnType === null) {\n // up to this point, we've validated that each subscription resource resolves\n // the same return type, so it's safe to use subscriptionSource[0] here.\n const { type, def } = getRefType(subscriptionSource[0].data.link, typeName);\n if (type === 'CustomOperation') {\n returnTypeName = resolveReturnTypeNameFromReturnType(def.data.returnType, {\n refererTypeName: subscriptionSource[0].data.link,\n shouldAddCustomTypeToImplicitTypes: false,\n });\n }\n else {\n returnTypeName = refFieldToGql(subscriptionSource[0].data);\n }\n }\n else {\n returnTypeName = resolveReturnTypeNameFromReturnType(returnType, {\n refererTypeName: typeName,\n });\n }\n if (Object.keys(fieldArgs).length > 0) {\n const { gqlFields, implicitTypes } = processFields(typeName, fieldArgs, {}, {});\n callSignature += `(${gqlFields.join(', ')})`;\n implicitTypes.push(...implicitTypes);\n }\n const handler = handlers && handlers[0];\n const brand = handler && (0, util_1.getBrand)(handler);\n let gqlHandlerContent = '';\n let lambdaFunctionDefinition = {};\n let customSqlDataSourceStrategy;\n if (isFunctionHandler(handlers)) {\n ({ gqlHandlerContent, lambdaFunctionDefinition } = transformFunctionHandler(handlers, typeName));\n }\n else if (databaseType === 'sql' && handler && brand === 'inlineSql') {\n gqlHandlerContent = `@sql(statement: ${escapeGraphQlString(String((0, Handler_1.getHandlerData)(handler)))}) `;\n customSqlDataSourceStrategy = {\n typeName: opType,\n fieldName: typeName,\n };\n }\n else if (isSqlReferenceHandler(handlers)) {\n const handlerData = (0, Handler_1.getHandlerData)(handlers[0]);\n const entry = resolveEntryPath(handlerData, 'Could not determine import path to construct absolute code path for sql reference handler. Consider using an absolute path instead.');\n const reference = typeof entry === 'string' ? entry : entry.relativePath;\n customSqlDataSourceStrategy = {\n typeName: opType,\n fieldName: typeName,\n entry,\n };\n gqlHandlerContent = `@sql(reference: \"${reference}\") `;\n }\n if (opType === 'Subscription') {\n const subscriptionSources = subscriptionSource\n .flatMap((source) => {\n const refTarget = source.data.link;\n const { type } = getRefType(refTarget, typeName);\n if (type === 'CustomOperation') {\n return refTarget;\n }\n if (type === 'Model') {\n return source.data.mutationOperations.map(\n // capitalize explicitly in case customer used lowercase model name\n (op) => `${op}${capitalize(refTarget)}`);\n }\n })\n .join('\", \"');\n gqlHandlerContent += `@aws_subscribe(mutations: [\"${subscriptionSources}\"]) `;\n }\n const gqlField = `${callSignature}: ${returnTypeName} ${gqlHandlerContent}${authString}`;\n return {\n gqlField,\n implicitTypes: implicitTypes,\n customTypeAuthRules,\n lambdaFunctionDefinition,\n customSqlDataSourceStrategy,\n };\n}\n/**\n * Escape a string that will be used inside of a graphql string.\n * @param str The input string to be escaped\n * @returns The string with special charactars escaped\n */\nfunction escapeGraphQlString(str) {\n return JSON.stringify(str);\n}\n/**\n * Tests whether two ModelField definitions are in conflict.\n *\n * This is a shallow check intended to catch conflicts between defined fields\n * and fields implied by authorization rules. Hence, it only compares type\n * and plurality.\n *\n * @param left\n * @param right\n * @returns\n */\nfunction areConflicting(left, right) {\n // These are the only props we care about for this comparison, because the others\n // (required, arrayRequired, etc) are not specified on auth or FK directives.\n const relevantProps = ['array', 'fieldType'];\n for (const prop of relevantProps) {\n if (left.data[prop] !== right.data[prop]) {\n return true;\n }\n }\n return false;\n}\n/**\n * Merges one field defition object onto an existing one, performing\n * validation (conflict detection) along the way.\n *\n * @param existing An existing field map\n * @param additions A field map to merge in\n */\nfunction addFields(existing, additions) {\n for (const [k, addition] of Object.entries(additions)) {\n if (!existing[k]) {\n existing[k] = addition;\n }\n else if (areConflicting(existing[k], addition)) {\n throw new Error(`Field ${k} defined twice with conflicting definitions.`);\n }\n else {\n // fields are defined on both sides, but match.\n }\n }\n}\n/**\n * Validate that no implicit fields are used by the model definition\n *\n * @param existing An existing field map\n * @param implicitFields A field map inferred from other schema usage\n *\n * @throws An error when an undefined field is used or when a field is used in a way that conflicts with its generated definition\n */\nfunction validateStaticFields(existing, implicitFields) {\n if (implicitFields === undefined) {\n return;\n }\n for (const [k, field] of Object.entries(implicitFields)) {\n if (!existing[k]) {\n throw new Error(`Field ${k} isn't defined.`);\n }\n else if (areConflicting(existing[k], field)) {\n throw new Error(`Field ${k} defined twice with conflicting definitions.`);\n }\n }\n}\n/**\n * Validate that no implicit fields conflict with explicitly defined fields.\n *\n * @param existing An existing field map\n * @param implicitFields A field map inferred from other schema usage\n *\n * @throws An error when an undefined field is used or when a field is used in a way that conflicts with its generated definition\n */\nfunction validateImpliedFields(existing, implicitFields) {\n if (implicitFields === undefined) {\n return;\n }\n for (const [k, field] of Object.entries(implicitFields)) {\n if (existing[k] && areConflicting(existing[k], field)) {\n throw new Error(`Implicit field ${k} conflicts with the explicit field definition.`);\n }\n }\n}\nfunction validateRefUseCases(referrerName, referrerType, fields, getRefType) {\n const check = (fieldName, refLink, targetType) => {\n const { def } = getRefType(refLink, referrerName);\n if (isInternalModel(def)) {\n throw new Error(`Cannot use \\`.ref()\\` to refer a model from a \\`${targetType}\\`. Field \\`${fieldName}\\` of \\`${referrerName}\\` refers to model \\`${refLink}\\``);\n }\n };\n for (const [fieldName, field] of Object.entries(fields)) {\n if (isRefField(field)) {\n check(fieldName, field.data.link, referrerType === 'customType' ? 'custom type' : 'model');\n }\n }\n}\n/**\n * Given a list of authorization rules, produces a set of the implied owner and/or\n * group fields, along with the associated graphql `@auth` string directive.\n *\n * This is intended to be called for each model and field to collect the implied\n * fields and directives from that individual \"item's\" auth rules.\n *\n * The computed directives are intended to be appended to the graphql field definition.\n *\n * The computed fields will be used to confirm no conflicts between explicit field definitions\n * and implicit auth fields.\n *\n * @param authorization A list of authorization rules.\n * @returns\n */\nfunction calculateAuth(authorization) {\n const authFields = {};\n const rules = [];\n for (const entry of authorization) {\n const rule = (0, Authorization_1.accessData)(entry);\n const ruleParts = [];\n if (rule.strategy) {\n ruleParts.push([`allow: ${rule.strategy}`]);\n }\n else {\n return {\n authFields,\n authString: '',\n };\n }\n if (rule.provider) {\n // identityPool maps to iam in the transform\n const provider = rule.provider === 'identityPool' ? 'iam' : rule.provider;\n ruleParts.push(`provider: ${provider}`);\n }\n if (rule.operations) {\n ruleParts.push(`operations: [${rule.operations.join(', ')}]`);\n }\n if (rule.groupOrOwnerField) {\n // directive attribute, depending whether it's owner or group auth\n if (rule.strategy === 'groups') {\n // does this need to be escaped?\n ruleParts.push(`groupsField: \"${rule.groupOrOwnerField}\"`);\n }\n else {\n // does this need to be escaped?\n ruleParts.push(`ownerField: \"${rule.groupOrOwnerField}\"`);\n }\n // model field dep, type of which depends on whether multiple owner/group\n // is required.\n if (rule.multiOwner) {\n addFields(authFields, { [rule.groupOrOwnerField]: (0, ModelField_1.string)().array() });\n }\n else {\n addFields(authFields, { [rule.groupOrOwnerField]: (0, ModelField_1.string)() });\n }\n }\n if (rule.groups) {\n // does `group` need to be escaped?\n ruleParts.push(`groups: [${rule.groups.map((group) => `\"${group}\"`).join(', ')}]`);\n }\n // identityClaim\n if (rule.identityClaim) {\n // does this need to be escaped?\n ruleParts.push(`identityClaim: \"${rule.identityClaim}\"`);\n }\n // groupClaim\n if (rule.groupClaim) {\n // does this need to be escaped?\n ruleParts.push(`groupClaim: \"${rule.groupClaim}\"`);\n }\n rules.push(`{${ruleParts.join(', ')}}`);\n }\n const authString = rules.length > 0 ? `@auth(rules: [${rules.join(',\\n ')}])` : '';\n return { authString, authFields };\n}\nfunction validateCustomHandlerAuthRule(rule) {\n if (rule.groups && rule.provider === 'oidc') {\n throw new Error('OIDC group auth is not supported with a.handler.custom');\n }\n // not currently supported with handler.custom (JS Resolvers), but will be in the future\n if (rule.provider === 'identityPool' || rule.provider === 'iam') {\n throw new Error(\"identityPool-based auth (allow.guest() and allow.authenticated('identityPool')) is not supported with a.handler.custom\");\n }\n}\nfunction getAppSyncAuthDirectiveFromRule(rule) {\n const strategyDict = {\n public: {\n default: '@aws_api_key',\n apiKey: '@aws_api_key',\n iam: '@aws_iam',\n identityPool: '@aws_iam',\n },\n private: {\n default: '@aws_cognito_user_pools',\n userPools: '@aws_cognito_user_pools',\n oidc: '@aws_oidc',\n iam: '@aws_iam',\n identityPool: '@aws_iam',\n },\n groups: {\n default: '@aws_cognito_user_pools',\n userPools: '@aws_cognito_user_pools',\n },\n custom: {\n default: '@aws_lambda',\n function: '@aws_lambda',\n },\n };\n const stratProviders = strategyDict[rule.strategy];\n if (stratProviders === undefined) {\n throw new Error(`Unsupported auth strategy for custom handlers: ${rule.strategy}`);\n }\n const provider = rule.provider || 'default';\n const stratProvider = stratProviders[provider];\n if (stratProvider === undefined) {\n throw new Error(`Unsupported provider for custom handlers: ${rule.provider}`);\n }\n return stratProvider;\n}\nfunction mapToNativeAppSyncAuthDirectives(authorization, isCustomHandler) {\n const rules = new Set();\n for (const entry of authorization) {\n const rule = (0, Authorization_1.accessData)(entry);\n isCustomHandler && validateCustomHandlerAuthRule(rule);\n const provider = getAppSyncAuthDirectiveFromRule(rule);\n if (rule.groups) {\n // example: (cognito_groups: [\"Bloggers\", \"Readers\"])\n rules.add(`${provider}(cognito_groups: [${rule.groups\n .map((group) => `\"${group}\"`)\n .join(', ')}])`);\n }\n else {\n rules.add(provider);\n }\n }\n const authString = [...rules].join(' ');\n return { authString };\n}\nfunction capitalize(s) {\n return `${s[0].toUpperCase()}${s.slice(1)}`;\n}\nfunction processFieldLevelAuthRules(fields, authFields) {\n const fieldLevelAuthRules = {};\n for (const [fieldName, fieldDef] of Object.entries(fields)) {\n const fieldAuth = fieldDef?.data?.authorization || [];\n const { authString, authFields: fieldAuthField } = calculateAuth(fieldAuth);\n if (authString)\n fieldLevelAuthRules[fieldName] = authString;\n if (fieldAuthField) {\n addFields(authFields, fieldAuthField);\n }\n }\n return fieldLevelAuthRules;\n}\nfunction processFields(typeName, fields, impliedFields, fieldLevelAuthRules, identifier, partitionKey, secondaryIndexes = {}) {\n const gqlFields = [];\n // stores nested, field-level type definitions (custom types and enums)\n // the need to be hoisted to top-level schema types and processed accordingly\n const implicitTypes = [];\n validateImpliedFields(fields, impliedFields);\n for (const [fieldName, fieldDef] of Object.entries(fields)) {\n const fieldAuth = fieldLevelAuthRules[fieldName]\n ? ` ${fieldLevelAuthRules[fieldName]}`\n : '';\n if (isModelField(fieldDef)) {\n gqlFields.push(`${fieldName}: ${modelFieldToGql(fieldDef.data)}${fieldAuth}`);\n }\n else if (isScalarField(fieldDef)) {\n if (fieldName === partitionKey) {\n gqlFields.push(`${fieldName}: ${scalarFieldToGql(fieldDef.data, identifier, secondaryIndexes[fieldName])}${fieldAuth}`);\n }\n else if (isRefField(fieldDef)) {\n gqlFields.push(`${fieldName}: ${refFieldToGql(fieldDef.data, secondaryIndexes[fieldName])}${fieldAuth}`);\n }\n else if (isEnumType(fieldDef)) {\n // The inline enum type name should be `<TypeName><FieldName>` to avoid\n // enum type name conflicts\n const enumName = `${capitalize(typeName)}${capitalize(fieldName)}`;\n implicitTypes.push([enumName, fieldDef]);\n gqlFields.push(`${fieldName}: ${enumFieldToGql(enumName, secondaryIndexes[fieldName])}`);\n }\n else if (isCustomType(fieldDef)) {\n // The inline CustomType name should be `<TypeName><FieldName>` to avoid\n // CustomType name conflicts\n const customTypeName = `${capitalize(typeName)}${capitalize(fieldName)}`;\n implicitTypes.push([customTypeName, fieldDef]);\n gqlFields.push(`${fieldName}: ${customTypeName}`);\n }\n else {\n gqlFields.push(`${fieldName}: ${scalarFieldToGql(fieldDef.data, undefined, secondaryIndexes[fieldName])}${fieldAuth}`);\n }\n }\n else {\n throw new Error(`Unexpected field definition: ${fieldDef}`);\n }\n }\n return { gqlFields, implicitTypes };\n}\n/**\n *\n * @param pk - partition key field name\n * @param sk - (optional) array of sort key field names\n * @returns default query field name\n */\nconst secondaryIndexDefaultQueryField = (modelName, pk, sk) => {\n const skName = sk?.length ? 'And' + sk?.map(capitalize).join('And') : '';\n const queryField = `list${capitalize(modelName)}By${capitalize(pk)}${skName}`;\n return queryField;\n};\n/**\n * Given InternalModelIndexType[] returns a map where the key is the model field to be annotated with an @index directive\n * and the value is an array of transformed Amplify @index directives with all supplied attributes\n */\nconst transformedSecondaryIndexesForModel = (modelName, secondaryIndexes, modelFields, getRefType) => {\n const indexDirectiveWithAttributes = (partitionKey, sortKeys, indexName, queryField) => {\n for (const keyName of [partitionKey, ...sortKeys]) {\n const field = modelFields[keyName];\n if (isRefField(field)) {\n const { def } = getRefType(field.data.link, modelName);\n if (!isEnumType(def)) {\n throw new Error(`The ref field \\`${keyName}\\` used in the secondary index of \\`${modelName}\\` should refer to an enum type. \\`${field.data.link}\\` is not a enum type.`);\n }\n }\n }\n if (!sortKeys.length && !indexName && !queryField) {\n return `@index(queryField: \"${secondaryIndexDefaultQueryField(modelName, partitionKey)}\")`;\n }\n const attributes = [];\n if (indexName) {\n attributes.push(`name: \"${indexName}\"`);\n }\n if (sortKeys.length) {\n attributes.push(`sortKeyFields: [${sortKeys.map((sk) => `\"${sk}\"`).join(', ')}]`);\n }\n if (queryField) {\n attributes.push(`queryField: \"${queryField}\"`);\n }\n else {\n attributes.push(`queryField: \"${secondaryIndexDefaultQueryField(modelName, partitionKey, sortKeys)}\"`);\n }\n return `@index(${attributes.join(', ')})`;\n };\n return secondaryIndexes.reduce((acc, { data: { partitionKey, sortKeys, indexName, queryField } }) => {\n acc[partitionKey] = acc[partitionKey] || [];\n acc[partitionKey].push(indexDirectiveWithAttributes(partitionKey, sortKeys, indexName, queryField));\n return acc;\n }, {});\n};\nconst ruleIsResourceAuth = (authRule) => {\n const data = (0, Authorization_1.accessSchemaData)(authRule);\n return data.strategy === 'resource';\n};\n/**\n * Separates out lambda resource auth rules from remaining schema rules.\n *\n * @param authRules schema auth rules\n */\nconst extractFunctionSchemaAccess = (authRules) => {\n const schemaAuth = [];\n const functionSchemaAccess = [];\n const defaultActions = [\n 'query',\n 'mutate',\n 'listen',\n ];\n for (const rule of authRules) {\n if (ruleIsResourceAuth(rule)) {\n const ruleData = (0, Authorization_1.accessSchemaData)(rule);\n const fnAccess = {\n resourceProvider: ruleData.resource,\n actions: ruleData.operations || defaultActions,\n };\n functionSchemaAccess.push(fnAccess);\n }\n else {\n schemaAuth.push(rule);\n }\n }\n return { schemaAuth, functionSchemaAccess };\n};\n/**\n * Returns a closure for retrieving reference type and definition from schema\n */\nconst getRefTypeForSchema = (schema) => {\n const getRefType = (source, target) => {\n const typeDef = schema.data.types[source];\n if (typeDef === undefined) {\n throw new Error(`Invalid ref. ${target} is referencing ${source} which is not defined in the schema`);\n }\n if (isInternalModel(typeDef)) {\n return { type: 'Model', def: typeDef };\n }\n if (isCustomOperation(typeDef)) {\n return { type: 'CustomOperation', def: typeDef };\n }\n if (isCustomType(typeDef)) {\n return { type: 'CustomType', def: typeDef };\n }\n if (isEnumType(typeDef)) {\n return { type: 'Enum', def: typeDef };\n }\n throw new Error(`Invalid ref. ${target} is referencing ${source} which is neither a Model, Custom Operation, Custom Type, or Enum`);\n };\n return getRefType;\n};\n/**\n * Sorts top-level schema types to where Custom Types are processed last\n * This allows us to accrue and then apply inherited auth rules for custom types from custom operations\n * that reference them in their return values\n */\nconst sortTopLevelTypes = (topLevelTypes) => {\n return topLevelTypes.sort(([_typeNameA, typeDefA], [_typeNameB, typeDefB]) => {\n if ((isCustomType(typeDefA) && isCustomType(typeDefB)) ||\n (!isCustomType(typeDefA) && !isCustomType(typeDefB))) {\n return 0;\n }\n else if (isCustomType(typeDefA) && !isCustomType(typeDefB)) {\n return 1;\n }\n else {\n return -1;\n }\n });\n};\n/**\n * Builds up dictionary of Custom Type name - array of inherited auth rules\n */\nconst mergeCustomTypeAuthRules = (existing, added) => {\n if (!added)\n return;\n const { typeName, authRules } = added;\n if (typeName in existing) {\n existing[typeName] = [...existing[typeName], ...authRules];\n }\n else {\n existing[typeName] = authRules;\n }\n};\nconst schemaPreprocessor = (schema) => {\n const gqlModels = [];\n const customQueries = [];\n const customMutations = [];\n const customSubscriptions = [];\n // Dict of auth rules to be applied to custom types\n // Inherited from the auth configured on the custom operations that return these custom types\n const customTypeInheritedAuthRules = {};\n const jsFunctions = [];\n const lambdaFunctions = {};\n const customSqlDataSourceStrategies = [];\n const databaseType = schema.data.configuration.database.engine === 'dynamodb'\n ? 'dynamodb'\n : 'sql';\n const staticSchema = schema.data.configuration.database.engine === 'dynamodb' ? false : true;\n const topLevelTypes = sortTopLevelTypes(Object.entries(schema.data.types));\n const { schemaAuth, functionSchemaAccess } = extractFunctionSchemaAccess(schema.data.authorization);\n const getRefType = getRefTypeForSchema(schema);\n for (const [typeName, typeDef] of topLevelTypes) {\n const mostRelevantAuthRules = typeDef.data?.authorization?.length > 0\n ? typeDef.data.authorization\n : schemaAuth;\n if (!isInternalModel(typeDef)) {\n if (isEnumType(typeDef)) {\n if (typeDef.values.some((value) => /\\s/.test(value))) {\n throw new Error(`Values of the enum type ${typeName} should not contain any whitespace.`);\n }\n const enumType = `enum ${typeName} {\\n ${typeDef.values.join('\\n ')}\\n}`;\n gqlModels.push(enumType);\n }\n else if (isCustomType(typeDef)) {\n const fields = typeDef.data.fields;\n validateRefUseCases(typeName, 'customType', fields, getRefType);\n const fieldAuthApplicableFields = Object.fromEntries(Object.entries(fields).filter((pair) => isModelField(pair[1])));\n let customAuth = '';\n if (typeName in customTypeInheritedAuthRules) {\n const { authString } = mapToNativeAppSyncAuthDirectives(customTypeInheritedAuthRules[typeName], false);\n customAuth = authString;\n }\n const authFields = {};\n const fieldLevelAuthRules = processFieldLevelAuthRules(fieldAuthApplicableFields, authFields);\n const { gqlFields, implicitTypes } = processFields(typeName, fields, authFields, fieldLevelAuthRules);\n topLevelTypes.push(...implicitTypes);\n const joined = gqlFields.join('\\n ');\n const model = `type ${typeName} ${customAuth}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n else if (isCustomOperation(typeDef)) {\n const { typeName: opType } = typeDef.data;\n const { gqlField, implicitTypes, customTypeAuthRules, jsFunctionForField, lambdaFunctionDefinition, customSqlDataSourceStrategy, } = transformCustomOperations(typeDef, typeName, mostRelevantAuthRules, databaseType, getRefType);\n mergeCustomTypeAuthRules(customTypeInheritedAuthRules, customTypeAuthRules);\n Object.assign(lambdaFunctions, lambdaFunctionDefinition);\n topLevelTypes.push(...implicitTypes);\n if (jsFunctionForField) {\n jsFunctions.push(jsFunctionForField);\n }\n if (customSqlDataSourceStrategy) {\n customSqlDataSourceStrategies.push(customSqlDataSourceStrategy);\n }\n switch (opType) {\n case 'Query':\n customQueries.push(gqlField);\n break;\n case 'Mutation':\n customMutations.push(gqlField);\n break;\n case 'Subscription':\n customSubscriptions.push(gqlField);\n break;\n default:\n break;\n }\n }\n }\n else if (staticSchema) {\n const fields = { ...typeDef.data.fields };\n validateRefUseCases(typeName, 'model', fields, getRefType);\n const identifier = typeDef.data.identifier;\n const [partitionKey] = identifier;\n const { authString, authFields } = calculateAuth(mostRelevantAuthRules);\n if (authString == '') {\n throw new Error(`Model \\`${typeName}\\` is missing authorization rules. Add global rules to the schema or ensure every model has its own rules.`);\n }\n const fieldLevelAuthRules = processFieldLevelAuthRules(fields, authFields);\n validateStaticFields(fields, authFields);\n const { gqlFields, implicitTypes } = processFields(typeName, fields, authFields, fieldLevelAuthRules, identifier, partitionKey);\n topLevelTypes.push(...implicitTypes);\n const joined = gqlFields.join('\\n ');\n const refersToString = typeDef.data.originalName\n ? ` @refersTo(name: \"${typeDef.data.originalName}\")`\n : '';\n // TODO: update @model(timestamps: null) once a longer term solution gets\n // determined.\n //\n // Context: SQL schema should not be automatically inserted with timestamp fields,\n // passing (timestamps: null) to @model to suppress this behavior as a short\n // term solution.\n const model = `type ${typeName} @model(timestamps: null) ${authString}${refersToString}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n else {\n const fields = typeDef.data.fields;\n validateRefUseCases(typeName, 'model', fields, getRefType);\n const identifier = typeDef.data.identifier;\n const [partitionKey] = identifier;\n const transformedSecondaryIndexes = transformedSecondaryIndexesForModel(typeName, typeDef.data.secondaryIndexes, fields, getRefType);\n const { authString, authFields } = calculateAuth(mostRelevantAuthRules);\n if (authString == '') {\n throw new Error(`Model \\`${typeName}\\` is missing authorization rules. Add global rules to the schema or ensure every model has its own rules.`);\n }\n const fieldLevelAuthRules = processFieldLevelAuthRules(fields, authFields);\n const { gqlFields, implicitTypes } = processFields(typeName, fields, authFields, fieldLevelAuthRules, identifier, partitionKey, transformedSecondaryIndexes);\n topLevelTypes.push(...implicitTypes);\n const joined = gqlFields.join('\\n ');\n const model = `type ${typeName} @model ${authString}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n }\n const customOperations = {\n queries: customQueries,\n mutations: customMutations,\n subscriptions: customSubscriptions,\n };\n gqlModels.push(...generateCustomOperationTypes(customOperations));\n const processedSchema = gqlModels.join('\\n\\n');\n return {\n schema: processedSchema,\n jsFunctions,\n functionSchemaAccess,\n lambdaFunctions,\n customSqlDataSourceStrategies,\n };\n};\nfunction validateCustomOperations(typeDef, typeName, authRules, getRefType) {\n const { handlers, typeName: opType, subscriptionSource } = typeDef.data;\n const handlerConfigured = handlers?.length;\n const authConfigured = authRules.length > 0;\n if ((authConfigured && !handlerConfigured) ||\n (handlerConfigured && !authConfigured)) {\n // Deploying a custom operation with auth and no handler reference OR\n // with a handler reference but no auth\n // causes the CFN stack to reach an unrecoverable state. Ideally, this should be fixed\n // in the CDK construct, but we're catching it early here as a stopgap\n throw new Error(`Custom operation ${typeName} requires both an authorization rule and a handler reference`);\n }\n // Handlers must all be of the same type\n if (handlers?.length) {\n const configuredHandlers = new Set();\n for (const handler of handlers) {\n configuredHandlers.add((0, util_1.getBrand)(handler));\n }\n if (configuredHandlers.size > 1) {\n const configuredHandlersStr = JSON.stringify(Array.from(configuredHandlers));\n throw new Error(`Field handlers must be of the same type. ${typeName} has been configured with ${configuredHandlersStr}`);\n }\n }\n if (opType !== 'Subscription' && subscriptionSource.length > 0) {\n throw new Error(`The .for() modifier function can only be used with a custom subscription. ${typeName} is not a custom subscription.`);\n }\n if (opType === 'Subscription') {\n if (subscriptionSource.length < 1) {\n throw new Error(`${typeName} is missing a mutation source. Custom subscriptions must reference a mutation source via subscription().for(a.ref('ModelOrOperationName')) `);\n }\n let expectedReturnType;\n for (const source of subscriptionSource) {\n const sourceName = source.data.link;\n const { type, def } = getRefType(sourceName, typeName);\n if (type !== 'Model' && source.data.mutationOperations.length > 0) {\n throw new Error(`Invalid subscription definition. .mutations() modifier can only be used with a Model ref. ${typeName} is referencing ${type}`);\n }\n let resolvedReturnType;\n if (type === 'Model') {\n if (source.data.mutationOperations.length === 0) {\n throw new Error(`Invalid subscription definition. .mutations() modifier must be used with a Model ref subscription source. ${typeName} is referencing ${sourceName} without specifying a mutation`);\n }\n else {\n resolvedReturnType = def;\n }\n }\n if (type === 'CustomOperation') {\n if (def.data.typeName !== 'Mutation') {\n throw new Error(`Invalid subscription definition. .for() can only reference a mutation. ${typeName} is referencing ${sourceName} which is a ${def.data.typeName}`);\n }\n else {\n const returnType = def.data.returnType;\n if (isRefField(returnType)) {\n ({ def: resolvedReturnType } = getRefType(returnType.data.link, typeName));\n }\n else {\n resolvedReturnType = returnType;\n }\n }\n }\n expectedReturnType = expectedReturnType ?? resolvedReturnType;\n // As the return types are resolved from the root `schema` object and they should\n // not be mutated, we compare by references here.\n if (expectedReturnType !== resolvedReturnType) {\n throw new Error(`Invalid subscription definition. .for() can only reference resources that have the same return type. ${typeName} is referencing resources that have different return types.`);\n }\n }\n }\n}\nconst isSqlReferenceHandler = (handler) => {\n return Array.isArray(handler) && (0, util_1.getBrand)(handler[0]) === 'sqlReference';\n};\nconst isCustomHandler = (handler) => {\n return Array.isArray(handler) && (0, util_1.getBrand)(handler[0]) === 'customHandler';\n};\nconst isFunctionHandler = (handler) => {\n return Array.isArray(handler) && (0, util_1.getBrand)(handler[0]) === 'functionHandler';\n};\nconst normalizeDataSourceName = (dataSource) => {\n // default data source\n const noneDataSourceName = 'NONE_DS';\n if (dataSource === undefined) {\n return noneDataSourceName;\n }\n if (dataSourceIsRef(dataSource)) {\n return `${dataSource.data.link}Table`;\n }\n return dataSource;\n};\nconst sanitizeStackTrace = (stackTrace) => {\n // normalize EOL to \\n so that parsing is consistent across platforms\n const normalizedStackTrace = stackTrace.replace(new RegExp(os.EOL), '\\n');\n return (normalizedStackTrace\n .split('\\n')\n .map((line) => line.trim())\n // filters out noise not relevant to the stack trace. All stack trace lines begin with 'at'\n .filter((line) => line.startsWith('at')) || []);\n};\n// copied from the defineFunction path resolution impl:\n// https://github.com/aws-amplify/amplify-backend/blob/main/packages/backend-function/src/get_caller_directory.ts\nconst resolveEntryPath = (data, errorMessage) => {\n if (path.isAbsolute(data.entry)) {\n return data.entry;\n }\n if (!data.stack) {\n throw new Error(errorMessage);\n }\n const stackTraceLines = sanitizeStackTrace(data.stack);\n if (stackTraceLines.length < 2) {\n throw new Error(errorMessage);\n }\n const stackTraceImportLine = stackTraceLines[1]; // the first entry is the file where the error was initialized (our code). The second entry is where the customer called our code which is what we are interested in\n // if entry is relative, compute with respect to the caller directory\n return { relativePath: data.entry, importLine: stackTraceImportLine };\n};\nconst handleCustom = (handlers, opType, typeName) => {\n const transformedHandlers = handlers.map((handler) => {\n const handlerData = (0, Handler_1.getHandlerData)(handler);\n return {\n dataSource: normalizeDataSourceName(handlerData.dataSource),\n entry: resolveEntryPath(handlerData, 'Could not determine import path to construct absolute code path for custom handler. Consider using an absolute path instead.'),\n };\n });\n const jsFn = {\n typeName: opType,\n fieldName: typeName,\n handlers: transformedHandlers,\n };\n return jsFn;\n};\nfunction transformCustomOperations(typeDef, typeName, authRules, databaseType, getRefType) {\n const { typeName: opType, handlers } = typeDef.data;\n let jsFunctionForField = undefined;\n validateCustomOperations(typeDef, typeName, authRules, getRefType);\n if (isCustomHandler(handlers)) {\n jsFunctionForField = handleCustom(handlers, opType, typeName);\n }\n const isCustom = Boolean(jsFunctionForField);\n const { gqlField, implicitTypes, customTypeAuthRules, lambdaFunctionDefinition, customSqlDataSourceStrategy, } = customOperationToGql(typeName, typeDef, authRules, isCustom, databaseType, getRefType);\n return {\n gqlField,\n implicitTypes,\n customTypeAuthRules,\n jsFunctionForField,\n lambdaFunctionDefinition,\n customSqlDataSourceStrategy,\n };\n}\nfunction generateCustomOperationTypes({ queries, mutations, subscriptions, }) {\n const types = [];\n if (mutations.length > 0) {\n types.push(`type Mutation {\\n ${mutations.join('\\n ')}\\n}`);\n }\n if (queries.length > 0) {\n types.push(`type Query {\\n ${queries.join('\\n ')}\\n}`);\n }\n if (subscriptions.length > 0) {\n types.push(`type Subscription {\\n ${subscriptions.join('\\n ')}\\n}`);\n }\n return types;\n}\n/**\n * Returns API definition from ModelSchema or string schema\n * @param arg - { schema }\n * @returns DerivedApiDefinition that conforms to IAmplifyGraphqlDefinition\n */\nfunction processSchema(arg) {\n const { schema, jsFunctions, functionSchemaAccess, lambdaFunctions, customSqlDataSourceStrategies, } = schemaPreprocessor(arg.schema);\n return {\n schema,\n functionSlots: [],\n jsFunctions,\n functionSchemaAccess,\n lambdaFunctions,\n customSqlDataSourceStrategies,\n };\n}\nexports.processSchema = processSchema;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;AAC/B,MAAM,OAAO,GAAG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AAI,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE;AAClC,QAAQ,KAAK,CAAC,IAAI,CAAC,CAAC,uBAAuB,EAAE,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9E,KAAK;AACL,IAAI,OAAO,KAAK,CAAC;AACjB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,GAAG,EAAE;AAC5B,IAAI,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,oBAAoB,EAAE,eAAe,EAAE,6BAA6B,GAAG,GAAG,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC1I,IAAI,OAAO;AACX,QAAQ,MAAM;AACd,QAAQ,aAAa,EAAE,EAAE;AACzB,QAAQ,WAAW;AACnB,QAAQ,oBAAoB;AAC5B,QAAQ,eAAe;AACvB,QAAQ,6BAA6B;AACrC,KAAK,CAAC;AACN,CAAC;AACD,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
@@ -347,8 +347,8 @@ export type ImpliedAuthField<T extends Authorization<any, any, any>> = T extends
347
347
  export type ImpliedAuthFields<T extends Authorization<any, any, any>> = ImpliedAuthField<T> extends never ? never : UnionToIntersection<ImpliedAuthField<T>>;
348
348
  export declare const accessData: <T extends Authorization<any, any, any>>(authorization: T) => {
349
349
  strategy?: any;
350
- provider?: "function" | "apiKey" | "identityPool" | "oidc" | "userPools" | undefined;
351
- operations?: ("create" | "get" | "update" | "delete" | "list" | "search" | "read" | "sync" | "listen")[] | undefined;
350
+ provider?: "function" | "userPools" | "oidc" | "identityPool" | "apiKey" | undefined;
351
+ operations?: ("create" | "update" | "delete" | "search" | "read" | "get" | "list" | "sync" | "listen")[] | undefined;
352
352
  groupOrOwnerField?: any;
353
353
  groups?: string[] | undefined;
354
354
  multiOwner: any;
@@ -1,11 +1,17 @@
1
+ import type { PrimaryIndexIrShape } from '../runtime/';
1
2
  type DefaultIdentifierFields = {
2
3
  readonly id: string;
3
4
  };
5
+ type DefaultIdentifierType = {
6
+ pk: {
7
+ id: string;
8
+ };
9
+ };
4
10
  type DefaultTimestampFields = {
5
11
  readonly createdAt: string;
6
12
  readonly updatedAt: string;
7
13
  };
8
- type InitialImplicitFields<Identifier> = Identifier extends 'id' ? DefaultIdentifierFields & DefaultTimestampFields : DefaultTimestampFields;
14
+ type InitialImplicitFields<Identifier> = Identifier extends DefaultIdentifierType ? DefaultIdentifierFields & DefaultTimestampFields : DefaultTimestampFields;
9
15
  /**
10
16
  * @returns true if a string union `ExplicitFieldNames` contains a given string `FieldName`
11
17
  */
@@ -17,13 +23,15 @@ type GetModelFieldNames<FlatModel> = FlatModel extends Record<infer R, any> ? R
17
23
  /**
18
24
  * Generate Record type containing all implicit fields for a given model
19
25
  */
20
- type ImplicitFields<FlatModel, Identifier, ModelFieldNames = GetModelFieldNames<FlatModel>> = {
26
+ type ImplicitFields<FlatModel, Identifier extends PrimaryIndexIrShape, ModelFieldNames = GetModelFieldNames<FlatModel>> = {
21
27
  [ImplicitField in keyof InitialImplicitFields<Identifier> as FieldExists<ModelFieldNames & string, ImplicitField & string> extends true ? never : ImplicitField]: InitialImplicitFields<Identifier>[ImplicitField];
22
28
  };
23
29
  /**
24
30
  * @returns intersection of explicit and implicit model fields
25
31
  */
26
- type InjectDefaultFieldsForModel<FlatModel, ModelIdentifier> = FlatModel & ImplicitFields<FlatModel, 'identifier' extends keyof ModelIdentifier ? ModelIdentifier['identifier'] : never>;
32
+ type InjectDefaultFieldsForModel<FlatModel, ModelIdentifier extends {
33
+ identifier: PrimaryIndexIrShape;
34
+ }> = FlatModel & ImplicitFields<FlatModel, 'identifier' extends keyof ModelIdentifier ? ModelIdentifier['identifier'] : never>;
27
35
  /**
28
36
  * Mapped type that injects default implicit fields for a model
29
37
  * 1. Add "id" field to models with neither an explicit field named "id" nor a custom identifier (`.identifier(['some-field'])`)
@@ -31,7 +39,9 @@ type InjectDefaultFieldsForModel<FlatModel, ModelIdentifier> = FlatModel & Impli
31
39
  *
32
40
  * @typeParam FlattenedSchema - resolved schema type (TODO: add detail/example/link to type)
33
41
  */
34
- export type InjectImplicitModelFields<FlattenedSchema, IdentifierMeta> = {
35
- [ModelName in keyof FlattenedSchema]: InjectDefaultFieldsForModel<FlattenedSchema[ModelName], ModelName extends keyof IdentifierMeta ? IdentifierMeta[ModelName] : object>;
42
+ export type InjectImplicitModelFields<FlattenedSchema, IdentifierMeta extends Record<string, {
43
+ identifier: PrimaryIndexIrShape;
44
+ }>> = {
45
+ [ModelName in keyof FlattenedSchema]: InjectDefaultFieldsForModel<FlattenedSchema[ModelName], ModelName extends keyof IdentifierMeta ? IdentifierMeta[ModelName] : never>;
36
46
  };
37
47
  export {};
@@ -1,5 +1,11 @@
1
1
  import { ModelIndexType } from '../ModelIndex';
2
2
  type ModelIndexTypeShape = ModelIndexType<any, any, any, any, any>;
3
+ export type PrimaryIndexFieldsToIR<IdxFields extends ReadonlyArray<string>, ResolvedFields> = IdxFields extends readonly [infer PK, ...infer SK] ? {
4
+ pk: PK extends keyof ResolvedFields ? {
5
+ [Key in PK]: Exclude<ResolvedFields[PK], null> & (string | number);
6
+ } : never;
7
+ sk: unknown extends SK ? never : ResolvedSortKeyFields<SK, ResolvedFields>;
8
+ } : never;
3
9
  /**
4
10
  * Maps array of ModelIndexType to SecondaryIndexIrShape (defined in in data-schema-types)
5
11
  * */
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=MapIndexes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapIndexes.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,9 +1,10 @@
1
1
  import { type UnionToIntersection, type ExcludeEmpty } from '@aws-amplify/data-schema-types';
2
+ import { type PrimaryIndexIrShape } from '../runtime/';
2
3
  import type { ModelType } from '../ModelType';
3
4
  import type { ModelRelationalFieldParamShape } from '../ModelRelationalField';
4
5
  export type ModelIdentifier<T> = {
5
- [Property in keyof T]: T[Property] extends ModelType<infer R, any> ? R['identifier'] extends any[] ? {
6
- identifier: R['identifier'][number];
6
+ [Property in keyof T]: T[Property] extends ModelType<infer R, any> ? R['identifier'] extends PrimaryIndexIrShape ? {
7
+ identifier: R['identifier'];
7
8
  } : never : never;
8
9
  };
9
10
  export type ModelSecondaryIndexes<T> = {
@@ -11,7 +12,9 @@ export type ModelSecondaryIndexes<T> = {
11
12
  secondaryIndexes: R['secondaryIndexes'];
12
13
  } : never : never;
13
14
  };
14
- export type RelationalMetadata<ResolvedSchema, ResolvedFields extends Record<string, unknown>, IdentifierMeta extends Record<string, any>> = UnionToIntersection<ExcludeEmpty<{
15
+ export type RelationalMetadata<ResolvedSchema, ResolvedFields extends Record<string, unknown>, IdentifierMeta extends Record<string, {
16
+ identifier: PrimaryIndexIrShape;
17
+ }>> = UnionToIntersection<ExcludeEmpty<{
15
18
  [ModelName in keyof ResolvedSchema]: {
16
19
  [Field in keyof ResolvedSchema[ModelName] as ResolvedSchema[ModelName][Field] extends ModelRelationalFieldParamShape ? ResolvedSchema[ModelName][Field]['relationshipType'] extends 'hasOne' | 'belongsTo' ? ModelName : never : never]: ResolvedSchema[ModelName][Field] extends ModelRelationalFieldParamShape ? ResolvedSchema[ModelName][Field] extends ModelRelationalFieldParamShape ? ResolvedSchema[ModelName][Field]['relationshipType'] extends 'hasMany' ? {
17
20
  relationalInputFields: Partial<Record<`${Uncapitalize<ModelName & string>}`, NormalizeInputFields<ResolvedFields[ModelName & string], ExtractModelIdentifier<ModelName, IdentifierMeta>>>>;
@@ -20,6 +23,10 @@ export type RelationalMetadata<ResolvedSchema, ResolvedFields extends Record<str
20
23
  } : never : never;
21
24
  };
22
25
  }[keyof ResolvedSchema]>>;
23
- type ExtractModelIdentifier<ModelName, IdentifierMeta> = ModelName extends keyof IdentifierMeta ? IdentifierMeta[ModelName] : never;
24
- type NormalizeInputFields<ModelFields, IdentifierMeta extends Record<string, any>> = Partial<Omit<ModelFields, IdentifierMeta['identifier']>> & Required<Pick<ModelFields, IdentifierMeta['identifier']>>;
26
+ type ExtractModelIdentifier<ModelName, IdentifierMeta extends Record<string, {
27
+ identifier: PrimaryIndexIrShape;
28
+ }>> = ModelName extends keyof IdentifierMeta ? IdentifierMeta[ModelName] : never;
29
+ type NormalizeInputFields<ModelFields, IdentifierMeta extends {
30
+ identifier: PrimaryIndexIrShape;
31
+ }, IdFields extends keyof ModelFields = (keyof IdentifierMeta['identifier']['pk'] & keyof ModelFields) | (IdentifierMeta['identifier']['sk'] extends never ? never : keyof IdentifierMeta['identifier']['sk'] & keyof ModelFields)> = Partial<Omit<ModelFields, IdFields>> & Required<Pick<ModelFields, IdFields>>;
25
32
  export {};
@@ -4,6 +4,7 @@ import type { ModelField } from '../ModelField';
4
4
  import type { ModelType, ModelTypeParamShape } from '../ModelType';
5
5
  import type { GenericModelSchema } from '../ModelSchema';
6
6
  import type { ModelRelationalField, ModelRelationalFieldParamShape } from '../ModelRelationalField';
7
+ import type { PrimaryIndexIrShape } from '../runtime/';
7
8
  import type { ResolveSchema, SchemaTypes } from './ResolveSchema';
8
9
  import type { InjectImplicitModelFields } from './ImplicitFieldInjector';
9
10
  import type { ModelIdentifier } from './ModelMetadata';
@@ -13,9 +14,9 @@ import type { CustomType, CustomTypeParamShape } from '../CustomType';
13
14
  import type { EnumType, EnumTypeParamShape } from '../EnumType';
14
15
  import type { CustomOperation, CustomOperationParamShape } from '../CustomOperation';
15
16
  export type ResolveFieldProperties<Schema extends GenericModelSchema<any>, NonModelTypes extends NonModelTypesShape, ResolvedSchema = ResolveSchema<Schema>, IdentifierMeta extends Record<string, {
16
- identifier: string;
17
+ identifier: PrimaryIndexIrShape;
17
18
  }> = ModelIdentifier<SchemaTypes<Schema>>, FieldsWithInjectedImplicitFields = InjectImplicitModelFields<ResolvedSchema, IdentifierMeta>, FieldsWithRelationships = ResolveModelsRelationalAndRefFields<FieldsWithInjectedImplicitFields, NonModelTypes>> = Intersection<FilterFieldTypes<MarkModelsNonNullableFieldsRequired<FieldsWithRelationships>>, FilterFieldTypes<MarkModelsNullableFieldsOptional<FieldsWithRelationships>>, FilterFieldTypes<ModelImpliedAuthFields<Schema>>>;
18
- export type ResolveStaticFieldProperties<Schema extends GenericModelSchema<any>, NonModelTypes extends NonModelTypesShape, ImplicitModelsSchema, ResolvedSchema = ResolveSchema<Schema>, FieldsWithInjectedImplicitFields = InjectImplicitModelFields<ResolvedSchema & ImplicitModelsSchema, object>, FieldsWithRelationships = ResolveModelsRelationalAndRefFields<FieldsWithInjectedImplicitFields, NonModelTypes>> = Intersection<FilterFieldTypes<MarkModelsNonNullableFieldsRequired<FieldsWithRelationships>>, FilterFieldTypes<MarkModelsNullableFieldsOptional<FieldsWithRelationships>>>;
19
+ export type ResolveStaticFieldProperties<Schema extends GenericModelSchema<any>, NonModelTypes extends NonModelTypesShape, ImplicitModelsSchema, ResolvedSchema = ResolveSchema<Schema>, FieldsWithInjectedImplicitFields = InjectImplicitModelFields<ResolvedSchema & ImplicitModelsSchema, never>, FieldsWithRelationships = ResolveModelsRelationalAndRefFields<FieldsWithInjectedImplicitFields, NonModelTypes>> = Intersection<FilterFieldTypes<MarkModelsNonNullableFieldsRequired<FieldsWithRelationships>>, FilterFieldTypes<MarkModelsNullableFieldsOptional<FieldsWithRelationships>>>;
19
20
  type GetRelationshipRef<T, RM extends keyof T, TypeArg extends ModelRelationalFieldParamShape, Flat extends boolean, ResolvedModel = ResolveRelationalFieldsForModel<T, RM, Flat>, Model = TypeArg['valueRequired'] extends true ? ResolvedModel : ResolvedModel | null | undefined> = LazyLoader<Model, TypeArg['array']>;
20
21
  type ResolveRelationalFieldsForModel<Schema, ModelName extends keyof Schema, Flat extends boolean> = {
21
22
  [FieldName in keyof Schema[ModelName]]: Schema[ModelName][FieldName] extends ModelRelationalFieldParamShape ? Schema[ModelName][FieldName]['relatedModel'] extends keyof Schema ? GetRelationshipRef<Schema, Schema[ModelName][FieldName]['relatedModel'], Schema[ModelName][FieldName], Flat> : never : Schema[ModelName][FieldName];