Comparing version 0.1.1 to 0.1.2
"use strict"; | ||
var index_1 = require('../utils/index'); | ||
var filterObject = require('filter-object'); | ||
var SAYT_URL = '.groupbycloud.com/api/v1/sayt/search'; | ||
var Sayt = (function () { | ||
function Sayt() { | ||
function Sayt(config) { | ||
this.config = { | ||
@@ -15,9 +16,9 @@ autocomplete: { | ||
}; | ||
this.configure(config); | ||
} | ||
Sayt.prototype.configure = function (config) { | ||
if (config === void 0) { config = this.config; } | ||
var finalConfig = Object.assign({}, this.config, config); | ||
finalConfig.autocomplete = Object.assign({}, this.config.autocomplete, config.autocomplete ? config.autocomplete : {}); | ||
finalConfig.productSearch = Object.assign({}, this.config.productSearch, config.productSearch ? config.productSearch : {}); | ||
this.config = finalConfig; | ||
if (config === void 0) { config = {}; } | ||
Object.assign(this.config, filterObject(config, '!{autocomplete,productSearch}')); | ||
Object.assign(this.config.autocomplete, config.autocomplete || {}); | ||
Object.assign(this.config.productSearch, config.productSearch || {}); | ||
}; | ||
@@ -54,3 +55,3 @@ Sayt.prototype.autocomplete = function (query, config, cb) { | ||
var response = promise; | ||
if (typeof cb == 'function') { | ||
if (typeof cb === 'function') { | ||
response = promise.then(function (res) { return cb(undefined, res); }) | ||
@@ -72,2 +73,2 @@ .catch(function (err) { return cb(err); }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvcmUvc2F5dC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsc0JBQXNCLGdCQUFnQixDQUFDLENBQUE7QUFFdkMsSUFBTSxRQUFRLEdBQUcsc0NBQXNDLENBQUM7QUFFeEQ7SUFBQTtRQUVVLFdBQU0sR0FBZ0I7WUFDNUIsWUFBWSxFQUFFO2dCQUNaLGNBQWMsRUFBRSxDQUFDO2dCQUNqQixjQUFjLEVBQUUsQ0FBQzthQUNsQjtZQUNELGFBQWEsRUFBRTtnQkFDYixXQUFXLEVBQUUsQ0FBQzthQUNmO1NBQ0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R1Y3RTZWFyY2hDb25maWcgPSBQcm9kdWN0U2VhcmNoQ29uZmlnICYgeyBjb2xsZWN0aW9uPzogc3RyaW5nLCByZWZpbmVtZW50cz86IHN0cmluZyB9O1xuZXhwb3J0IHR5cGUgU2VhcmNoQ2FsbGJhY2sgPSAoZXJyOiBFcnJvciwgcmVzPzogYW55KSA9PiB2b2lkO1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 |
/// <reference path="../typings/index.d.ts" /> | ||
/// <reference path="../custom-typings/index.d.ts" /> | ||
/// <reference path="../custom_typings/jsonp.d.ts" /> | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
require('es6-promise').polyfill(); | ||
require('./polyfills').pollyfill(); | ||
var sayt_1 = require('./core/sayt'); | ||
var sayt = new sayt_1.Sayt(); | ||
__export(require('./core/sayt')); | ||
if (window !== undefined) { | ||
window['sayt'] = sayt; | ||
window['sayt'] = new sayt_1.Sayt(); | ||
} | ||
module.exports = sayt; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDhDQUE4QztBQUM5QyxxREFBcUQ7O0FBRXJELE9BQU8sQ0FBQyxhQUFhLENBQUMsQ0FBQyxRQUFRLEVBQUUsQ0FBQztBQUNsQyxPQUFPLENBQUMsYUFBYSxDQUFDLENBQUMsU0FBUyxFQUFFLENBQUM7QUFFbkMscUJBQXNCLGFBQWEsQ0FBQyxDQUFBO0FBRXBDLElBQU0sSUFBSSxHQUFHLElBQUksV0FBSSxFQUFFLENBQUM7QUFHeEIsRUFBRSxDQUFDLENBQUMsTUFBTSxLQUFLLFNBQVMsQ0FBQyxDQUFDLENBQUM7SUFDekIsTUFBTSxDQUFDLE1BQU0sQ0FBQyxHQUFHLElBQUksQ0FBQztBQUN4QixDQUFDO0FBSk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MiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi4vdHlwaW5ncy9pbmRleC5kLnRzXCIgLz5cbi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuLi9jdXN0b21fdHlwaW5ncy9qc29ucC5kLnRzXCIgLz5cblxucmVxdWlyZSgnZXM2LXByb21pc2UnKS5wb2x5ZmlsbCgpO1xucmVxdWlyZSgnLi9wb2x5ZmlsbHMnKS5wb2xseWZpbGwoKTtcblxuaW1wb3J0IHsgU2F5dCB9IGZyb20gJy4vY29yZS9zYXl0JztcbmV4cG9ydCAqIGZyb20gJy4vY29yZS9zYXl0JztcblxuaWYgKHdpbmRvdyAhPT0gdW5kZWZpbmVkKSB7XG4gIHdpbmRvd1snc2F5dCddID0gbmV3IFNheXQoKTtcbn1cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ== |
// Generated by dts-bundle v0.3.0 | ||
declare module 'sayt' { | ||
import { Sayt } from '__sayt/core/sayt'; | ||
const sayt: Sayt; | ||
export = sayt; | ||
export * from '__sayt/core/sayt'; | ||
} | ||
@@ -11,14 +9,15 @@ | ||
export class Sayt { | ||
configure(config?: ISaytConfig): void; | ||
constructor(config?: SaytConfig); | ||
configure(config?: SaytConfig): void; | ||
autocomplete(query?: string, config?: IQueryTimeAutocompleteConfig, cb?: SearchCallback): Promise<any>; | ||
productSearch(query?: string, config?: IQueryTimeProductSearchConfig, cb?: SearchCallback): Promise<any>; | ||
} | ||
export interface ISaytConfig { | ||
export interface SaytConfig { | ||
subdomain?: string; | ||
collection?: string; | ||
https?: boolean; | ||
autocomplete?: IAutocompleteConfig; | ||
productSearch?: IProductSearchConfig; | ||
autocomplete?: AutocompleteConfig; | ||
productSearch?: ProductSearchConfig; | ||
} | ||
export interface IAutocompleteConfig { | ||
export interface AutocompleteConfig { | ||
numSearchTerms?: number; | ||
@@ -29,3 +28,3 @@ numNavigations?: number; | ||
} | ||
export interface IProductSearchConfig { | ||
export interface ProductSearchConfig { | ||
area?: string; | ||
@@ -35,6 +34,6 @@ numProducts?: number; | ||
} | ||
export type IQueryTimeAutocompleteConfig = IAutocompleteConfig & { | ||
export type IQueryTimeAutocompleteConfig = AutocompleteConfig & { | ||
collection?: string; | ||
}; | ||
export type IQueryTimeProductSearchConfig = IProductSearchConfig & { | ||
export type IQueryTimeProductSearchConfig = ProductSearchConfig & { | ||
collection?: string; | ||
@@ -41,0 +40,0 @@ refinements?: string; |
{ | ||
"name": "sayt", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Client for the SAYT API.", | ||
"typings": "dist/commonjs/sayt.d.ts", | ||
"typescript": { | ||
@@ -13,3 +14,2 @@ "definition": "build/sayt.d.ts" | ||
"scripts": { | ||
"other": "karma start", | ||
"test": "gulp build && karma start", | ||
@@ -72,2 +72,3 @@ "ci": "gulp clean:typings && gulp typings:install && karma start --singleRun=false" | ||
"ts-loader": "^0.8.2", | ||
"tslint-eslint-rules": "^1.3.0", | ||
"typescript": "^1.9.0-dev.20160615-1.0", | ||
@@ -79,2 +80,3 @@ "webpack-fail-plugin": "^1.0.4", | ||
"es6-promise": "^3.1.2", | ||
"filter-object": "^2.1.0", | ||
"jsonp": "^0.2.0", | ||
@@ -81,0 +83,0 @@ "qs": "^6.2.0" |
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
212
21429
4
43
+ Addedfilter-object@^2.1.0
+ Addedarr-diff@2.0.0(transitive)
+ Addedarr-flatten@1.1.0(transitive)
+ Addedarray-unique@0.2.1(transitive)
+ Addedbraces@1.8.5(transitive)
+ Addedcall-bind@1.0.8(transitive)
+ Addeddeep-equal@1.1.2(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addedexpand-brackets@0.1.5(transitive)
+ Addedexpand-range@1.8.2(transitive)
+ Addedextend-shallow@2.0.1(transitive)
+ Addedextglob@0.3.2(transitive)
+ Addedfilename-regex@2.0.1(transitive)
+ Addedfill-range@2.2.4(transitive)
+ Addedfilter-keys@1.1.0(transitive)
+ Addedfilter-object@2.1.0(transitive)
+ Addedfilter-values@0.4.1(transitive)
+ Addedfor-in@1.0.2(transitive)
+ Addedfor-own@0.1.5(transitive)
+ Addedfunctions-have-names@1.2.3(transitive)
+ Addedglob-base@0.3.0(transitive)
+ Addedglob-parent@2.0.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedis-arguments@1.2.0(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-date-object@1.1.0(transitive)
+ Addedis-dotfile@1.0.3(transitive)
+ Addedis-equal-shallow@0.1.3(transitive)
+ Addedis-extendable@0.1.1(transitive)
+ Addedis-extglob@1.0.0(transitive)
+ Addedis-glob@2.0.1(transitive)
+ Addedis-match@0.4.1(transitive)
+ Addedis-number@2.1.04.0.0(transitive)
+ Addedis-posix-bracket@0.1.1(transitive)
+ Addedis-primitive@2.0.0(transitive)
+ Addedis-regex@1.2.1(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisobject@2.1.03.0.1(transitive)
+ Addedkind-of@2.0.13.2.26.0.3(transitive)
+ Addedmath-random@1.0.4(transitive)
+ Addedmicromatch@2.3.11(transitive)
+ Addednormalize-path@2.1.1(transitive)
+ Addedobject-is@1.1.6(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject.omit@2.0.1(transitive)
+ Addedobject.pick@1.3.0(transitive)
+ Addedparse-glob@3.0.4(transitive)
+ Addedpreserve@0.2.0(transitive)
+ Addedrandomatic@3.1.1(transitive)
+ Addedregex-cache@0.4.4(transitive)
+ Addedregexp.prototype.flags@1.5.4(transitive)
+ Addedremove-trailing-separator@1.1.0(transitive)
+ Addedrepeat-element@1.1.4(transitive)
+ Addedrepeat-string@1.6.1(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedset-function-name@2.0.2(transitive)