Skip to content

Commit

Permalink
chore(geo): release @aws-amplify/geo@geo 9/13/21 (#8887)
Browse files Browse the repository at this point in the history
* feat(geo): add region to Amazon Location Service MapStyle (#8736)

* chore(geo): Update name for amazon location service provider (#8872)

* chore: merge `main` into `geo/staging` (#8875)

* added removePluggable function to PubSub to be able to swap providers as needed.

* chore: preparing release

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.17
 - @aws-amplify/ui-components@1.7.1
 - @aws-amplify/ui-react@1.2.8
 - @aws-amplify/ui-storybook@2.0.8
 - @aws-amplify/ui-vue@1.1.2
 - @aws-amplify/analytics@5.0.8
 - @aws-amplify/api-graphql@2.1.0
 - @aws-amplify/api-rest@2.0.8
 - @aws-amplify/api@4.0.8
 - @aws-amplify/auth@4.2.0
 - aws-amplify-angular@6.0.8
 - aws-amplify-react@5.0.8
 - aws-amplify@4.2.2
 - @aws-amplify/cache@4.0.10
 - @aws-amplify/core@4.2.2
 - @aws-amplify/datastore@3.3.0
 - @aws-amplify/interactions@4.0.8
 - @aws-amplify/predictions@4.0.8
 - @aws-amplify/pubsub@4.1.0
 - @aws-amplify/pushnotification@4.2.2
 - @aws-amplify/storage@4.3.3
 - @aws-amplify/xr@3.0.8

* chore(release): update version.ts [ci skip]

* Dispose of ?code on error and success (#8166)

Co-authored-by: Manuel Iglesias <6154160+manueliglesias@users.noreply.github.com>

* chore(geo): add Geo to main readme (#8702)

* fix(@aws-amplify/core): Include refreshToken in UniversalStorage for SSR (#7374)

Co-authored-by: Sam Martinez <samlmar@amazon.com>
Co-authored-by: Manuel Iglesias <6154160+manueliglesias@users.noreply.github.com>

* Fix Storage.put SSE-c bug (#8380)

* SSE config fix for get and put

Co-authored-by: Manuel Iglesias <6154160+manueliglesias@users.noreply.github.com>

* fix: function parameters partiy with signIn (#8713)

Co-authored-by: Manoj NB <manojnb@amazon.com>

* fix(@aws-amplify/ui-components): Remove local storage check (#8730)

* chore: preparing release

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.18
 - @aws-amplify/ui-components@1.7.2
 - @aws-amplify/ui-react@1.2.9
 - @aws-amplify/ui-storybook@2.0.9
 - @aws-amplify/ui-vue@1.1.3
 - @aws-amplify/analytics@5.0.9
 - @aws-amplify/api-graphql@2.1.1
 - @aws-amplify/api-rest@2.0.9
 - @aws-amplify/api@4.0.9
 - @aws-amplify/auth@4.2.1
 - aws-amplify-angular@6.0.9
 - aws-amplify-react@5.0.9
 - aws-amplify@4.2.3
 - @aws-amplify/cache@4.0.11
 - @aws-amplify/core@4.2.3
 - @aws-amplify/datastore@3.3.1
 - @aws-amplify/interactions@4.0.9
 - @aws-amplify/predictions@4.0.9
 - @aws-amplify/pubsub@4.1.1
 - @aws-amplify/pushnotification@4.2.3
 - @aws-amplify/storage@4.3.4
 - @aws-amplify/xr@3.0.9

* chore(release): update version.ts [ci skip]

* feat(@aws-amplify/auth): Add a 'SUCCESS' response on successful call to forgotPasswordSubmit and verifyUserAttributes(#8744)

* added a success message on successful call to forgotPasswordSubmit function

* modified test to expect onSuccess to be called with 'SUCCESS' on successful confirmPassword()

* added 'SUCCESS' response on successful call to verifyUserAttribute

* chore: preparing release

* chore(release): Publish [ci skip]

 - amazon-cognito-identity-js@5.1.0
 - @aws-amplify/ui-angular@1.0.19
 - @aws-amplify/ui-components@1.7.3
 - @aws-amplify/ui-react@1.2.10
 - @aws-amplify/ui-storybook@2.0.10
 - @aws-amplify/ui-vue@1.1.4
 - @aws-amplify/analytics@5.0.10
 - @aws-amplify/api-graphql@2.1.2
 - @aws-amplify/api-rest@2.0.10
 - @aws-amplify/api@4.0.10
 - @aws-amplify/auth@4.3.0
 - aws-amplify-angular@6.0.10
 - aws-amplify-react@5.0.10
 - aws-amplify@4.2.4
 - @aws-amplify/cache@4.0.12
 - @aws-amplify/core@4.2.4
 - @aws-amplify/datastore@3.3.2
 - @aws-amplify/interactions@4.0.10
 - @aws-amplify/predictions@4.0.10
 - @aws-amplify/pubsub@4.1.2
 - @aws-amplify/pushnotification@4.2.4
 - @aws-amplify/storage@4.3.5
 - @aws-amplify/xr@3.0.10

* chore(release): update version.ts [ci skip]

* GH-4468: Transfer Acceleration can now be passed as a parameter to Storage.put() (#8750)

Co-authored-by: James Au <40404256+jamesaucode@users.noreply.github.com>

* refactor: change LogLevel of getCurrentUserInfo error (#8434)

Co-authored-by: Ashika <35131273+ashika01@users.noreply.github.com>

* Updates to the README (#8782)

* chore:Update NOTICE file to remove copyright date

* chore:Update README

* chore:Update based on feedback from pull request

* chore:Fix typos, remove redundancy

* chore:Fix typo within the documentation site

* chore(issue templates): update template picker for ui repo (#8556)

Co-authored-by: Eric Clemmons <eric@smarterspam.com>

* fix(@aws-amplify/datastore): check read-only at instance level (#8794)

* feat(@aws-amplify/api-graphql): Add support for string 'authmode' values in TypeScript based apps  (#8799)

* added string authmode values as allowed types

* refactoring and using existing types to allow string values for authMode

Co-authored-by: Ivan Artemiev <29709626+iartemiev@users.noreply.github.com>

* chore: preparing release

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.20
 - @aws-amplify/ui-components@1.7.4
 - @aws-amplify/ui-react@1.2.11
 - @aws-amplify/ui-storybook@2.0.11
 - @aws-amplify/ui-vue@1.1.5
 - @aws-amplify/analytics@5.0.11
 - @aws-amplify/api-graphql@2.2.0
 - @aws-amplify/api-rest@2.0.11
 - @aws-amplify/api@4.0.11
 - @aws-amplify/auth@4.3.1
 - aws-amplify-angular@6.0.11
 - aws-amplify-react@5.0.11
 - aws-amplify@4.2.5
 - @aws-amplify/cache@4.0.13
 - @aws-amplify/core@4.2.5
 - @aws-amplify/datastore@3.3.3
 - @aws-amplify/interactions@4.0.11
 - @aws-amplify/predictions@4.0.11
 - @aws-amplify/pubsub@4.1.3
 - @aws-amplify/pushnotification@4.2.5
 - @aws-amplify/storage@4.3.6
 - @aws-amplify/xr@3.0.11

* chore(release): update version.ts [ci skip]

* chore(gh action): reduce cron sched to once per day (#8721)

Co-authored-by: Ashika <35131273+ashika01@users.noreply.github.com>

* fix(@aws-amplify/datastore): remove conditional require (#8828)

* feat(@aws-amplify/datastore): add SQLite storage adapter option for RN apps (#8809)

* fix(@aws-amplify/datastore): patch immer vuln (#8841)

* chore: preparing release

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.21
 - @aws-amplify/ui-components@1.7.5
 - @aws-amplify/ui-react@1.2.12
 - @aws-amplify/ui-storybook@2.0.12
 - @aws-amplify/ui-vue@1.1.6
 - @aws-amplify/analytics@5.0.12
 - @aws-amplify/api-graphql@2.2.1
 - @aws-amplify/api-rest@2.0.12
 - @aws-amplify/api@4.0.12
 - @aws-amplify/auth@4.3.2
 - aws-amplify-angular@6.0.12
 - aws-amplify-react@5.0.12
 - aws-amplify@4.2.6
 - @aws-amplify/cache@4.0.14
 - @aws-amplify/core@4.2.6
 - @aws-amplify/datastore-storage-adapter@1.1.0
 - @aws-amplify/datastore@3.4.0
 - @aws-amplify/interactions@4.0.12
 - @aws-amplify/predictions@4.0.12
 - @aws-amplify/pubsub@4.1.4
 - @aws-amplify/pushnotification@4.2.6
 - @aws-amplify/storage@4.3.7
 - @aws-amplify/xr@3.0.12

* chore(release): update version.ts [ci skip]

* fix(@aws-amplify/datastore): only stringify nested AWSJSON in mutation event (#8844)

* chore: preparing release

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.22
 - @aws-amplify/ui-components@1.7.6
 - @aws-amplify/ui-react@1.2.13
 - @aws-amplify/ui-storybook@2.0.13
 - @aws-amplify/ui-vue@1.1.7
 - @aws-amplify/analytics@5.0.13
 - @aws-amplify/api-graphql@2.2.2
 - @aws-amplify/api-rest@2.0.13
 - @aws-amplify/api@4.0.13
 - @aws-amplify/auth@4.3.3
 - aws-amplify-angular@6.0.13
 - aws-amplify-react@5.0.13
 - aws-amplify@4.2.7
 - @aws-amplify/cache@4.0.15
 - @aws-amplify/core@4.2.7
 - @aws-amplify/datastore-storage-adapter@1.1.1
 - @aws-amplify/datastore@3.4.1
 - @aws-amplify/interactions@4.0.13
 - @aws-amplify/predictions@4.0.13
 - @aws-amplify/pubsub@4.1.5
 - @aws-amplify/pushnotification@4.2.7
 - @aws-amplify/storage@4.3.8
 - @aws-amplify/xr@3.0.13

* chore(release): update version.ts [ci skip]

* Modified removePluggable to remove pluggable based on providerName. Updated tests to test if removing then adding a pluggable will replace original.

* chore(fix axios version): patch security vuln for api-rest and storage (#8858)

* chore: preparing release

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.23
 - @aws-amplify/ui-components@1.7.7
 - @aws-amplify/ui-react@1.2.14
 - @aws-amplify/ui-storybook@2.0.14
 - @aws-amplify/ui-vue@1.1.8
 - @aws-amplify/analytics@5.0.14
 - @aws-amplify/api-graphql@2.2.3
 - @aws-amplify/api-rest@2.0.14
 - @aws-amplify/api@4.0.14
 - @aws-amplify/auth@4.3.4
 - aws-amplify-angular@6.0.14
 - aws-amplify-react@5.0.14
 - aws-amplify@4.2.8
 - @aws-amplify/cache@4.0.16
 - @aws-amplify/core@4.2.8
 - @aws-amplify/datastore-storage-adapter@1.1.2
 - @aws-amplify/datastore@3.4.2
 - @aws-amplify/interactions@4.0.14
 - @aws-amplify/predictions@4.0.14
 - @aws-amplify/pubsub@4.1.6
 - @aws-amplify/pushnotification@4.2.8
 - @aws-amplify/storage@4.3.9
 - @aws-amplify/xr@3.0.14

* chore(release): update version.ts [ci skip]

* chore(@aws-amplify/pubsub): Add JSDoc to removePluggable function; Update removePluggable unit test so that it fails if plugin is not removed; Format recent changes using Prettier

* chore(@aws-amplify/pubsub): minor update to removePluggable unit test

* chore: preparing release

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.24
 - @aws-amplify/ui-components@1.7.8
 - @aws-amplify/ui-react@1.2.15
 - @aws-amplify/ui-storybook@2.0.15
 - @aws-amplify/ui-vue@1.1.9
 - @aws-amplify/analytics@5.0.15
 - @aws-amplify/api-graphql@2.2.4
 - @aws-amplify/api-rest@2.0.15
 - @aws-amplify/api@4.0.15
 - @aws-amplify/auth@4.3.5
 - aws-amplify-angular@6.0.15
 - aws-amplify-react@5.0.15
 - aws-amplify@4.2.9
 - @aws-amplify/cache@4.0.17
 - @aws-amplify/core@4.2.9
 - @aws-amplify/datastore-storage-adapter@1.1.3
 - @aws-amplify/datastore@3.4.3
 - @aws-amplify/interactions@4.0.15
 - @aws-amplify/predictions@4.0.15
 - @aws-amplify/pubsub@4.1.7
 - @aws-amplify/pushnotification@4.2.9
 - @aws-amplify/storage@4.3.10
 - @aws-amplify/xr@3.0.15

* chore(release): update version.ts [ci skip]

* chore(geo): bring core version up to date

Co-authored-by: ZacharyRogers <ztrogers1@gmail.com>
Co-authored-by: Manuel Iglesias <6154160+manueliglesias@users.noreply.github.com>
Co-authored-by: aws-amplify-bot <aws@amazon.com>
Co-authored-by: Eric Clemmons <eric@smarterspam.com>
Co-authored-by: Sam Martinez <samlmar@amazon.com>
Co-authored-by: James Au <40404256+jamesaucode@users.noreply.github.com>
Co-authored-by: ManojNB <manojnb95@gmail.com>
Co-authored-by: Manoj NB <manojnb@amazon.com>
Co-authored-by: William Lee <43682783+wlee221@users.noreply.github.com>
Co-authored-by: Nick Arocho <nicaroch@amazon.com>
Co-authored-by: Khairo Khatib <59224303+Khairo-kh@users.noreply.github.com>
Co-authored-by: evcodes <eddvar@amazon.com>
Co-authored-by: Carlos Espin <65199391+cespin@users.noreply.github.com>
Co-authored-by: h-kishi <h-kishi@users.noreply.github.com>
Co-authored-by: Ashika <35131273+ashika01@users.noreply.github.com>
Co-authored-by: siegerts <stephen.siegert@gmail.com>
Co-authored-by: Ivan Artemiev <29709626+iartemiev@users.noreply.github.com>
Co-authored-by: James Au <auchu@amazon.com>
Co-authored-by: hkjpotato <hkjpotato@gmail.com>
Co-authored-by: David McAfee <mcafd@amazon.com>

* fix(@aws-amplify/geo): Update webpack config to mark core as external (#8748)

Co-authored-by: Amplifiyer <51211245+Amplifiyer@users.noreply.github.com>
Co-authored-by: ZacharyRogers <ztrogers1@gmail.com>
Co-authored-by: Manuel Iglesias <6154160+manueliglesias@users.noreply.github.com>
Co-authored-by: aws-amplify-bot <aws@amazon.com>
Co-authored-by: Eric Clemmons <eric@smarterspam.com>
Co-authored-by: Sam Martinez <samlmar@amazon.com>
Co-authored-by: James Au <40404256+jamesaucode@users.noreply.github.com>
Co-authored-by: ManojNB <manojnb95@gmail.com>
Co-authored-by: Manoj NB <manojnb@amazon.com>
Co-authored-by: William Lee <43682783+wlee221@users.noreply.github.com>
Co-authored-by: Nick Arocho <nicaroch@amazon.com>
Co-authored-by: Khairo Khatib <59224303+Khairo-kh@users.noreply.github.com>
Co-authored-by: evcodes <eddvar@amazon.com>
Co-authored-by: Carlos Espin <65199391+cespin@users.noreply.github.com>
Co-authored-by: h-kishi <h-kishi@users.noreply.github.com>
Co-authored-by: Ashika <35131273+ashika01@users.noreply.github.com>
Co-authored-by: siegerts <stephen.siegert@gmail.com>
Co-authored-by: Ivan Artemiev <29709626+iartemiev@users.noreply.github.com>
Co-authored-by: James Au <auchu@amazon.com>
Co-authored-by: hkjpotato <hkjpotato@gmail.com>
Co-authored-by: David McAfee <mcafd@amazon.com>
  • Loading branch information
22 people committed Sep 23, 2021
1 parent cc48289 commit ca4e661
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 91 deletions.
6 changes: 3 additions & 3 deletions packages/core/__tests__/parseMobileHubConfig-test.ts
Expand Up @@ -12,7 +12,7 @@ describe('Parser', () => {
aws_user_pools_web_client_id: '',
aws_cognito_region: '',
geo: {
amazon_location_services: {
amazon_location_service: {
maps: {
items: {
geoJsExampleMap1: {
Expand Down Expand Up @@ -48,7 +48,7 @@ describe('Parser', () => {
userPoolWebClientId: '',
},
Geo: {
AmazonLocationServices: {
AmazonLocationService: {
maps: {
items: {
geoJsExampleMap1: {
Expand Down Expand Up @@ -76,7 +76,7 @@ describe('Parser', () => {
aws_user_pools_id: 'b',
aws_user_pools_web_client_id: '',
geo: {
amazon_location_services: {
amazon_location_service: {
maps: {
items: {
geoJsExampleMap1: {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/Parser.ts
Expand Up @@ -56,9 +56,9 @@ export const parseMobileHubConfig = (config): AmplifyConfig => {
// Geo
if (config['geo']) {
amplifyConfig.Geo = Object.assign({}, config.geo);
if (config.geo['amazon_location_services']) {
if (config.geo['amazon_location_service']) {
amplifyConfig.Geo = {
AmazonLocationServices: config.geo['amazon_location_services'],
AmazonLocationService: config.geo['amazon_location_service'],
};
}
}
Expand Down
35 changes: 17 additions & 18 deletions packages/geo/__tests__/Geo.test.ts
Expand Up @@ -18,7 +18,7 @@ import {
} from '@aws-sdk/client-location';

import { GeoClass } from '../src/Geo';
import { AmazonLocationServicesProvider } from '../src/Providers/AmazonLocationServicesProvider';
import { AmazonLocationServiceProvider } from '../src/Providers/AmazonLocationServiceProvider';
import { SearchByTextOptions } from '../src/types';

import {
Expand Down Expand Up @@ -65,17 +65,17 @@ describe('Geo', () => {
describe('pluggables', () => {
test('getPluggable', () => {
const geo = new GeoClass();
const provider = new AmazonLocationServicesProvider();
const provider = new AmazonLocationServiceProvider();
geo.addPluggable(provider);

expect(geo.getPluggable(provider.getProviderName())).toBeInstanceOf(
AmazonLocationServicesProvider
AmazonLocationServiceProvider
);
});

test('removePluggable', () => {
const geo = new GeoClass();
const provider = new AmazonLocationServicesProvider();
const provider = new AmazonLocationServiceProvider();
geo.addPluggable(provider);
geo.removePluggable(provider.getProviderName());

Expand All @@ -85,12 +85,12 @@ describe('Geo', () => {
});
});

describe('AmazonLocationServices is used as default provider', () => {
describe('AmazonLocationService is used as default provider', () => {
test('creates the proper default provider', () => {
const geo = new GeoClass();
geo.configure(awsConfig);
expect(geo.getPluggable('AmazonLocationServices')).toBeInstanceOf(
AmazonLocationServicesProvider
expect(geo.getPluggable('AmazonLocationService')).toBeInstanceOf(
AmazonLocationServiceProvider
);
});
});
Expand All @@ -101,7 +101,7 @@ describe('Geo', () => {
const config = geo.configure(awsConfig);
const expected = {
...awsConfig,
AmazonLocationServices: awsConfig.geo.amazon_location_services,
AmazonLocationService: awsConfig.geo.amazon_location_service,
};
expect(config).toEqual(expected);
});
Expand All @@ -115,7 +115,7 @@ describe('Geo', () => {

const geo = new GeoClass();
geo.configure(awsConfig);
geo.removePluggable('AmazonLocationServices');
geo.removePluggable('AmazonLocationService');

expect(() => geo.getAvailableMaps()).toThrow(
'No plugin found in Geo for the provider'
Expand All @@ -139,8 +139,8 @@ describe('Geo', () => {
geo.configure(awsConfig);

const maps = [];
const availableMaps = awsConfig.geo.amazon_location_services.maps.items;
const region = awsConfig.geo.amazon_location_services.region;
const availableMaps = awsConfig.geo.amazon_location_service.maps.items;
const region = awsConfig.geo.amazon_location_service.region;

for (const mapName in availableMaps) {
const style = availableMaps[mapName].style;
Expand All @@ -163,7 +163,7 @@ describe('Geo', () => {
const geo = new GeoClass();
geo.configure({
geo: {
amazon_location_services: {
amazon_location_service: {
maps: { items: { testMap: { style: 'teststyle' } } },
},
},
Expand All @@ -178,10 +178,10 @@ describe('Geo', () => {
const geo = new GeoClass();
geo.configure(awsConfig);

const mapName = awsConfig.geo.amazon_location_services.maps.default;
const mapName = awsConfig.geo.amazon_location_service.maps.default;
const style =
awsConfig.geo.amazon_location_services.maps.items[mapName].style;
const region = awsConfig.geo.amazon_location_services.region;
awsConfig.geo.amazon_location_service.maps.items[mapName].style;
const region = awsConfig.geo.amazon_location_service.region;
const testMap = { mapName, style, region };

const defaultMapsResource = geo.getDefaultMap();
Expand All @@ -207,8 +207,7 @@ describe('Geo', () => {
const input = spyon.mock.calls[0][0].input;
expect(input).toEqual({
Text: testString,
IndexName:
awsConfig.geo.amazon_location_services.search_indices.default,
IndexName: awsConfig.geo.amazon_location_service.search_indices.default,
});
});

Expand Down Expand Up @@ -277,7 +276,7 @@ describe('Geo', () => {

const geo = new GeoClass();
geo.configure(awsConfig);
geo.removePluggable('AmazonLocationServices');
geo.removePluggable('AmazonLocationService');

const testString = 'starbucks';
await expect(geo.searchByText(testString)).rejects.toThrow(
Expand Down
Expand Up @@ -17,7 +17,7 @@ import {
SearchPlaceIndexForPositionCommand,
} from '@aws-sdk/client-location';

import { AmazonLocationServicesProvider } from '../../src/Providers/AmazonLocationServicesProvider';
import { AmazonLocationServiceProvider } from '../../src/Providers/AmazonLocationServiceProvider';
import {
credentials,
awsConfig,
Expand Down Expand Up @@ -45,63 +45,63 @@ LocationClient.prototype.send = jest.fn(async command => {
}
});

describe('AmazonLocationServicesProvider', () => {
describe('AmazonLocationServiceProvider', () => {
afterEach(() => {
jest.restoreAllMocks();
jest.clearAllMocks();
});

describe('constructor', () => {
test('happy case', () => {
const provider = new AmazonLocationServicesProvider();
const provider = new AmazonLocationServiceProvider();
});
});

describe('getCategory', () => {
test('should return "Geo" when asked for category', () => {
const geo = new AmazonLocationServicesProvider();
const geo = new AmazonLocationServiceProvider();
expect(geo.getCategory()).toBe('Geo');
});
});

describe('getProviderName', () => {
test('should return "AmazonLocationServices" when asked for Provider', () => {
const geo = new AmazonLocationServicesProvider();
expect(geo.getProviderName()).toBe('AmazonLocationServices');
test('should return "AmazonLocationService" when asked for Provider', () => {
const geo = new AmazonLocationServiceProvider();
expect(geo.getProviderName()).toBe('AmazonLocationService');
});
});

describe('configure', () => {
test('should return a blank config object when none is passed in', () => {
const geo = new AmazonLocationServicesProvider();
const geo = new AmazonLocationServiceProvider();
const config = geo.configure();
expect(config).toEqual({});
});

test('should return standard configuration given when passing to `geo.configure`', () => {
const geo = new AmazonLocationServicesProvider();
const geo = new AmazonLocationServiceProvider();

const config = geo.configure(awsConfig.geo.amazon_location_services);
expect(config).toEqual(awsConfig.geo.amazon_location_services);
const config = geo.configure(awsConfig.geo.amazon_location_service);
expect(config).toEqual(awsConfig.geo.amazon_location_service);
});
});

describe('get map resources', () => {
test('should tell you if there are no available map resources', () => {
const provider = new AmazonLocationServicesProvider();
const provider = new AmazonLocationServiceProvider();
provider.configure();
expect(() => provider.getAvailableMaps()).toThrow(
"No map resources found in amplify config, run 'amplify add geo' to create them and ensure to run `amplify push` after"
);
});

test('should get all available map resources', () => {
const provider = new AmazonLocationServicesProvider();
provider.configure(awsConfig.geo.amazon_location_services);
const provider = new AmazonLocationServiceProvider();
provider.configure(awsConfig.geo.amazon_location_service);

const maps = [];
const availableMaps = awsConfig.geo.amazon_location_services.maps.items;
const region = awsConfig.geo.amazon_location_services.region;
const availableMaps = awsConfig.geo.amazon_location_service.maps.items;
const region = awsConfig.geo.amazon_location_service.region;
for (const mapName in availableMaps) {
const style = availableMaps[mapName].style;
maps.push({ mapName, style, region });
Expand All @@ -111,7 +111,7 @@ describe('AmazonLocationServicesProvider', () => {
});

test('should tell you if there is no map resources available when calling getDefaultMap', () => {
const provider = new AmazonLocationServicesProvider();
const provider = new AmazonLocationServiceProvider();
provider.configure();

expect(() => provider.getDefaultMap()).toThrow(
Expand All @@ -120,7 +120,7 @@ describe('AmazonLocationServicesProvider', () => {
});

test('should tell you if there is no default map resource', () => {
const provider = new AmazonLocationServicesProvider();
const provider = new AmazonLocationServiceProvider();
provider.configure({
maps: { testMap: { style: 'teststyle' } },
});
Expand All @@ -131,13 +131,13 @@ describe('AmazonLocationServicesProvider', () => {
});

test('should get the default map resource', () => {
const provider = new AmazonLocationServicesProvider();
provider.configure(awsConfig.geo.amazon_location_services);
const provider = new AmazonLocationServiceProvider();
provider.configure(awsConfig.geo.amazon_location_service);

const mapName = awsConfig.geo.amazon_location_services.maps.default;
const mapName = awsConfig.geo.amazon_location_service.maps.default;
const style =
awsConfig.geo.amazon_location_services.maps.items[mapName].style;
const region = awsConfig.geo.amazon_location_services.region;
awsConfig.geo.amazon_location_service.maps.items[mapName].style;
const region = awsConfig.geo.amazon_location_service.region;

const testMap = { mapName, style, region };

Expand All @@ -154,8 +154,8 @@ describe('AmazonLocationServicesProvider', () => {
return Promise.resolve(credentials);
});

const locationProvider = new AmazonLocationServicesProvider();
locationProvider.configure(awsConfig.geo.amazon_location_services);
const locationProvider = new AmazonLocationServiceProvider();
locationProvider.configure(awsConfig.geo.amazon_location_service);

const results = await locationProvider.searchByText(testString);
expect(results).toEqual([testPlaceCamelCase]);
Expand All @@ -164,8 +164,7 @@ describe('AmazonLocationServicesProvider', () => {
const input = spyon.mock.calls[0][0].input;
expect(input).toEqual({
Text: testString,
IndexName:
awsConfig.geo.amazon_location_services.search_indices.default,
IndexName: awsConfig.geo.amazon_location_service.search_indices.default,
});
});

Expand All @@ -174,8 +173,8 @@ describe('AmazonLocationServicesProvider', () => {
return Promise.resolve(credentials);
});

const locationProvider = new AmazonLocationServicesProvider();
locationProvider.configure(awsConfig.geo.amazon_location_services);
const locationProvider = new AmazonLocationServiceProvider();
locationProvider.configure(awsConfig.geo.amazon_location_service);

const searchOptions: SearchByTextOptions = {
countries: ['USA'],
Expand Down Expand Up @@ -207,8 +206,8 @@ describe('AmazonLocationServicesProvider', () => {
return Promise.resolve(credentials);
});

const locationProvider = new AmazonLocationServicesProvider();
locationProvider.configure(awsConfig.geo.amazon_location_services);
const locationProvider = new AmazonLocationServiceProvider();
locationProvider.configure(awsConfig.geo.amazon_location_service);

const searchOptions: SearchByTextOptions = {
countries: ['USA'],
Expand Down Expand Up @@ -239,7 +238,7 @@ describe('AmazonLocationServicesProvider', () => {
return Promise.resolve();
});

const locationProvider = new AmazonLocationServicesProvider();
const locationProvider = new AmazonLocationServiceProvider();

await expect(locationProvider.searchByText(testString)).rejects.toThrow(
'No credentials'
Expand All @@ -251,7 +250,7 @@ describe('AmazonLocationServicesProvider', () => {
return Promise.reject();
});

const locationProvider = new AmazonLocationServicesProvider();
const locationProvider = new AmazonLocationServiceProvider();

await expect(locationProvider.searchByText(testString)).rejects.toThrow(
'No credentials'
Expand All @@ -267,8 +266,8 @@ describe('AmazonLocationServicesProvider', () => {
return Promise.resolve(credentials);
});

const locationProvider = new AmazonLocationServicesProvider();
locationProvider.configure(awsConfig.geo.amazon_location_services);
const locationProvider = new AmazonLocationServiceProvider();
locationProvider.configure(awsConfig.geo.amazon_location_service);

const results = await locationProvider.searchByCoordinates(
testCoordinates
Expand All @@ -279,8 +278,7 @@ describe('AmazonLocationServicesProvider', () => {
const input = spyon.mock.calls[0][0].input;
expect(input).toEqual({
Position: testCoordinates,
IndexName:
awsConfig.geo.amazon_location_services.search_indices.default,
IndexName: awsConfig.geo.amazon_location_service.search_indices.default,
});
});

Expand All @@ -289,8 +287,8 @@ describe('AmazonLocationServicesProvider', () => {
return Promise.resolve(credentials);
});

const locationProvider = new AmazonLocationServicesProvider();
locationProvider.configure(awsConfig.geo.amazon_location_services);
const locationProvider = new AmazonLocationServiceProvider();
locationProvider.configure(awsConfig.geo.amazon_location_service);

const searchOptions: SearchByCoordinatesOptions = {
maxResults: 40,
Expand All @@ -316,7 +314,7 @@ describe('AmazonLocationServicesProvider', () => {
return Promise.resolve();
});

const locationProvider = new AmazonLocationServicesProvider();
const locationProvider = new AmazonLocationServiceProvider();

await expect(
locationProvider.searchByCoordinates(testCoordinates)
Expand All @@ -328,7 +326,7 @@ describe('AmazonLocationServicesProvider', () => {
return Promise.reject();
});

const locationProvider = new AmazonLocationServicesProvider();
const locationProvider = new AmazonLocationServiceProvider();

await expect(
locationProvider.searchByCoordinates(testCoordinates)
Expand Down

0 comments on commit ca4e661

Please sign in to comment.