@aws-amplify/data-schema 0.18.4 → 1.0.1
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/CustomOperation.js +0 -5
- package/dist/cjs/CustomOperation.js.map +1 -1
- package/dist/cjs/ModelRelationalField.js +1 -5
- package/dist/cjs/ModelRelationalField.js.map +1 -1
- package/dist/cjs/SchemaProcessor.js +19 -7
- package/dist/cjs/SchemaProcessor.js.map +1 -1
- package/dist/esm/CustomOperation.d.ts +0 -16
- package/dist/esm/CustomOperation.mjs +0 -5
- package/dist/esm/CustomOperation.mjs.map +1 -1
- package/dist/esm/MappedTypes/CustomOperations.d.ts +0 -1
- package/dist/esm/ModelRelationalField.d.ts +3 -9
- package/dist/esm/ModelRelationalField.mjs +1 -5
- package/dist/esm/ModelRelationalField.mjs.map +1 -1
- package/dist/esm/ModelSchema.d.ts +3 -2
- package/dist/esm/SchemaProcessor.mjs +19 -7
- package/dist/esm/SchemaProcessor.mjs.map +1 -1
- package/dist/meta/cjs.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/CustomOperation.ts +0 -29
- package/src/MappedTypes/CustomOperations.ts +0 -1
- package/src/ModelRelationalField.ts +3 -18
- package/src/ModelSchema.ts +4 -2
- package/src/SchemaProcessor.ts +37 -11
|
@@ -19,7 +19,6 @@ function _custom(typeName, brand) {
|
|
|
19
19
|
const data = {
|
|
20
20
|
arguments: {},
|
|
21
21
|
returnType: null,
|
|
22
|
-
functionRef: null,
|
|
23
22
|
authorization: [],
|
|
24
23
|
typeName: typeName,
|
|
25
24
|
handlers: null,
|
|
@@ -34,10 +33,6 @@ function _custom(typeName, brand) {
|
|
|
34
33
|
data.returnType = returnType;
|
|
35
34
|
return this;
|
|
36
35
|
},
|
|
37
|
-
function(functionRefOrName) {
|
|
38
|
-
data.functionRef = functionRefOrName;
|
|
39
|
-
return this;
|
|
40
|
-
},
|
|
41
36
|
authorization(callback) {
|
|
42
37
|
const rules = callback(Authorization_1.allowForCustomOperations);
|
|
43
38
|
data.authorization = Array.isArray(rules) ? rules : [rules];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomOperation.js","sources":["../../src/CustomOperation.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.subscription = exports.mutation = exports.query = exports.CustomOperationNames = void 0;\nconst util_1 = require(\"./util\");\nconst Authorization_1 = require(\"./Authorization\");\nconst queryBrand = 'queryCustomOperation';\nconst mutationBrand = 'mutationCustomOperation';\nconst subscriptionBrand = 'subscriptionCustomOperation';\nexports.CustomOperationNames = [\n 'Query',\n 'Mutation',\n 'Subscription',\n];\nfunction brandedBuilder(builder, brandValue) {\n return { ...builder, ...(0, util_1.brand)(brandValue) };\n}\nfunction _custom(typeName, brand) {\n const data = {\n arguments: {},\n returnType: null,\n
|
|
1
|
+
{"version":3,"file":"CustomOperation.js","sources":["../../src/CustomOperation.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.subscription = exports.mutation = exports.query = exports.CustomOperationNames = void 0;\nconst util_1 = require(\"./util\");\nconst Authorization_1 = require(\"./Authorization\");\nconst queryBrand = 'queryCustomOperation';\nconst mutationBrand = 'mutationCustomOperation';\nconst subscriptionBrand = 'subscriptionCustomOperation';\nexports.CustomOperationNames = [\n 'Query',\n 'Mutation',\n 'Subscription',\n];\nfunction brandedBuilder(builder, brandValue) {\n return { ...builder, ...(0, util_1.brand)(brandValue) };\n}\nfunction _custom(typeName, brand) {\n const data = {\n arguments: {},\n returnType: null,\n authorization: [],\n typeName: typeName,\n handlers: null,\n subscriptionSource: [],\n };\n const builder = brandedBuilder({\n arguments(args) {\n data.arguments = args;\n return this;\n },\n returns(returnType) {\n data.returnType = returnType;\n return this;\n },\n authorization(callback) {\n const rules = callback(Authorization_1.allowForCustomOperations);\n data.authorization = Array.isArray(rules) ? rules : [rules];\n return this;\n },\n handler(handlers) {\n data.handlers = Array.isArray(handlers)\n ? handlers\n : [handlers];\n return this;\n },\n for(source) {\n data.subscriptionSource = Array.isArray(source) ? source : [source];\n return this;\n },\n }, brand);\n return { ...builder, data };\n}\nfunction query() {\n return _custom('Query', queryBrand);\n}\nexports.query = query;\nfunction mutation() {\n return _custom('Mutation', mutationBrand);\n}\nexports.mutation = mutation;\nfunction subscription() {\n return _custom('Subscription', subscriptionBrand);\n}\nexports.subscription = subscription;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,oBAAoB,GAAG,KAAK,CAAC,CAAC;AAChG,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AACjC,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACnD,MAAM,UAAU,GAAG,sBAAsB,CAAC;AAC1C,MAAM,aAAa,GAAG,yBAAyB,CAAC;AAChD,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AACxD,OAAO,CAAC,oBAAoB,GAAG;AAC/B,IAAI,OAAO;AACX,IAAI,UAAU;AACd,IAAI,cAAc;AAClB,CAAC,CAAC;AACF,SAAS,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE;AAC7C,IAAI,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC;AAC5D,CAAC;AACD,SAAS,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE;AAClC,IAAI,MAAM,IAAI,GAAG;AACjB,QAAQ,SAAS,EAAE,EAAE;AACrB,QAAQ,UAAU,EAAE,IAAI;AACxB,QAAQ,aAAa,EAAE,EAAE;AACzB,QAAQ,QAAQ,EAAE,QAAQ;AAC1B,QAAQ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CAAC,CAAC;AACxC,CAAC;AACD,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;AACtB,SAAS,QAAQ,GAAG;AACpB,IAAI,OAAO,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AAC9C,CAAC;AACD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5B,SAAS,YAAY,GAAG;AACxB,IAAI,OAAO,OAAO,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;AACtD,CAAC;AACD,OAAO,CAAC,YAAY,GAAG,YAAY;;"}
|
|
@@ -15,7 +15,7 @@ var ModelRelationshipTypes;
|
|
|
15
15
|
})(ModelRelationshipTypes || (exports.ModelRelationshipTypes = ModelRelationshipTypes = {}));
|
|
16
16
|
const relationModifierMap = {
|
|
17
17
|
belongsTo: ['authorization'],
|
|
18
|
-
hasMany: ['
|
|
18
|
+
hasMany: ['valueRequired', 'authorization'],
|
|
19
19
|
hasOne: ['required', 'authorization'],
|
|
20
20
|
};
|
|
21
21
|
function _modelRelationalField(type, relatedModel, references) {
|
|
@@ -35,10 +35,6 @@ function _modelRelationalField(type, relatedModel, references) {
|
|
|
35
35
|
data.arrayRequired = true;
|
|
36
36
|
return this;
|
|
37
37
|
},
|
|
38
|
-
arrayRequired() {
|
|
39
|
-
data.arrayRequired = true;
|
|
40
|
-
return this;
|
|
41
|
-
},
|
|
42
38
|
valueRequired() {
|
|
43
39
|
data.valueRequired = true;
|
|
44
40
|
return this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelRelationalField.js","sources":["../../src/ModelRelationalField.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.belongsTo = exports.hasMany = exports.hasOne = exports.ModelRelationshipTypes = exports.__auth = void 0;\nconst Authorization_1 = require(\"./Authorization\");\n/**\n * Used to \"attach\" auth types to ModelField without exposing them on the builder.\n */\nexports.__auth = Symbol('__auth');\nconst brandName = 'modelRelationalField';\nvar ModelRelationshipTypes;\n(function (ModelRelationshipTypes) {\n ModelRelationshipTypes[\"hasOne\"] = \"hasOne\";\n ModelRelationshipTypes[\"hasMany\"] = \"hasMany\";\n ModelRelationshipTypes[\"belongsTo\"] = \"belongsTo\";\n})(ModelRelationshipTypes || (exports.ModelRelationshipTypes = ModelRelationshipTypes = {}));\nconst relationalModifiers = [\n 'required',\n '
|
|
1
|
+
{"version":3,"file":"ModelRelationalField.js","sources":["../../src/ModelRelationalField.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.belongsTo = exports.hasMany = exports.hasOne = exports.ModelRelationshipTypes = exports.__auth = void 0;\nconst Authorization_1 = require(\"./Authorization\");\n/**\n * Used to \"attach\" auth types to ModelField without exposing them on the builder.\n */\nexports.__auth = Symbol('__auth');\nconst brandName = 'modelRelationalField';\nvar ModelRelationshipTypes;\n(function (ModelRelationshipTypes) {\n ModelRelationshipTypes[\"hasOne\"] = \"hasOne\";\n ModelRelationshipTypes[\"hasMany\"] = \"hasMany\";\n ModelRelationshipTypes[\"belongsTo\"] = \"belongsTo\";\n})(ModelRelationshipTypes || (exports.ModelRelationshipTypes = ModelRelationshipTypes = {}));\nconst relationalModifiers = [\n 'required',\n 'valueRequired',\n 'authorization',\n];\nconst relationModifierMap = {\n belongsTo: ['authorization'],\n hasMany: ['valueRequired', 'authorization'],\n hasOne: ['required', 'authorization'],\n};\nfunction _modelRelationalField(type, relatedModel, references) {\n const data = {\n relatedModel,\n type,\n fieldType: 'model',\n array: false,\n valueRequired: false,\n arrayRequired: false,\n references,\n authorization: [],\n };\n data.array = type === 'hasMany';\n const relationshipBuilderFunctions = {\n required() {\n data.arrayRequired = true;\n return this;\n },\n valueRequired() {\n data.valueRequired = true;\n return this;\n },\n authorization(callback) {\n const rules = callback(Authorization_1.allow);\n data.authorization = Array.isArray(rules) ? rules : [rules];\n return this;\n },\n };\n const builder = Object.fromEntries(relationModifierMap[type].map((key) => [\n key,\n relationshipBuilderFunctions[key],\n ]));\n return {\n ...builder,\n data,\n };\n}\n/**\n * Create a one-directional one-to-one relationship between two models using the `hasOne(\"MODEL_NAME\")` method.\n * A hasOne relationship always uses a reference to the related model's identifier. Typically this is the `id` field\n * unless overwritten with the `identifier()` method.\n * @param relatedModel the name of the related model\n * @returns a one-to-one relationship definition\n */\nfunction hasOne(relatedModel, references) {\n return _modelRelationalField(ModelRelationshipTypes.hasOne, relatedModel, Array.isArray(references) ? references : [references]);\n}\nexports.hasOne = hasOne;\n/**\n * Create a one-directional one-to-many relationship between two models using the `hasMany()` method.\n * @param relatedModel the name of the related model\n * @returns a one-to-many relationship definition\n */\nfunction hasMany(relatedModel, references) {\n return _modelRelationalField(ModelRelationshipTypes.hasMany, relatedModel, Array.isArray(references) ? references : [references]);\n}\nexports.hasMany = hasMany;\n/**\n * Make a `hasOne()` or `hasMany()` relationship bi-directional using the `belongsTo()` method.\n * The belongsTo() method requires that a hasOne() or hasMany() relationship already exists from\n * parent to the related model.\n * @param relatedModel name of the related `.hasOne()` or `.hasMany()` model\n * @returns a belong-to relationship definition\n */\nfunction belongsTo(relatedModel, references) {\n return _modelRelationalField(ModelRelationshipTypes.belongsTo, relatedModel, Array.isArray(references) ? references : [references]);\n}\nexports.belongsTo = belongsTo;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;AAChH,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACnD;AACA;AACA;AACA,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAElC,IAAI,sBAAsB,CAAC;AAC3B,CAAC,UAAU,sB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U,CAAC,GAAG,UAAU,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;AACxI,CAAC;AACD,OAAO,CAAC,SAAS,GAAG,SAAS;;"}
|
|
@@ -159,7 +159,7 @@ function transformFunctionHandler(handlers, functionFieldName) {
|
|
|
159
159
|
return { gqlHandlerContent, lambdaFunctionDefinition };
|
|
160
160
|
}
|
|
161
161
|
function customOperationToGql(typeName, typeDef, authorization, isCustom = false, databaseType, getRefType) {
|
|
162
|
-
const { arguments: fieldArgs, typeName: opType, returnType,
|
|
162
|
+
const { arguments: fieldArgs, typeName: opType, returnType, handlers, subscriptionSource, } = typeDef.data;
|
|
163
163
|
let callSignature = typeName;
|
|
164
164
|
const implicitModels = [];
|
|
165
165
|
const { authString } = isCustom
|
|
@@ -224,9 +224,6 @@ function customOperationToGql(typeName, typeDef, authorization, isCustom = false
|
|
|
224
224
|
if (isFunctionHandler(handlers)) {
|
|
225
225
|
({ gqlHandlerContent, lambdaFunctionDefinition } = transformFunctionHandler(handlers, typeName));
|
|
226
226
|
}
|
|
227
|
-
else if (functionRef) {
|
|
228
|
-
gqlHandlerContent = `@function(name: "${functionRef}") `;
|
|
229
|
-
}
|
|
230
227
|
else if (databaseType === 'sql' && handler && brand === 'inlineSql') {
|
|
231
228
|
gqlHandlerContent = `@sql(statement: ${escapeGraphQlString(String((0, Handler_1.getHandlerData)(handler)))}) `;
|
|
232
229
|
customSqlDataSourceStrategy = {
|
|
@@ -357,6 +354,19 @@ function validateImpliedFields(existing, implicitFields) {
|
|
|
357
354
|
}
|
|
358
355
|
}
|
|
359
356
|
}
|
|
357
|
+
function validateRefUseCases(referrerName, referrerType, fields, getRefType) {
|
|
358
|
+
const check = (fieldName, refLink, targetType) => {
|
|
359
|
+
const { def } = getRefType(refLink, referrerName);
|
|
360
|
+
if (isInternalModel(def)) {
|
|
361
|
+
throw new Error(`Cannot use \`.ref()\` to refer a model from a \`${targetType}\`. Field \`${fieldName}\` of \`${referrerName}\` refers to model \`${refLink}\``);
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
for (const [fieldName, field] of Object.entries(fields)) {
|
|
365
|
+
if (isRefField(field)) {
|
|
366
|
+
check(fieldName, field.data.link, referrerType === 'customType' ? 'custom type' : 'model');
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
360
370
|
/**
|
|
361
371
|
* Given a list of authorization rules, produces a set of the implied owner and/or
|
|
362
372
|
* group fields, along with the associated graphql `@auth` string directive.
|
|
@@ -684,6 +694,7 @@ const schemaPreprocessor = (schema) => {
|
|
|
684
694
|
}
|
|
685
695
|
else if (isCustomType(typeDef)) {
|
|
686
696
|
const fields = typeDef.data.fields;
|
|
697
|
+
validateRefUseCases(typeName, 'customType', fields, getRefType);
|
|
687
698
|
const fieldAuthApplicableFields = Object.fromEntries(Object.entries(fields).filter((pair) => isModelField(pair[1])));
|
|
688
699
|
const authString = '';
|
|
689
700
|
const authFields = {};
|
|
@@ -720,6 +731,7 @@ const schemaPreprocessor = (schema) => {
|
|
|
720
731
|
}
|
|
721
732
|
else if (staticSchema) {
|
|
722
733
|
const fields = { ...typeDef.data.fields };
|
|
734
|
+
validateRefUseCases(typeName, 'model', fields, getRefType);
|
|
723
735
|
const identifier = typeDef.data.identifier;
|
|
724
736
|
const [partitionKey] = identifier;
|
|
725
737
|
const { authString, authFields } = calculateAuth(mostRelevantAuthRules);
|
|
@@ -742,6 +754,7 @@ const schemaPreprocessor = (schema) => {
|
|
|
742
754
|
}
|
|
743
755
|
else {
|
|
744
756
|
const fields = typeDef.data.fields;
|
|
757
|
+
validateRefUseCases(typeName, 'model', fields, getRefType);
|
|
745
758
|
const identifier = typeDef.data.identifier;
|
|
746
759
|
const [partitionKey] = identifier;
|
|
747
760
|
const transformedSecondaryIndexes = transformedSecondaryIndexesForModel(typeName, typeDef.data.secondaryIndexes, fields, getRefType);
|
|
@@ -773,9 +786,8 @@ const schemaPreprocessor = (schema) => {
|
|
|
773
786
|
};
|
|
774
787
|
};
|
|
775
788
|
function validateCustomOperations(typeDef, typeName, authRules, getRefType) {
|
|
776
|
-
const {
|
|
777
|
-
|
|
778
|
-
const handlerConfigured = functionRef !== null || handlers?.length;
|
|
789
|
+
const { handlers, typeName: opType, subscriptionSource } = typeDef.data;
|
|
790
|
+
const handlerConfigured = handlers?.length;
|
|
779
791
|
const authConfigured = authRules.length > 0;
|
|
780
792
|
if ((authConfigured && !handlerConfigured) ||
|
|
781
793
|
(handlerConfigured && !authConfigured)) {
|
|
@@ -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, 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, 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 models.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 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, 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};\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, 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, 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,I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C,MAAM,GAAG,CAAC,EAAE;AAC5B,QAAQ,KAAK,CAAC,IAAI,CAAC,CAAC,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 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 (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}\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 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, 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 models.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 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, 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};\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 validateRefUseCases(typeName, 'customType', fields, getRefType);\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 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, 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 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, 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 { 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, 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,QAAQ,CAAC,CAAC;AACjC,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACvC,MAAM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AO,CAAC,aAAa,GAAG,aAAa;;"}
|
|
@@ -14,7 +14,6 @@ type CustomArguments = Record<string, ModelField<any, any> | EnumType<EnumTypePa
|
|
|
14
14
|
type SubscriptionSource = RefType<any, any>;
|
|
15
15
|
type InternalSubscriptionSource = InternalRef;
|
|
16
16
|
type CustomReturnType = RefType<any> | CustomType<any>;
|
|
17
|
-
type CustomFunctionRefType = string;
|
|
18
17
|
type InternalCustomArguments = Record<string, InternalField>;
|
|
19
18
|
type InternalCustomReturnType = InternalRef;
|
|
20
19
|
type HandlerInputType = FunctionHandler[] | CustomHandler[] | Handler;
|
|
@@ -23,7 +22,6 @@ type CustomOperationName = (typeof CustomOperationNames)[number];
|
|
|
23
22
|
type CustomData = {
|
|
24
23
|
arguments: CustomArguments;
|
|
25
24
|
returnType: CustomReturnType | null;
|
|
26
|
-
functionRef: string | null;
|
|
27
25
|
authorization: Authorization<any, any, any>[];
|
|
28
26
|
typeName: CustomOperationName;
|
|
29
27
|
handlers: Handler[] | null;
|
|
@@ -32,14 +30,12 @@ type CustomData = {
|
|
|
32
30
|
type InternalCustomData = CustomData & {
|
|
33
31
|
arguments: InternalCustomArguments;
|
|
34
32
|
returnType: InternalCustomReturnType;
|
|
35
|
-
functionRef: string | null;
|
|
36
33
|
subscriptionSource: InternalSubscriptionSource[];
|
|
37
34
|
authorization: Authorization<any, any, any>[];
|
|
38
35
|
};
|
|
39
36
|
export type CustomOperationParamShape = {
|
|
40
37
|
arguments: CustomArguments | null;
|
|
41
38
|
returnType: CustomReturnType | null;
|
|
42
|
-
functionRef: string | null;
|
|
43
39
|
authorization: Authorization<any, any, any>[];
|
|
44
40
|
typeName: CustomOperationName;
|
|
45
41
|
handlers: Handler | null;
|
|
@@ -47,15 +43,6 @@ export type CustomOperationParamShape = {
|
|
|
47
43
|
export type CustomOperation<T extends CustomOperationParamShape, K extends keyof CustomOperation<T> = never, B extends CustomOperationBrand = CustomOperationBrand> = Omit<{
|
|
48
44
|
arguments<Arguments extends CustomArguments>(args: Arguments): CustomOperation<SetTypeSubArg<T, 'arguments', Arguments>, K | 'arguments', B>;
|
|
49
45
|
returns<ReturnType extends CustomReturnType>(returnType: ReturnType): CustomOperation<SetTypeSubArg<T, 'returnType', ReturnType>, K | 'returns', B>;
|
|
50
|
-
/**
|
|
51
|
-
*
|
|
52
|
-
* @deprecated
|
|
53
|
-
* `.function` should no longer be used and will be removed
|
|
54
|
-
* in the next minor version of this package.
|
|
55
|
-
*
|
|
56
|
-
* Use `.handler(a.handler.function())` instead
|
|
57
|
-
*/
|
|
58
|
-
function<FunctionRef extends CustomFunctionRefType>(functionRefOrName: FunctionRef): CustomOperation<SetTypeSubArg<T, 'functionRef', FunctionRef>, K | 'function', B>;
|
|
59
46
|
authorization<AuthRuleType extends Authorization<any, any, any>>(callback: (allow: AllowModifierForCustomOperation) => AuthRuleType | AuthRuleType[]): CustomOperation<SetTypeSubArg<T, 'authorization', AuthRuleType[]>, K | 'authorization', B>;
|
|
60
47
|
handler<H extends HandlerInputType>(handlers: H): CustomOperation<T, K | 'handler', B>;
|
|
61
48
|
for<Source extends SubscriptionSource>(source: Source | Source[]): CustomOperation<T['typeName'] extends 'Subscription' ? SetTypeSubArg<T, 'returnType', Source extends SubscriptionSource[] ? Source[number] : Source> : T, K | 'for', B>;
|
|
@@ -71,7 +58,6 @@ export type QueryCustomOperation = CustomOperation<CustomOperationParamShape, an
|
|
|
71
58
|
export declare function query(): CustomOperation<{
|
|
72
59
|
arguments: null;
|
|
73
60
|
returnType: null;
|
|
74
|
-
functionRef: null;
|
|
75
61
|
authorization: [];
|
|
76
62
|
typeName: 'Query';
|
|
77
63
|
handlers: null;
|
|
@@ -80,7 +66,6 @@ export type MutationCustomOperation = CustomOperation<CustomOperationParamShape,
|
|
|
80
66
|
export declare function mutation(): CustomOperation<{
|
|
81
67
|
arguments: null;
|
|
82
68
|
returnType: null;
|
|
83
|
-
functionRef: null;
|
|
84
69
|
authorization: [];
|
|
85
70
|
typeName: 'Mutation';
|
|
86
71
|
handlers: null;
|
|
@@ -89,7 +74,6 @@ export type SubscriptionCustomOperation = CustomOperation<CustomOperationParamSh
|
|
|
89
74
|
export declare function subscription(): CustomOperation<{
|
|
90
75
|
arguments: null;
|
|
91
76
|
returnType: null;
|
|
92
|
-
functionRef: null;
|
|
93
77
|
authorization: [];
|
|
94
78
|
typeName: 'Subscription';
|
|
95
79
|
handlers: null;
|