update to working search

This commit is contained in:
2017-08-15 17:03:21 +02:00
parent d9573937d0
commit 8edb49d9fb
18 changed files with 412 additions and 36 deletions

View File

@@ -1,7 +1,40 @@
import * as plugins from './smartnpm.plugins'
export class NpmPackage {
search (searchObject: ISearchObject) {
let response = await plugins.Smartrequest
name: string = null
scope: string = null
version: string = null
description: string = null
keywords: string[] = null
date: '2017-08-02T11:22:49.144Z'
links: {
npm: string
homepage: string
repository: string
bugs: string
} = null
author: {
name: 'Lossless GmbH'
} = null
publisher: {
username: 'gitzone', email: 'npm@git.zone'
} = null
maintainers: any = null
score: {
final: number,
detail: {
quality: number,
popularity: number,
maintenance: number
}
} = null
searchScore: number = null
constructor (descriptionArg) {
for (let key in descriptionArg) {
if (this[key] === null) {
this[key] = descriptionArg[key]
}
}
}
}