run prettier

This commit is contained in:
Sérgio Ramos 2017-04-27 23:11:12 +01:00
parent d5ecdd1cbc
commit 5e59690ca8
7 changed files with 24 additions and 50 deletions

View File

@ -20,28 +20,8 @@ const json = (() => {
})(); })();
module.exports = { module.exports = {
url: ( url: process.env.SDC_URL || json.SDC_URL || json.url || '',
process.env.SDC_URL || account: process.env.SDC_ACCOUNT || json.SDC_ACCOUNT || json.account || '',
json.SDC_URL || user: process.env.SDC_USER || json.SDC_USER || json.user || '',
json.url || keyId: process.env.SDC_KEY_ID || json.SDC_KEY_ID || json.keyId || ''
''
),
account: (
process.env.SDC_ACCOUNT ||
json.SDC_ACCOUNT ||
json.account ||
''
),
user: (
process.env.SDC_USER ||
json.SDC_USER ||
json.user ||
''
),
keyId: (
process.env.SDC_KEY_ID ||
json.SDC_KEY_ID ||
json.keyId ||
''
)
}; };

View File

@ -20,28 +20,17 @@ const json = (() => {
})(); })();
module.exports = { module.exports = {
cert: ( cert: process.env.DOCKER_CERT_PATH ||
process.env.DOCKER_CERT_PATH ||
json.DOCKER_CERT_PATH || json.DOCKER_CERT_PATH ||
json.cert || json.cert ||
'' '',
), host: process.env.DOCKER_HOST || json.DOCKER_HOST || json.host || '',
host: ( tls_verify: process.env.DOCKER_TLS_VERIFY ||
process.env.DOCKER_HOST ||
json.DOCKER_HOST ||
json.host ||
''
),
tls_verify: (
process.env.DOCKER_TLS_VERIFY ||
json.DOCKER_TLS_VERIFY || json.DOCKER_TLS_VERIFY ||
json.tls_verify || json.tls_verify ||
'' '',
), timeout: process.env.DOCKER_CLIENT_TIMEOUT ||
timeout: (
process.env.DOCKER_CLIENT_TIMEOUT ||
json.DOCKER_CLIENT_TIMEOUT || json.DOCKER_CLIENT_TIMEOUT ||
json.timeout || json.timeout ||
'' ''
)
}; };

View File

@ -1,5 +1,5 @@
const graphql = require('graphql'); const graphql = require('graphql');
const mutation = require('./mutations'); // const mutation = require('./mutations');
const query = require('./queries'); const query = require('./queries');
const { GraphQLSchema } = graphql; const { GraphQLSchema } = graphql;

View File

@ -1,9 +1,13 @@
const graphql = require('graphql');
const DynamicObjectType = require('../types/dynamic-object'); const DynamicObjectType = require('../types/dynamic-object');
const ContainerType = require('../types/container'); const ContainerType = require('../types/container');
const api = require('../../api'); const api = require('../../api');
const { GraphQLInt, GraphQLList, GraphQLString, GraphQLID, GraphQLBoolean } = graphql; const {
GraphQLInt,
GraphQLList,
GraphQLID,
GraphQLBoolean
} = require('graphql');
module.exports = { module.exports = {
type: new GraphQLList(ContainerType), type: new GraphQLList(ContainerType),
@ -35,8 +39,7 @@ module.exports = {
} }
}, },
resolve(root, args) { resolve(root, args) {
const { list, inspect } = api.containers; const { list } = api.containers;
return list(args); return list(args);
// //
// const { after, first } = args; // const { after, first } = args;

View File

@ -1,4 +1,5 @@
const pascalCase = require('pascal-case'); const pascalCase = require('pascal-case');
const upperCase = require('upper-case'); const upperCase = require('upper-case');
module.exports = (root, ctx, req, { fieldName }) => root[pascalCase(fieldName)] || root[upperCase(fieldName)]; module.exports = (root, ctx, req, { fieldName }) =>
root[pascalCase(fieldName)] || root[upperCase(fieldName)];

View File

@ -1,5 +1,4 @@
const { GraphQLString, GraphQLObjectType, GraphQLInt } = require('graphql'); const { GraphQLString, GraphQLObjectType, GraphQLInt } = require('graphql');
const DynamicObjectType = require('./dynamic-object');
const fromPascalCase = require('./from-pascal-case'); const fromPascalCase = require('./from-pascal-case');
module.exports = new GraphQLObjectType({ module.exports = new GraphQLObjectType({

View File

@ -36,7 +36,9 @@ const plugins = [
}, },
{ {
register: PortalApi, register: PortalApi,
routes: { prefix: '/api' } routes: {
prefix: '/api'
}
} }
]; ];