@aws-amplify/data-schema 0.18.0 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Authorization.js +17 -17
- package/dist/cjs/Authorization.js.map +1 -1
- package/dist/cjs/SchemaProcessor.js +6 -1
- package/dist/cjs/SchemaProcessor.js.map +1 -1
- package/dist/esm/Authorization.d.ts +16 -16
- package/dist/esm/Authorization.mjs +17 -17
- package/dist/esm/Authorization.mjs.map +1 -1
- package/dist/esm/CustomOperation.d.ts +2 -2
- package/dist/esm/SchemaProcessor.mjs +6 -1
- package/dist/esm/SchemaProcessor.mjs.map +1 -1
- package/dist/esm/runtime/bridge-types.d.ts +1 -1
- package/dist/esm/runtime/client/index.d.ts +1 -1
- package/dist/meta/cjs.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/Authorization.ts +17 -17
- package/src/CustomOperation.ts +2 -2
- package/src/SchemaProcessor.ts +9 -1
- package/src/runtime/bridge-types.ts +1 -0
- package/src/runtime/client/index.ts +1 -0
|
@@ -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) {\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 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, functionRef, handlers, subscriptionSource, } = typeDef.data;\n let callSignature = typeName;\n const implicitModels = [];\n const { authString } = isCustom\n ? calculateCustomAuth(authorization)\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 shouldAddCustomTypeToImplicitModels A flag indicates wether it should push\n * the return type resolved CustomType to the `implicitModels` list.\n * @returns\n */\n const resolveReturnTypeNameFromReturnType = (returnType, { refererTypeName, shouldAddCustomTypeToImplicitModels = true, }) => {\n if (isRefField(returnType)) {\n return refFieldToGql(returnType?.data);\n }\n else if (isCustomType(returnType)) {\n const returnTypeName = `${capitalize(refererTypeName)}ReturnType`;\n if (shouldAddCustomTypeToImplicitModels) {\n implicitModels.push([returnTypeName, returnType]);\n }\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 shouldAddCustomTypeToImplicitModels: 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, models } = processFields(typeName, fieldArgs, {}, {});\n callSignature += `(${gqlFields.join(', ')})`;\n implicitModels.push(...models);\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 (functionRef) {\n gqlHandlerContent = `@function(name: \"${functionRef}\") `;\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 models: implicitModels,\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}\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 ruleParts.push(`provider: ${rule.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 validateCustomAuthRule(rule) {\n if (rule.groups && rule.provider === 'oidc') {\n throw new Error('OIDC group auth is not supported with a.handler.custom');\n }\n}\nfunction getCustomAuthProvider(rule) {\n const strategyDict = {\n public: {\n default: '@aws_api_key',\n apiKey: '@aws_api_key',\n iam: '@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 },\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 calculateCustomAuth(authorization) {\n const rules = [];\n for (const entry of authorization) {\n const rule = (0, Authorization_1.accessData)(entry);\n validateCustomAuthRule(rule);\n const provider = getCustomAuthProvider(rule);\n if (rule.groups) {\n // example: (cognito_groups: [\"Bloggers\", \"Readers\"])\n rules.push(`${provider}(cognito_groups: [${rule.groups\n .map((group) => `\"${group}\"`)\n .join(', ')}])`);\n }\n else {\n rules.push(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 const models = [];\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)}${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 models.push([enumName, fieldDef]);\n gqlFields.push(`${fieldName}: ${enumName}`);\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 models.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, models };\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) => {\n const indexDirectiveWithAttributes = (partitionKey, sortKeys, indexName, queryField) => {\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};\nconst schemaPreprocessor = (schema) => {\n const gqlModels = [];\n const customQueries = [];\n const customMutations = [];\n const customSubscriptions = [];\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 = 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 const fieldAuthApplicableFields = Object.fromEntries(Object.entries(fields).filter((pair) => isModelField(pair[1])));\n const authString = '';\n const authFields = {};\n const fieldLevelAuthRules = processFieldLevelAuthRules(fieldAuthApplicableFields, authFields);\n const { gqlFields, models } = processFields(typeName, fields, authFields, fieldLevelAuthRules);\n topLevelTypes.push(...models);\n const joined = gqlFields.join('\\n ');\n const model = `type ${typeName} ${authString}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n else if (isCustomOperation(typeDef)) {\n const { typeName: opType } = typeDef.data;\n const { gqlField, models, jsFunctionForField, lambdaFunctionDefinition, customSqlDataSourceStrategy, } = transformCustomOperations(typeDef, typeName, mostRelevantAuthRules, databaseType, getRefType);\n Object.assign(lambdaFunctions, lambdaFunctionDefinition);\n topLevelTypes.push(...models);\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 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, models } = processFields(typeName, fields, authFields, fieldLevelAuthRules, identifier, partitionKey);\n topLevelTypes.push(...models);\n const joined = gqlFields.join('\\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}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n else {\n const fields = typeDef.data.fields;\n const identifier = typeDef.data.identifier;\n const [partitionKey] = identifier;\n const transformedSecondaryIndexes = transformedSecondaryIndexesForModel(typeName, typeDef.data.secondaryIndexes);\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, models } = processFields(typeName, fields, authFields, fieldLevelAuthRules, identifier, partitionKey, transformedSecondaryIndexes);\n topLevelTypes.push(...models);\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 { functionRef, handlers, typeName: opType, subscriptionSource, } = typeDef.data;\n // TODO: remove `functionRef` after deprecating\n const handlerConfigured = functionRef !== null || 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') {\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, models, lambdaFunctionDefinition, customSqlDataSourceStrategy, } = customOperationToGql(typeName, typeDef, authRules, isCustom, databaseType, getRefType);\n return {\n gqlField,\n models,\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,OAAO,CAAC,OAAO,CAAC,CAAC;AACjC,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAC7C,MAAM,eAAe,GAAG,OAAO,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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) {\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 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, functionRef, handlers, subscriptionSource, } = typeDef.data;\n let callSignature = typeName;\n const implicitModels = [];\n const { authString } = isCustom\n ? calculateCustomAuth(authorization)\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 shouldAddCustomTypeToImplicitModels A flag indicates wether it should push\n * the return type resolved CustomType to the `implicitModels` list.\n * @returns\n */\n const resolveReturnTypeNameFromReturnType = (returnType, { refererTypeName, shouldAddCustomTypeToImplicitModels = true, }) => {\n if (isRefField(returnType)) {\n return refFieldToGql(returnType?.data);\n }\n else if (isCustomType(returnType)) {\n const returnTypeName = `${capitalize(refererTypeName)}ReturnType`;\n if (shouldAddCustomTypeToImplicitModels) {\n implicitModels.push([returnTypeName, returnType]);\n }\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 shouldAddCustomTypeToImplicitModels: 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, models } = processFields(typeName, fieldArgs, {}, {});\n callSignature += `(${gqlFields.join(', ')})`;\n implicitModels.push(...models);\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 (functionRef) {\n gqlHandlerContent = `@function(name: \"${functionRef}\") `;\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 models: implicitModels,\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}\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 validateCustomAuthRule(rule) {\n if (rule.groups && rule.provider === 'oidc') {\n throw new Error('OIDC group auth is not supported with a.handler.custom');\n }\n}\nfunction getCustomAuthProvider(rule) {\n const strategyDict = {\n public: {\n default: '@aws_api_key',\n apiKey: '@aws_api_key',\n iam: '@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 },\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 calculateCustomAuth(authorization) {\n const rules = [];\n for (const entry of authorization) {\n const rule = (0, Authorization_1.accessData)(entry);\n validateCustomAuthRule(rule);\n const provider = getCustomAuthProvider(rule);\n if (rule.groups) {\n // example: (cognito_groups: [\"Bloggers\", \"Readers\"])\n rules.push(`${provider}(cognito_groups: [${rule.groups\n .map((group) => `\"${group}\"`)\n .join(', ')}])`);\n }\n else {\n rules.push(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 const models = [];\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)}${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 models.push([enumName, fieldDef]);\n gqlFields.push(`${fieldName}: ${enumName}`);\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 models.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, models };\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) => {\n const indexDirectiveWithAttributes = (partitionKey, sortKeys, indexName, queryField) => {\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};\nconst schemaPreprocessor = (schema) => {\n const gqlModels = [];\n const customQueries = [];\n const customMutations = [];\n const customSubscriptions = [];\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 = 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 const fieldAuthApplicableFields = Object.fromEntries(Object.entries(fields).filter((pair) => isModelField(pair[1])));\n const authString = '';\n const authFields = {};\n const fieldLevelAuthRules = processFieldLevelAuthRules(fieldAuthApplicableFields, authFields);\n const { gqlFields, models } = processFields(typeName, fields, authFields, fieldLevelAuthRules);\n topLevelTypes.push(...models);\n const joined = gqlFields.join('\\n ');\n const model = `type ${typeName} ${authString}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n else if (isCustomOperation(typeDef)) {\n const { typeName: opType } = typeDef.data;\n const { gqlField, models, jsFunctionForField, lambdaFunctionDefinition, customSqlDataSourceStrategy, } = transformCustomOperations(typeDef, typeName, mostRelevantAuthRules, databaseType, getRefType);\n Object.assign(lambdaFunctions, lambdaFunctionDefinition);\n topLevelTypes.push(...models);\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 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, models } = processFields(typeName, fields, authFields, fieldLevelAuthRules, identifier, partitionKey);\n topLevelTypes.push(...models);\n const joined = gqlFields.join('\\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}\\n{\\n ${joined}\\n}`;\n gqlModels.push(model);\n }\n else {\n const fields = typeDef.data.fields;\n const identifier = typeDef.data.identifier;\n const [partitionKey] = identifier;\n const transformedSecondaryIndexes = transformedSecondaryIndexesForModel(typeName, typeDef.data.secondaryIndexes);\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, models } = processFields(typeName, fields, authFields, fieldLevelAuthRules, identifier, partitionKey, transformedSecondaryIndexes);\n topLevelTypes.push(...models);\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 { functionRef, handlers, typeName: opType, subscriptionSource, } = typeDef.data;\n // TODO: remove `functionRef` after deprecating\n const handlerConfigured = functionRef !== null || 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, models, lambdaFunctionDefinition, customSqlDataSourceStrategy, } = customOperationToGql(typeName, typeDef, authRules, isCustom, databaseType, getRefType);\n return {\n gqlField,\n models,\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,OAAO,CAAC,OAAO,CAAC,CAAC;AACjC,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAC7C,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACnD,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACvD,MAAM,MAAM,GAAG,OAAO,CAAC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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;;"}
|
|
@@ -5,19 +5,19 @@ declare const __data: unique symbol;
|
|
|
5
5
|
*
|
|
6
6
|
* This list should not be used if you need to restrict available providers
|
|
7
7
|
* according to an auth strategcy. E.g., `public` auth can only be facilitated
|
|
8
|
-
* by `apiKey` and `
|
|
8
|
+
* by `apiKey` and `identityPool` providers.
|
|
9
9
|
*/
|
|
10
|
-
export declare const Providers: readonly ["apiKey", "
|
|
10
|
+
export declare const Providers: readonly ["apiKey", "identityPool", "userPools", "oidc", "function"];
|
|
11
11
|
export type Provider = (typeof Providers)[number];
|
|
12
12
|
/**
|
|
13
13
|
* The subset of auth providers that can facilitate `public` auth.
|
|
14
14
|
*/
|
|
15
|
-
export declare const PublicProviders: readonly ["apiKey", "
|
|
15
|
+
export declare const PublicProviders: readonly ["apiKey", "identityPool"];
|
|
16
16
|
export type PublicProvider = (typeof PublicProviders)[number];
|
|
17
17
|
/**
|
|
18
18
|
* The subset of auth providers that can facilitate `private` auth.
|
|
19
19
|
*/
|
|
20
|
-
export declare const PrivateProviders: readonly ["userPools", "oidc", "
|
|
20
|
+
export declare const PrivateProviders: readonly ["userPools", "oidc", "identityPool"];
|
|
21
21
|
export type PrivateProvider = (typeof PrivateProviders)[number];
|
|
22
22
|
/**
|
|
23
23
|
* The subset of auth providers that can facilitate `owner` auth.
|
|
@@ -84,7 +84,7 @@ declare function identityClaim<SELF extends Authorization<any, any, any>>(this:
|
|
|
84
84
|
declare function withClaimIn<SELF extends Authorization<any, any, any>>(this: SELF, property: string): Omit<SELF, "withClaimIn">;
|
|
85
85
|
/**
|
|
86
86
|
* Defines an authorization rule for your data models and fields. First choose an authorization strategy (`public`,
|
|
87
|
-
* `private`, `owner`, `group`, or `custom`), then choose an auth provider (`apiKey`, `
|
|
87
|
+
* `private`, `owner`, `group`, or `custom`), then choose an auth provider (`apiKey`, `identitypool`, `userPools`, `oidc`, or `function`)
|
|
88
88
|
* and optionally use `.to(...)` to specify the operations that can be performed against your data models and fields.
|
|
89
89
|
*/
|
|
90
90
|
export declare const allow: {
|
|
@@ -96,16 +96,16 @@ export declare const allow: {
|
|
|
96
96
|
to: typeof to;
|
|
97
97
|
};
|
|
98
98
|
/**
|
|
99
|
-
* Authorize unauthenticated users by using
|
|
99
|
+
* Authorize unauthenticated users by using IDENTITYPOOL based authorization.
|
|
100
100
|
* @returns an authorization rule for unauthenticated users
|
|
101
101
|
*/
|
|
102
102
|
readonly guest: () => Authorization<"public", undefined, false> & {
|
|
103
103
|
to: typeof to;
|
|
104
104
|
};
|
|
105
105
|
/**
|
|
106
|
-
* Authorize authenticated users. By default, `.
|
|
107
|
-
* use `.authenticated("
|
|
108
|
-
* @param provider the authentication provider - supports "userPools", "
|
|
106
|
+
* Authorize authenticated users. By default, `.authenticated()` uses an Amazon Cognito user pool based authorization. You can additionally
|
|
107
|
+
* use `.authenticated("identityPool")` or `.authenticated("oidc")` to use identityPool or OIDC based authorization for authenticated users.
|
|
108
|
+
* @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
|
|
109
109
|
* @returns an authorization rule for authenticated users
|
|
110
110
|
*/
|
|
111
111
|
readonly authenticated: (provider?: PrivateProvider) => Authorization<"private", undefined, false> & {
|
|
@@ -123,7 +123,7 @@ export declare const allow: {
|
|
|
123
123
|
* To change the specific claim that should be used as the user identifier within the owner field, chain the
|
|
124
124
|
* `.identityClaim(...)` method.
|
|
125
125
|
*
|
|
126
|
-
* @param provider the authentication provider - supports "userPools", "
|
|
126
|
+
* @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
|
|
127
127
|
* @returns an authorization rule for authenticated users
|
|
128
128
|
*/
|
|
129
129
|
readonly owner: (provider?: OwnerProviders) => Authorization<"owner", "owner", false> & {
|
|
@@ -140,7 +140,7 @@ export declare const allow: {
|
|
|
140
140
|
* `.identityClaim(...)` method.
|
|
141
141
|
*
|
|
142
142
|
* @param ownerField the field that contains the owner information
|
|
143
|
-
* @param provider the authentication provider - supports "userPools", "
|
|
143
|
+
* @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
|
|
144
144
|
* @returns an authorization rule for authenticated users
|
|
145
145
|
*/
|
|
146
146
|
readonly ownerDefinedIn: <T extends string>(ownerField: T, provider?: OwnerProviders) => Authorization<"owner", T, false> & {
|
|
@@ -161,7 +161,7 @@ export declare const allow: {
|
|
|
161
161
|
* `.identityClaim(...)` method.
|
|
162
162
|
*
|
|
163
163
|
* @param ownersField the field that contains the owners information
|
|
164
|
-
* @param provider the authentication provider - supports "userPools", "
|
|
164
|
+
* @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
|
|
165
165
|
* @returns an authorization rule for authenticated users
|
|
166
166
|
*/
|
|
167
167
|
readonly ownersDefinedIn: <T_1 extends string>(ownersField: T_1, provider?: OwnerProviders) => Authorization<"owner", T_1, true> & {
|
|
@@ -259,14 +259,14 @@ export declare const allowForCustomOperations: {
|
|
|
259
259
|
*/
|
|
260
260
|
readonly publicApiKey: () => Authorization<"public", undefined, false>;
|
|
261
261
|
/**
|
|
262
|
-
* Authorize unauthenticated users by using
|
|
262
|
+
* Authorize unauthenticated users by using identityPool based authorization.
|
|
263
263
|
* @returns an authorization rule for unauthenticated users
|
|
264
264
|
*/
|
|
265
265
|
readonly guest: () => Authorization<"public", undefined, false>;
|
|
266
266
|
/**
|
|
267
267
|
* Authorize authenticated users. By default, `.private()` uses an Amazon Cognito user pool based authorization. You can additionally
|
|
268
|
-
* use `.authenticated("
|
|
269
|
-
* @param provider the authentication provider - supports "userPools", "
|
|
268
|
+
* use `.authenticated("identityPool")` or `.authenticated("oidc")` to use Identity Pool or OIDC based authorization for authenticated users.
|
|
269
|
+
* @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
|
|
270
270
|
* @returns an authorization rule for authenticated users
|
|
271
271
|
*/
|
|
272
272
|
readonly authenticated: (provider?: PrivateProvider) => Authorization<"private", undefined, false>;
|
|
@@ -347,7 +347,7 @@ 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" | "
|
|
350
|
+
provider?: "function" | "apiKey" | "identityPool" | "oidc" | "userPools" | undefined;
|
|
351
351
|
operations?: ("create" | "get" | "update" | "delete" | "list" | "search" | "read" | "sync" | "listen")[] | undefined;
|
|
352
352
|
groupOrOwnerField?: any;
|
|
353
353
|
groups?: string[] | undefined;
|
|
@@ -4,11 +4,11 @@ const __data = Symbol('data');
|
|
|
4
4
|
*
|
|
5
5
|
* This list should not be used if you need to restrict available providers
|
|
6
6
|
* according to an auth strategcy. E.g., `public` auth can only be facilitated
|
|
7
|
-
* by `apiKey` and `
|
|
7
|
+
* by `apiKey` and `identityPool` providers.
|
|
8
8
|
*/
|
|
9
9
|
const Providers = [
|
|
10
10
|
'apiKey',
|
|
11
|
-
'
|
|
11
|
+
'identityPool',
|
|
12
12
|
'userPools',
|
|
13
13
|
'oidc',
|
|
14
14
|
'function',
|
|
@@ -16,11 +16,11 @@ const Providers = [
|
|
|
16
16
|
/**
|
|
17
17
|
* The subset of auth providers that can facilitate `public` auth.
|
|
18
18
|
*/
|
|
19
|
-
const PublicProviders = ['apiKey', '
|
|
19
|
+
const PublicProviders = ['apiKey', 'identityPool'];
|
|
20
20
|
/**
|
|
21
21
|
* The subset of auth providers that can facilitate `private` auth.
|
|
22
22
|
*/
|
|
23
|
-
const PrivateProviders = ['userPools', 'oidc', '
|
|
23
|
+
const PrivateProviders = ['userPools', 'oidc', 'identityPool'];
|
|
24
24
|
/**
|
|
25
25
|
* The subset of auth providers that can facilitate `owner` auth.
|
|
26
26
|
*/
|
|
@@ -112,7 +112,7 @@ function authData(defaults, builderMethods) {
|
|
|
112
112
|
}
|
|
113
113
|
/**
|
|
114
114
|
* Defines an authorization rule for your data models and fields. First choose an authorization strategy (`public`,
|
|
115
|
-
* `private`, `owner`, `group`, or `custom`), then choose an auth provider (`apiKey`, `
|
|
115
|
+
* `private`, `owner`, `group`, or `custom`), then choose an auth provider (`apiKey`, `identitypool`, `userPools`, `oidc`, or `function`)
|
|
116
116
|
* and optionally use `.to(...)` to specify the operations that can be performed against your data models and fields.
|
|
117
117
|
*/
|
|
118
118
|
const allow = {
|
|
@@ -129,21 +129,21 @@ const allow = {
|
|
|
129
129
|
});
|
|
130
130
|
},
|
|
131
131
|
/**
|
|
132
|
-
* Authorize unauthenticated users by using
|
|
132
|
+
* Authorize unauthenticated users by using IDENTITYPOOL based authorization.
|
|
133
133
|
* @returns an authorization rule for unauthenticated users
|
|
134
134
|
*/
|
|
135
135
|
guest() {
|
|
136
136
|
return authData({
|
|
137
137
|
strategy: 'public',
|
|
138
|
-
provider: '
|
|
138
|
+
provider: 'identityPool',
|
|
139
139
|
}, {
|
|
140
140
|
to,
|
|
141
141
|
});
|
|
142
142
|
},
|
|
143
143
|
/**
|
|
144
|
-
* Authorize authenticated users. By default, `.
|
|
145
|
-
* use `.authenticated("
|
|
146
|
-
* @param provider the authentication provider - supports "userPools", "
|
|
144
|
+
* Authorize authenticated users. By default, `.authenticated()` uses an Amazon Cognito user pool based authorization. You can additionally
|
|
145
|
+
* use `.authenticated("identityPool")` or `.authenticated("oidc")` to use identityPool or OIDC based authorization for authenticated users.
|
|
146
|
+
* @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
|
|
147
147
|
* @returns an authorization rule for authenticated users
|
|
148
148
|
*/
|
|
149
149
|
authenticated(provider) {
|
|
@@ -167,7 +167,7 @@ const allow = {
|
|
|
167
167
|
* To change the specific claim that should be used as the user identifier within the owner field, chain the
|
|
168
168
|
* `.identityClaim(...)` method.
|
|
169
169
|
*
|
|
170
|
-
* @param provider the authentication provider - supports "userPools", "
|
|
170
|
+
* @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
|
|
171
171
|
* @returns an authorization rule for authenticated users
|
|
172
172
|
*/
|
|
173
173
|
owner(provider) {
|
|
@@ -191,7 +191,7 @@ const allow = {
|
|
|
191
191
|
* `.identityClaim(...)` method.
|
|
192
192
|
*
|
|
193
193
|
* @param ownerField the field that contains the owner information
|
|
194
|
-
* @param provider the authentication provider - supports "userPools", "
|
|
194
|
+
* @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
|
|
195
195
|
* @returns an authorization rule for authenticated users
|
|
196
196
|
*/
|
|
197
197
|
ownerDefinedIn(ownerField, provider) {
|
|
@@ -219,7 +219,7 @@ const allow = {
|
|
|
219
219
|
* `.identityClaim(...)` method.
|
|
220
220
|
*
|
|
221
221
|
* @param ownersField the field that contains the owners information
|
|
222
|
-
* @param provider the authentication provider - supports "userPools", "
|
|
222
|
+
* @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
|
|
223
223
|
* @returns an authorization rule for authenticated users
|
|
224
224
|
*/
|
|
225
225
|
ownersDefinedIn(ownersField, provider) {
|
|
@@ -362,19 +362,19 @@ const allowForCustomOperations = {
|
|
|
362
362
|
}, {});
|
|
363
363
|
},
|
|
364
364
|
/**
|
|
365
|
-
* Authorize unauthenticated users by using
|
|
365
|
+
* Authorize unauthenticated users by using identityPool based authorization.
|
|
366
366
|
* @returns an authorization rule for unauthenticated users
|
|
367
367
|
*/
|
|
368
368
|
guest() {
|
|
369
369
|
return authData({
|
|
370
370
|
strategy: 'public',
|
|
371
|
-
provider: '
|
|
371
|
+
provider: 'identityPool',
|
|
372
372
|
}, {});
|
|
373
373
|
},
|
|
374
374
|
/**
|
|
375
375
|
* Authorize authenticated users. By default, `.private()` uses an Amazon Cognito user pool based authorization. You can additionally
|
|
376
|
-
* use `.authenticated("
|
|
377
|
-
* @param provider the authentication provider - supports "userPools", "
|
|
376
|
+
* use `.authenticated("identityPool")` or `.authenticated("oidc")` to use Identity Pool or OIDC based authorization for authenticated users.
|
|
377
|
+
* @param provider the authentication provider - supports "userPools", "identityPool", or "oidc"
|
|
378
378
|
* @returns an authorization rule for authenticated users
|
|
379
379
|
*/
|
|
380
380
|
authenticated(provider) {
|