Skip to content

Commit d4e23bc

Browse files
authored
Merge pull request #156 from sid88in/revert-155-master
Revert "Add support for Multiple APIs"
2 parents 20fe90a + 305b5e8 commit d4e23bc

File tree

4 files changed

+102
-156
lines changed

4 files changed

+102
-156
lines changed

__snapshots__/get-config.test.js.snap

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,27 @@ exports[`authenticationType is missing 1`] = `"appSync property \`authentication
55
exports[`authenticationType is missing 2`] = `"appSync property \`authenticationType\` is missing or invalid."`;
66

77
exports[`returns valid config 1`] = `
8-
Array [
9-
Object {
10-
"apiId": undefined,
11-
"apiKey": undefined,
12-
"authenticationType": "AWS_IAM",
13-
"dataSources": Array [
14-
Object {
15-
"name": "users",
16-
"type": "AMAZON_DYNAMODB",
17-
},
18-
Object {
19-
"name": "tweets",
20-
"type": "AMAZON_DYNAMODB",
21-
},
22-
],
23-
"isSingleConfig": true,
24-
"logConfig": undefined,
25-
"mappingTemplates": Array [],
26-
"mappingTemplatesLocation": "mapping-templates",
27-
"name": "api",
28-
"openIdConnectConfig": undefined,
29-
"region": "us-east-1",
30-
"schema": "type Mutation {
8+
Object {
9+
"apiId": undefined,
10+
"apiKey": undefined,
11+
"authenticationType": "AWS_IAM",
12+
"dataSources": Array [
13+
Object {
14+
"name": "users",
15+
"type": "AMAZON_DYNAMODB",
16+
},
17+
Object {
18+
"name": "tweets",
19+
"type": "AMAZON_DYNAMODB",
20+
},
21+
],
22+
"logConfig": undefined,
23+
"mappingTemplates": Array [],
24+
"mappingTemplatesLocation": "mapping-templates",
25+
"name": "api",
26+
"openIdConnectConfig": undefined,
27+
"region": "us-east-1",
28+
"schema": "type Mutation {
3129
# Create a tweet for a user
3230
# consumer keys and tokens are not required for dynamo integration
3331
createTweet(
@@ -121,8 +119,7 @@ schema {
121119
subscription: Subscription
122120
}
123121
",
124-
"substitutions": Object {},
125-
"userPoolConfig": undefined,
126-
},
127-
]
122+
"substitutions": Object {},
123+
"userPoolConfig": undefined,
124+
}
128125
`;

get-config.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const objectToArrayWithNameProp = pipe(
99
values,
1010
);
1111

12-
const getConfig = (config, provider, servicePath) => {
12+
module.exports = (config, provider, servicePath) => {
1313
if (
1414
!(
1515
config.authenticationType === 'API_KEY' ||
@@ -65,15 +65,3 @@ const getConfig = (config, provider, servicePath) => {
6565
substitutions: config.substitutions || {},
6666
};
6767
};
68-
69-
module.exports = (config, provider, servicePath) => {
70-
if (!config) {
71-
return [];
72-
} else if (config.constructor === Array) {
73-
return config.map(apiConfig => getConfig(apiConfig, provider, servicePath));
74-
} else {
75-
const singleConfig = getConfig(config, provider, servicePath);
76-
singleConfig.isSingleConfig = true;
77-
return [singleConfig];
78-
}
79-
};

0 commit comments

Comments
 (0)