Comparing version 0.1.8 to 0.1.9
@@ -5,5 +5,5 @@ export declare class Sayt { | ||
configure(config?: SaytConfig): void; | ||
autocomplete(query?: string, config?: QueryTimeAutocompleteConfig, cb?: SearchCallback): Promise<any>; | ||
productSearch(query?: string, config?: QueryTimeProductSearchConfig, cb?: SearchCallback): Promise<any>; | ||
private callbackOrPromise(promise, cb); | ||
autocomplete(query?: string, config?: QueryTimeAutocompleteConfig, cb?: SearchCallback): Promise<AutocompleteResponse>; | ||
productSearch(query?: string, config?: QueryTimeProductSearchConfig, cb?: SearchCallback): Promise<AutocompleteResponse>; | ||
private callbackOrPromise; | ||
private readonly url; | ||
@@ -31,2 +31,43 @@ } | ||
} | ||
export interface AutocompleteResponse { | ||
status: { | ||
code: number; | ||
internalCode: number; | ||
message: string; | ||
additionalInfo: any; | ||
serverTimeStamp: number; | ||
}; | ||
result: { | ||
stats: { | ||
navigationCount: number; | ||
searchCount: number; | ||
productCount: number; | ||
autocompleteResponse: number; | ||
productSearchResponse: number; | ||
}; | ||
searchTerms: AutocompleteSearchTerm[] | null; | ||
navigations: AutocompleteNavigation[] | null; | ||
products: AutocompleteProduct[] | null; | ||
}; | ||
} | ||
export interface AutocompleteSearchTerm { | ||
additionalInfo: { | ||
[key: string]: any; | ||
}; | ||
distanceToDepluralized: number; | ||
distanceToSearch: number; | ||
value: string; | ||
} | ||
export interface AutocompleteNavigation { | ||
name: string; | ||
values: string[]; | ||
} | ||
export interface AutocompleteProduct { | ||
id: string; | ||
url: string; | ||
title: string; | ||
allMeta: any; | ||
collection: string; | ||
snippet?: any; | ||
} | ||
export declare type QueryTimeAutocompleteConfig = AutocompleteConfig & { | ||
@@ -33,0 +74,0 @@ collection?: string; |
@@ -6,3 +6,3 @@ "use strict"; | ||
var SAYT_URL = '.groupbycloud.com/api/v1/sayt/search'; | ||
var Sayt = (function () { | ||
var Sayt = /** @class */ (function () { | ||
function Sayt(config) { | ||
@@ -9,0 +9,0 @@ this.config = { |
@@ -7,5 +7,5 @@ "use strict"; | ||
return new Promise(function (resolve, reject) { | ||
rawJsonp(url + "?" + qs.stringify(body), function (err, data) { return err ? reject(err) : resolve(data); }); | ||
rawJsonp(url + "?" + qs.stringify(body), {}, function (err, data) { return err ? reject(err) : resolve(data); }); | ||
}); | ||
} | ||
exports.jsonp = jsonp; |
{ | ||
"name": "sayt", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "Client for the SAYT API.", | ||
@@ -16,3 +16,3 @@ "typings": "dist/src/index.d.ts", | ||
"test": "NODE_ENV=test karma start", | ||
"test+coverage": "NODE_ENV=test karma start && npm run coverage && npm run coverage:codacy", | ||
"test+coverage": "NODE_ENV=test karma start && npm run coverage", | ||
"posttest": "npm run coverage", | ||
@@ -22,3 +22,2 @@ "coverage": "npm run coverage:remap && npm run coverage:report", | ||
"coverage:report": "istanbul report", | ||
"coverage:codacy": "cat ./coverage/lcov.info | codacy-coverage", | ||
"build": "rimraf dist && tsc", | ||
@@ -44,13 +43,12 @@ "ci": "NODE_ENV=ci karma start --singleRun=false", | ||
"devDependencies": { | ||
"@types/chai": "^3.5.1", | ||
"@types/mocha": "^2.2.41", | ||
"@types/chai": "^4.0", | ||
"@types/mocha": "^5.0", | ||
"@types/qs": "^6.2.31", | ||
"@types/webpack-env": "^1.13.0", | ||
"awesome-typescript-loader": "^3.1.2", | ||
"chai": "^3.2.0", | ||
"codacy-coverage": "^2.0.0", | ||
"awesome-typescript-loader": "^5.2.1", | ||
"chai": "^4.2.0", | ||
"gb-license-check": "^1.0.1", | ||
"husky": "^0.13.3", | ||
"husky": "^3.0.0", | ||
"istanbul": "^0.4.5", | ||
"karma": "^1.6.0", | ||
"karma": "^4.1.0", | ||
"karma-chai": "^0.1.0", | ||
@@ -62,22 +60,21 @@ "karma-coverage": "^1.1.1", | ||
"karma-source-map-support": "^1.2.0", | ||
"karma-webpack": "^2.0.3", | ||
"mocha": "^3.3.0", | ||
"karma-webpack": "^4.0.2", | ||
"mocha": "^6.1.4", | ||
"object-assign": "^4.1.0", | ||
"phantomjs-prebuilt": "^2.1.7", | ||
"pre-commit": "^1.1.3", | ||
"remap-istanbul": "^0.9.5", | ||
"remap-istanbul": "^0.13.0", | ||
"rimraf": "^2.5.4", | ||
"sourcemap-istanbul-instrumenter-loader": "^0.2.0", | ||
"ts-loader": "^2.0.3", | ||
"ts-loader": "^6.0.4", | ||
"tslint": "^5.1.0", | ||
"tslint-eslint-rules": "^4.0.0", | ||
"tslint-eslint-rules": "^5.4.0", | ||
"tslint-loader": "^3.5.3", | ||
"typedoc": "^0.6.0", | ||
"typescript": "^2.2.2", | ||
"typedoc": "^0.14.2", | ||
"typescript": "^3.5.2", | ||
"typings": "^2.1.1", | ||
"webpack": "^2.4.1" | ||
"webpack": "^4.35.2" | ||
}, | ||
"dependencies": { | ||
"@types/es6-shim": "^0.31.33", | ||
"@types/node": "^7.0.14", | ||
"@types/node": "^12.6.1", | ||
"es6-object-assign": "^1.0.3", | ||
@@ -89,2 +86,2 @@ "es6-promise": "^4.1.0", | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
271226
6
32
14
206
0
22
+ Added@types/node@12.20.55(transitive)
- Removed@types/es6-shim@^0.31.33
- Removed@types/es6-shim@0.31.45(transitive)
- Removed@types/node@7.10.14(transitive)
Updated@types/node@^12.6.1