diff --git a/packages/amplify-graphql-index-transformer/src/__tests__/__snapshots__/amplify-graphql-index-transformer.test.ts.snap b/packages/amplify-graphql-index-transformer/src/__tests__/__snapshots__/amplify-graphql-index-transformer.test.ts.snap index bd380a65119..d8ca8ecf2f5 100644 --- a/packages/amplify-graphql-index-transformer/src/__tests__/__snapshots__/amplify-graphql-index-transformer.test.ts.snap +++ b/packages/amplify-graphql-index-transformer/src/__tests__/__snapshots__/amplify-graphql-index-transformer.test.ts.snap @@ -764,9 +764,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -779,9 +779,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onUpdateTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -794,9 +794,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", } `; @@ -1466,9 +1466,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -1481,9 +1481,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onUpdateTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -1496,9 +1496,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", } `; @@ -2324,9 +2324,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -2339,9 +2339,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onUpdateTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -2354,9 +2354,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", } `; @@ -3438,9 +3438,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -3453,9 +3453,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onUpdateTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -3468,9 +3468,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", } `; @@ -11500,9 +11500,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateBlog.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateBlog.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onCreateContentCategory.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -11515,9 +11515,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateContentCategory.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateContentCategory.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onCreateItem.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -11530,9 +11530,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateItem.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateItem.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onCreateTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -11545,9 +11545,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onCreateTodo.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -11560,9 +11560,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateTodo.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateTodo.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteBlog.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -11575,9 +11575,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteBlog.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteBlog.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteContentCategory.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -11590,9 +11590,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteContentCategory.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteContentCategory.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteItem.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -11605,9 +11605,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteItem.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteItem.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -11620,9 +11620,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteTodo.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -11635,9 +11635,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteTodo.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteTodo.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onUpdateBlog.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -11650,9 +11650,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onUpdateBlog.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onUpdateBlog.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onUpdateItem.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -11665,9 +11665,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onUpdateItem.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onUpdateItem.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onUpdateTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -11680,9 +11680,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onUpdateTodo.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -11695,8 +11695,8 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onUpdateTodo.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onUpdateTodo.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", } `; diff --git a/packages/amplify-graphql-index-transformer/src/__tests__/__snapshots__/amplify-graphql-primary-key-transformer.test.ts.snap b/packages/amplify-graphql-index-transformer/src/__tests__/__snapshots__/amplify-graphql-primary-key-transformer.test.ts.snap index 363263ed2ec..720b0ac0b31 100644 --- a/packages/amplify-graphql-index-transformer/src/__tests__/__snapshots__/amplify-graphql-primary-key-transformer.test.ts.snap +++ b/packages/amplify-graphql-index-transformer/src/__tests__/__snapshots__/amplify-graphql-primary-key-transformer.test.ts.snap @@ -619,9 +619,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -634,9 +634,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onUpdateTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -649,9 +649,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", } `; @@ -1214,9 +1214,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -1229,9 +1229,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onUpdateTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -1244,9 +1244,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", } `; @@ -1762,9 +1762,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -1777,9 +1777,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onUpdateTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -1792,9 +1792,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", } `; @@ -2357,9 +2357,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -2372,9 +2372,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onUpdateTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -2387,9 +2387,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", } `; @@ -3453,9 +3453,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -3468,9 +3468,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onUpdateTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -3483,9 +3483,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", } `; @@ -4546,9 +4546,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onCreateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onDeleteTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -4561,9 +4561,9 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onDeleteTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", "Subscription.onUpdateTest.postAuth.1.req.vtl": "## [Start] Sandbox Mode Disabled. ** #if( !$ctx.stash.get(\\"hasAuth\\") ) $util.unauthorized() @@ -4576,8 +4576,8 @@ $util.toJson({ \\"payload\\": {} }) ## [End] Subscription Request template. **", - "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Resonse template. ** + "Subscription.onUpdateTest.res.vtl": "## [Start] Subscription Response template. ** $util.toJson(null) -## [End] Subscription Resonse template. **", +## [End] Subscription Response template. **", } `; diff --git a/packages/amplify-provider-awscloudformation/src/__tests__/utils/sandbox-mode-helpers.test.ts b/packages/amplify-provider-awscloudformation/src/__tests__/utils/sandbox-mode-helpers.test.ts index 47ec69fdfec..962baa21466 100644 --- a/packages/amplify-provider-awscloudformation/src/__tests__/utils/sandbox-mode-helpers.test.ts +++ b/packages/amplify-provider-awscloudformation/src/__tests__/utils/sandbox-mode-helpers.test.ts @@ -1,18 +1,13 @@ -import * as helpers from '../../utils/sandbox-mode-helpers'; +import { showSandboxModePrompts } from '../../utils/sandbox-mode-helpers'; import { $TSContext } from 'amplify-cli-core'; import chalk from 'chalk'; import * as prompts from 'amplify-prompts'; -import * as api from 'amplify-category-api'; import * as apiKeyHelpers from '../../utils/api-key-helpers'; let ctx; let apiKeyActive = true; let apiKeyPresent = true; -jest.mock('amplify-category-api', () => ({ - promptToAddApiKey: jest.fn(), -})); - describe('sandbox mode helpers', () => { beforeEach(() => { const envName = 'dev'; @@ -21,12 +16,11 @@ describe('sandbox mode helpers', () => { getEnvInfo() { return { envName }; }, + invokePluginMethod: jest.fn(), }, } as unknown as $TSContext; jest.spyOn(prompts.printer, 'info').mockImplementation(); - jest.spyOn(api, 'promptToAddApiKey'); - jest.spyOn(apiKeyHelpers, 'apiKeyIsActive').mockReturnValue(apiKeyActive); jest.spyOn(apiKeyHelpers, 'hasApiKey').mockReturnValue(apiKeyPresent); }); @@ -38,7 +32,7 @@ describe('sandbox mode helpers', () => { }); it('displays warning', async () => { - await helpers.showSandboxModePrompts(ctx); + await showSandboxModePrompts(ctx); expect(prompts.printer.info).toBeCalledWith( ` @@ -49,7 +43,7 @@ sandbox mode disabled in '${ctx.amplify.getEnvInfo().envName}', do not create an `, 'yellow', ); - expect(api.promptToAddApiKey).toBeCalledWith(ctx); + expect(ctx.amplify.invokePluginMethod).toBeCalledWith(ctx, 'api', undefined, 'promptToAddApiKey', [ctx]); }); }); @@ -59,7 +53,7 @@ sandbox mode disabled in '${ctx.amplify.getEnvInfo().envName}', do not create an }); it('displays warning', async () => { - await helpers.showSandboxModePrompts(ctx); + await showSandboxModePrompts(ctx); expect(prompts.printer.info).toBeCalledWith( ` @@ -70,7 +64,7 @@ sandbox mode disabled in '${ctx.amplify.getEnvInfo().envName}', do not create an `, 'yellow', ); - expect(api.promptToAddApiKey).toBeCalledWith(ctx); + expect(ctx.amplify.invokePluginMethod).toBeCalledWith(ctx, 'api', undefined, 'promptToAddApiKey', [ctx]); }); }); }); diff --git a/packages/amplify-provider-awscloudformation/src/utils/sandbox-mode-helpers.ts b/packages/amplify-provider-awscloudformation/src/utils/sandbox-mode-helpers.ts index fa160b91ba5..8f761dbdef8 100644 --- a/packages/amplify-provider-awscloudformation/src/utils/sandbox-mode-helpers.ts +++ b/packages/amplify-provider-awscloudformation/src/utils/sandbox-mode-helpers.ts @@ -1,6 +1,5 @@ import chalk from 'chalk'; import { $TSContext } from 'amplify-cli-core'; -import { promptToAddApiKey } from 'amplify-category-api'; import { getApiKeyConfig, apiKeyIsActive, hasApiKey } from './api-key-helpers'; import { printer } from 'amplify-prompts'; @@ -15,7 +14,7 @@ sandbox mode disabled in '${context.amplify.getEnvInfo().envName}', do not creat `, 'yellow', ); - return await promptToAddApiKey(context); + return await context.amplify.invokePluginMethod(context, 'api', undefined, 'promptToAddApiKey', [context]); } else { showGlobalSandboxModeWarning(); return;