apphub-graphql
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -24,6 +24,12 @@ 'use strict'; | ||
// resolve(view) | ||
(0, _pullStream2.default)(sbot.apphub.stream(), _pullStream2.default.collect(function (err, view) { | ||
(0, _pullStream2.default)(sbot.apphub.stream(), | ||
// pull.map(msg => { | ||
// console.log('MSG', msg) | ||
// return msg | ||
// }), | ||
_pullStream2.default.collect(function (err, view) { | ||
if (err) reject(err); | ||
console.log('VIEW', view); | ||
resolve(view); | ||
// console.log('VIEW', view) | ||
var merged = [].concat.apply([], view); | ||
resolve(merged); | ||
})); | ||
@@ -42,2 +48,3 @@ // ssbServer.close() | ||
} | ||
console.log('publishing', msg); | ||
resolve(msg); | ||
@@ -44,0 +51,0 @@ }); |
@@ -13,20 +13,14 @@ "use strict"; | ||
}, | ||
key: function key(msg) { | ||
return msg.key; | ||
description: function description(msg) { | ||
return msg.value.content.application.description; | ||
}, | ||
category: function category(msg) { | ||
return msg.value.content.application.category; | ||
}, | ||
repository: function repository(msg) { | ||
return msg.value.content.application.repository; | ||
}, | ||
hash: function hash(msg) { | ||
return msg.value.content.application.hash; | ||
datHash: function datHash(msg) { | ||
return msg.value.content.application.datHash; | ||
}, | ||
slug: function slug(msg) { | ||
return msg.value.content.application.slug; | ||
}, | ||
type: function type(msg) { | ||
return msg.value.content.type; | ||
appUrl: function appUrl(msg) { | ||
return msg.value.content.application.appUrl; | ||
} | ||
}; |
"use strict"; | ||
var Application = "\n type Application {\n name: String!\n author: String!\n key: ID\n category: String\n repository: String\n hash: String\n slug: String\n type: String!\n }\n"; | ||
var Application = "\n type Application {\n name: String!\n description: String!\n author: String!\n repository: String\n datHash: String\n appUrl: String\n }\n"; | ||
module.exports = function () { | ||
return [Application]; | ||
}; |
@@ -14,5 +14,4 @@ 'use strict'; | ||
// const { name, author, key, category, repository, hash, slug } = input | ||
return (0, _helpers.publishMessage)({ | ||
type: 'open-app-application-poc2', | ||
type: 'open-app-hub-alpha', | ||
application: input | ||
@@ -19,0 +18,0 @@ }, sbot); |
"use strict"; | ||
var Mutation = "\n input applicationInput {\n name: String!\n category: String\n repository: String\n hash: String\n slug: String\n }\n type Mutation {\n applicationMessage(input: applicationInput): Application\n }\n"; | ||
var Mutation = "\n input applicationInput {\n name: String!\n description: String!\n repository: String\n datHash: String!\n appUrl: String\n }\n type Mutation {\n applicationMessage(input: applicationInput): Application\n }\n"; | ||
module.exports = function () { | ||
return [Mutation]; | ||
}; |
{ | ||
"name": "apphub-graphql", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Open App Hub types for GraphQL", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,6 +10,11 @@ import pull from 'pull-stream' | ||
sbot.apphub.stream(), | ||
// pull.map(msg => { | ||
// console.log('MSG', msg) | ||
// return msg | ||
// }), | ||
pull.collect((err, view) => { | ||
if (err) reject(err) | ||
console.log('VIEW', view) | ||
resolve(view) | ||
// console.log('VIEW', view) | ||
const merged = [].concat.apply([], view); | ||
resolve(merged) | ||
}), | ||
@@ -27,4 +32,5 @@ ) | ||
} | ||
console.log('publishing', msg) | ||
resolve(msg) | ||
}) | ||
}) |
export default { | ||
name: (msg) => msg.value.content.application.name, | ||
author: (msg) => msg.value.author, | ||
key: (msg) => msg.key, | ||
category: (msg) => msg.value.content.application.category, | ||
description: (msg) => msg.value.content.application.description, | ||
repository: (msg) => msg.value.content.application.repository, | ||
hash: (msg) => msg.value.content.application.hash, | ||
slug: (msg) => msg.value.content.application.slug, | ||
type: (msg) => msg.value.content.type, | ||
datHash: (msg) => msg.value.content.application.datHash, | ||
appUrl: (msg) => msg.value.content.application.appUrl, | ||
} |
const Application = ` | ||
type Application { | ||
name: String! | ||
description: String! | ||
author: String! | ||
key: ID | ||
category: String | ||
repository: String | ||
hash: String | ||
slug: String | ||
type: String! | ||
datHash: String | ||
appUrl: String | ||
} | ||
` | ||
module.exports = () => [Application] |
@@ -5,5 +5,4 @@ import { publishMessage } from '../apphub/helpers'; | ||
applicationMessage: (_, { input}, { sbot }) => { | ||
// const { name, author, key, category, repository, hash, slug } = input | ||
return publishMessage({ | ||
type: 'open-app-application-poc2', | ||
type: 'open-app-hub-alpha', | ||
application: input | ||
@@ -10,0 +9,0 @@ }, sbot) |
const Mutation = ` | ||
input applicationInput { | ||
name: String! | ||
category: String | ||
description: String! | ||
repository: String | ||
hash: String | ||
slug: String | ||
datHash: String! | ||
appUrl: String | ||
} | ||
@@ -9,0 +9,0 @@ type Mutation { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
1
10616
26
297