diff --git a/packages/amplify-graphql-conversation-transformer/package.json b/packages/amplify-graphql-conversation-transformer/package.json index 847775d3f4..ebe8761d8a 100644 --- a/packages/amplify-graphql-conversation-transformer/package.json +++ b/packages/amplify-graphql-conversation-transformer/package.json @@ -19,7 +19,7 @@ "build": "tsc && yarn copy-js-resolver-templates", "watch": "tsc -w", "clean": "rimraf ./lib", - "copy-js-resolver-templates": "cp ./src/resolvers/*.js.template ./lib/resolvers", + "copy-js-resolver-templates": "cp ./src/resolvers/*.template.js ./lib/resolvers", "test": "jest", "extract-api": "ts-node ../../scripts/extract-api.ts" }, diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-messages-subscription-resolver-fn.js.template b/packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-messages-subscription-resolver-fn.template.js similarity index 100% rename from packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-messages-subscription-resolver-fn.js.template rename to packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-messages-subscription-resolver-fn.template.js diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-messages-subscription-resolver.ts b/packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-messages-subscription-resolver.ts index 6f5fefe380..18dd96d009 100644 --- a/packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-messages-subscription-resolver.ts +++ b/packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-messages-subscription-resolver.ts @@ -11,7 +11,7 @@ import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-tran * @returns {MappingTemplateProvider} An object containing request and response MappingTemplateProviders. */ export const conversationMessageSubscriptionMappingTamplate = (config: ConversationDirectiveConfiguration): MappingTemplateProvider => { - const resolver = fs.readFileSync(path.join(__dirname, 'assistant-messages-subscription-resolver-fn.js.template'), 'utf8'); + const resolver = fs.readFileSync(path.join(__dirname, 'assistant-messages-subscription-resolver-fn.template.js'), 'utf8'); const templateName = `Subscription.${config.field.name.value}.assistant-message.js`; return MappingTemplate.s3MappingFunctionCodeFromString(resolver, templateName); }; diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-mutation-resolver-fn.js.template b/packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-mutation-resolver-fn.template.js similarity index 100% rename from packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-mutation-resolver-fn.js.template rename to packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-mutation-resolver-fn.template.js diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-mutation-resolver.ts b/packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-mutation-resolver.ts index 97326a84d3..ebfcf45d5e 100644 --- a/packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-mutation-resolver.ts +++ b/packages/amplify-graphql-conversation-transformer/src/resolvers/assistant-mutation-resolver.ts @@ -11,7 +11,7 @@ import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-tran * @returns {MappingTemplateProvider} An object containing request and response MappingTemplateProviders. */ export const assistantMutationResolver = (config: ConversationDirectiveConfiguration): MappingTemplateProvider => { - const resolver = fs.readFileSync(path.join(__dirname, 'assistant-mutation-resolver-fn.js.template'), 'utf8'); + const resolver = fs.readFileSync(path.join(__dirname, 'assistant-mutation-resolver-fn.template.js'), 'utf8'); const templateName = `Mutation.${config.field.name.value}.assistant-response.js`; return MappingTemplate.s3MappingFunctionCodeFromString(resolver, templateName); }; diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/auth-resolver-fn.js.template b/packages/amplify-graphql-conversation-transformer/src/resolvers/auth-resolver-fn.template.js similarity index 100% rename from packages/amplify-graphql-conversation-transformer/src/resolvers/auth-resolver-fn.js.template rename to packages/amplify-graphql-conversation-transformer/src/resolvers/auth-resolver-fn.template.js diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/auth-resolver.ts b/packages/amplify-graphql-conversation-transformer/src/resolvers/auth-resolver.ts index 57bd987b5f..0766e0cfc8 100644 --- a/packages/amplify-graphql-conversation-transformer/src/resolvers/auth-resolver.ts +++ b/packages/amplify-graphql-conversation-transformer/src/resolvers/auth-resolver.ts @@ -11,7 +11,7 @@ import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-tran * @returns {MappingTemplateProvider} An object containing request and response MappingTemplateProviders. */ export const authMappingTemplate = (config: ConversationDirectiveConfiguration): MappingTemplateProvider => { - const resolver = fs.readFileSync(path.join(__dirname, 'auth-resolver-fn.js.template'), 'utf8'); + const resolver = fs.readFileSync(path.join(__dirname, 'auth-resolver-fn.template.js'), 'utf8'); const templateName = `Mutation.${config.field.name.value}.auth.js`; return MappingTemplate.s3MappingFunctionCodeFromString(resolver, templateName); }; diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/init-resolver-fn.js.template b/packages/amplify-graphql-conversation-transformer/src/resolvers/init-resolver-fn.template.js similarity index 100% rename from packages/amplify-graphql-conversation-transformer/src/resolvers/init-resolver-fn.js.template rename to packages/amplify-graphql-conversation-transformer/src/resolvers/init-resolver-fn.template.js diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/init-resolver.ts b/packages/amplify-graphql-conversation-transformer/src/resolvers/init-resolver.ts index 15767679ee..5683b01e24 100644 --- a/packages/amplify-graphql-conversation-transformer/src/resolvers/init-resolver.ts +++ b/packages/amplify-graphql-conversation-transformer/src/resolvers/init-resolver.ts @@ -11,7 +11,7 @@ import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-tran * @returns {MappingTemplateProvider} An object containing request and response MappingTemplateProviders. */ export const initMappingTemplate = (config: ConversationDirectiveConfiguration): MappingTemplateProvider => { - const resolver = fs.readFileSync(path.join(__dirname, 'init-resolver-fn.js.template'), 'utf8'); + const resolver = fs.readFileSync(path.join(__dirname, 'init-resolver-fn.template.js'), 'utf8'); const templateName = `Mutation.${config.field.name.value}.init.js`; return MappingTemplate.s3MappingFunctionCodeFromString(resolver, templateName); }; diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/invoke-lambda-resolver-fn.js.template b/packages/amplify-graphql-conversation-transformer/src/resolvers/invoke-lambda-resolver-fn.template.js similarity index 100% rename from packages/amplify-graphql-conversation-transformer/src/resolvers/invoke-lambda-resolver-fn.js.template rename to packages/amplify-graphql-conversation-transformer/src/resolvers/invoke-lambda-resolver-fn.template.js diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/invoke-lambda-resolver.ts b/packages/amplify-graphql-conversation-transformer/src/resolvers/invoke-lambda-resolver.ts index 4e63840775..b869a4d69f 100644 --- a/packages/amplify-graphql-conversation-transformer/src/resolvers/invoke-lambda-resolver.ts +++ b/packages/amplify-graphql-conversation-transformer/src/resolvers/invoke-lambda-resolver.ts @@ -35,7 +35,7 @@ export const invokeLambdaMappingTemplate = ( MESSAGE_MODEL_NAME, }; - let resolver = fs.readFileSync(path.join(__dirname, 'invoke-lambda-resolver-fn.js.template'), 'utf8'); + let resolver = fs.readFileSync(path.join(__dirname, 'invoke-lambda-resolver-fn.template.js'), 'utf8'); Object.entries(substitutions).forEach(([key, value]) => { const replaced = resolver.replace(new RegExp(`\\[\\[${key}\\]\\]`, 'g'), value); resolver = replaced; diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/message-history-resolver-fn.js.template b/packages/amplify-graphql-conversation-transformer/src/resolvers/message-history-resolver-fn.template.js similarity index 100% rename from packages/amplify-graphql-conversation-transformer/src/resolvers/message-history-resolver-fn.js.template rename to packages/amplify-graphql-conversation-transformer/src/resolvers/message-history-resolver-fn.template.js diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/message-history-resolver.ts b/packages/amplify-graphql-conversation-transformer/src/resolvers/message-history-resolver.ts index 490818c5d1..ce56cfa558 100644 --- a/packages/amplify-graphql-conversation-transformer/src/resolvers/message-history-resolver.ts +++ b/packages/amplify-graphql-conversation-transformer/src/resolvers/message-history-resolver.ts @@ -10,7 +10,7 @@ import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-tran * @returns {MappingTemplateProvider} An object containing request and response mapping functions. */ export const readHistoryMappingTemplate = (config: ConversationDirectiveConfiguration): MappingTemplateProvider => { - const resolver = fs.readFileSync(path.join(__dirname, 'message-history-resolver-fn.js.template'), 'utf8'); + const resolver = fs.readFileSync(path.join(__dirname, 'message-history-resolver-fn.template.js'), 'utf8'); const templateName = `Mutation.${config.field.name.value}.message-history.js`; return MappingTemplate.s3MappingFunctionCodeFromString(resolver, templateName); }; diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/verify-session-owner-resolver-fn.js.template b/packages/amplify-graphql-conversation-transformer/src/resolvers/verify-session-owner-resolver-fn.template.js similarity index 100% rename from packages/amplify-graphql-conversation-transformer/src/resolvers/verify-session-owner-resolver-fn.js.template rename to packages/amplify-graphql-conversation-transformer/src/resolvers/verify-session-owner-resolver-fn.template.js diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/verify-session-owner-resolver.ts b/packages/amplify-graphql-conversation-transformer/src/resolvers/verify-session-owner-resolver.ts index fcb4682441..0624e1c9d5 100644 --- a/packages/amplify-graphql-conversation-transformer/src/resolvers/verify-session-owner-resolver.ts +++ b/packages/amplify-graphql-conversation-transformer/src/resolvers/verify-session-owner-resolver.ts @@ -10,7 +10,7 @@ import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-tran * @returns {MappingTemplateProvider} An object containing request and response MappingTemplateProviders. */ export const verifySessionOwnerMappingTemplate = (config: ConversationDirectiveConfiguration): MappingTemplateProvider => { - const resolver = fs.readFileSync(path.join(__dirname, 'verify-session-owner-resolver-fn.js.template'), 'utf8'); + const resolver = fs.readFileSync(path.join(__dirname, 'verify-session-owner-resolver-fn.template.js'), 'utf8'); const templateName = `Mutation.${config.field.name.value}.verify-session-owner.js`; return MappingTemplate.s3MappingFunctionCodeFromString(resolver, templateName); }; diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/write-message-to-table-resolver-fn.js.template b/packages/amplify-graphql-conversation-transformer/src/resolvers/write-message-to-table-resolver-fn.template.js similarity index 100% rename from packages/amplify-graphql-conversation-transformer/src/resolvers/write-message-to-table-resolver-fn.js.template rename to packages/amplify-graphql-conversation-transformer/src/resolvers/write-message-to-table-resolver-fn.template.js diff --git a/packages/amplify-graphql-conversation-transformer/src/resolvers/write-message-to-table-resolver.ts b/packages/amplify-graphql-conversation-transformer/src/resolvers/write-message-to-table-resolver.ts index 2279fa0cac..cf9848dc01 100644 --- a/packages/amplify-graphql-conversation-transformer/src/resolvers/write-message-to-table-resolver.ts +++ b/packages/amplify-graphql-conversation-transformer/src/resolvers/write-message-to-table-resolver.ts @@ -12,7 +12,7 @@ export const writeMessageToTableMappingTemplate = (fieldName: string): MappingTe const substitutions = { CONVERSATION_MESSAGE_TYPE_NAME: `ConversationMessage${fieldName}`, }; - let resolver = fs.readFileSync(path.join(__dirname, 'write-message-to-table-resolver-fn.js.template'), 'utf8'); + let resolver = fs.readFileSync(path.join(__dirname, 'write-message-to-table-resolver-fn.template.js'), 'utf8'); Object.entries(substitutions).forEach(([key, value]) => { const replaced = resolver.replace(new RegExp(`\\[\\[${key}\\]\\]`, 'g'), value); resolver = replaced;