Skip to content

Commit aa03a34

Browse files
committed
2017-07-24 3.24.2
* chore(deprecation): add deprecation message to all methods that will be removed in v4 (algolia#573) * index.addObject(obj) --> index.addObjects([obj]) * index.ttAdapter --> autocomplete.js * index.partialUpdateObject(obj) --> partialUpdateObjects([obj]) * index.saveObject(obj) --> index.saveObjects([obj]) * index.deleteObject(objectID) --> index.deleteObjects([objectID]) * index.getObject(objectID) --> index.getObjects([objectID]) * see https://github.com/algolia/algoliasearch-client-javascript/wiki/Deprecated for more information
1 parent 5829a13 commit aa03a34

13 files changed

+98
-84
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
CHANGELOG
2+
2017-07-24 3.24.2
3+
* chore(deprecation): add deprecation message to all methods that will be removed in v4 (#573)
4+
* index.addObject(obj) --> index.addObjects([obj])
5+
* index.ttAdapter --> autocomplete.js
6+
* index.partialUpdateObject(obj) --> partialUpdateObjects([obj])
7+
* index.saveObject(obj) --> index.saveObjects([obj])
8+
* index.deleteObject(objectID) --> index.deleteObjects([objectID])
9+
* index.getObject(objectID) --> index.getObjects([objectID])
10+
* see https://github.com/algolia/algoliasearch-client-javascript/wiki/Deprecated for more information
11+
212
2017-07-20 3.24.1
313
* feat(headers): add functions to remove and get extra headers (#572)
414
* client.setExtraHeader('X-cool-header','hello there');

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "algoliasearch",
3-
"version": "3.24.1",
3+
"version": "3.24.2",
44
"homepage": "https://github.com/algolia/algoliasearch-client-js",
55
"authors": [
66
"Algolia Team <[email protected]>"

dist/algoliasearch.angular.js

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! algoliasearch 3.24.1 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */
1+
/*! algoliasearch 3.24.2 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */
22
(function(f){var g;if(typeof window!=='undefined'){g=window}else if(typeof self!=='undefined'){g=self}g.ALGOLIA_MIGRATION_LAYER=f()})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
33

44
module.exports = function load (src, opts, cb) {
@@ -4050,7 +4050,7 @@ inherits(Index, IndexCore);
40504050
* error: null or Error('message')
40514051
* content: the server answer that contains 3 elements: createAt, taskId and objectID
40524052
*/
4053-
Index.prototype.addObject = function(content, objectID, callback) {
4053+
Index.prototype.addObject = deprecate(function(content, objectID, callback) {
40544054
var indexObj = this;
40554055

40564056
if (arguments.length === 1 || typeof objectID === 'function') {
@@ -4068,7 +4068,7 @@ Index.prototype.addObject = function(content, objectID, callback) {
40684068
hostType: 'write',
40694069
callback: callback
40704070
});
4071-
};
4071+
}, deprecatedMessage('index.addObject(obj)', 'index.addObjects([obj])'));
40724072

40734073
/*
40744074
* Add several objects
@@ -4116,7 +4116,7 @@ Index.prototype.addObjects = function(objects, callback) {
41164116
* error: null or Error('message')
41174117
* content: the server answer that contains 3 elements: createAt, taskId and objectID
41184118
*/
4119-
Index.prototype.partialUpdateObject = function(partialObject, createIfNotExists, callback) {
4119+
Index.prototype.partialUpdateObject = deprecate(function(partialObject, createIfNotExists, callback) {
41204120
if (arguments.length === 1 || typeof createIfNotExists === 'function') {
41214121
callback = createIfNotExists;
41224122
createIfNotExists = undefined;
@@ -4135,7 +4135,7 @@ Index.prototype.partialUpdateObject = function(partialObject, createIfNotExists,
41354135
hostType: 'write',
41364136
callback: callback
41374137
});
4138-
};
4138+
}, deprecatedMessage('index.partialUpdateObject(obj)', 'partialUpdateObjects([obj])'));
41394139

41404140
/*
41414141
* Partially Override the content of several objects
@@ -4187,7 +4187,7 @@ Index.prototype.partialUpdateObjects = function(objects, createIfNotExists, call
41874187
* error: null or Error('message')
41884188
* content: the server answer that updateAt and taskID
41894189
*/
4190-
Index.prototype.saveObject = function(object, callback) {
4190+
Index.prototype.saveObject = deprecate(function(object, callback) {
41914191
var indexObj = this;
41924192
return this.as._jsonRequest({
41934193
method: 'PUT',
@@ -4196,7 +4196,7 @@ Index.prototype.saveObject = function(object, callback) {
41964196
hostType: 'write',
41974197
callback: callback
41984198
});
4199-
};
4199+
}, deprecatedMessage('index.saveObject(obj)', 'index.saveObjects([obj])'));
42004200

42014201
/*
42024202
* Override the content of several objects
@@ -4243,7 +4243,7 @@ Index.prototype.saveObjects = function(objects, callback) {
42434243
* error: null or Error('message')
42444244
* content: the server answer that contains 3 elements: createAt, taskId and objectID
42454245
*/
4246-
Index.prototype.deleteObject = function(objectID, callback) {
4246+
Index.prototype.deleteObject = deprecate(function(objectID, callback) {
42474247
if (typeof objectID === 'function' || typeof objectID !== 'string' && typeof objectID !== 'number') {
42484248
var err = new errors.AlgoliaSearchError('Cannot delete an object without an objectID');
42494249
callback = objectID;
@@ -4261,7 +4261,7 @@ Index.prototype.deleteObject = function(objectID, callback) {
42614261
hostType: 'write',
42624262
callback: callback
42634263
});
4264-
};
4264+
}, deprecatedMessage('index.deleteObject(objectID)', 'index.deleteObjects([objectID])'));
42654265

42664266
/*
42674267
* Delete several objects from an index
@@ -4493,7 +4493,7 @@ Index.prototype.browseAll = function(query, queryParameters) {
44934493
* Get a Typeahead.js adapter
44944494
* @param searchParams contains an object with query parameters (see search for details)
44954495
*/
4496-
Index.prototype.ttAdapter = function(params) {
4496+
Index.prototype.ttAdapter = deprecate(function(params) {
44974497
var self = this;
44984498
return function ttAdapter(query, syncCb, asyncCb) {
44994499
var cb;
@@ -4515,7 +4515,9 @@ Index.prototype.ttAdapter = function(params) {
45154515
cb(content.hits);
45164516
});
45174517
};
4518-
};
4518+
},
4519+
'ttAdapter is not necessary anymore and will be removed in the next version,\n' +
4520+
'have a look at autocomplete.js (https://github.com/algolia/autocomplete.js)');
45194521

45204522
/*
45214523
* Wait the publication of a task on the server.
@@ -5512,7 +5514,7 @@ IndexCore.prototype._search = function(params, url, callback, additionalUA) {
55125514
* error: null or Error('message')
55135515
* content: the object to retrieve or the error message if a failure occured
55145516
*/
5515-
IndexCore.prototype.getObject = function(objectID, attrs, callback) {
5517+
IndexCore.prototype.getObject = deprecate(function(objectID, attrs, callback) {
55165518
var indexObj = this;
55175519

55185520
if (arguments.length === 1 || typeof attrs === 'function') {
@@ -5537,7 +5539,7 @@ IndexCore.prototype.getObject = function(objectID, attrs, callback) {
55375539
hostType: 'read',
55385540
callback: callback
55395541
});
5540-
};
5542+
}, deprecatedMessage('index.getObject(objectID)', 'index.getObjects([objectID])'));
55415543

55425544
/*
55435545
* Get several objects from this index
@@ -6283,8 +6285,7 @@ module.exports = function deprecate(fn, message) {
62836285
},{}],28:[function(require,module,exports){
62846286
module.exports = function deprecatedMessage(previousUsage, newUsage) {
62856287
var githubAnchorLink = previousUsage.toLowerCase()
6286-
.replace('.', '')
6287-
.replace('()', '');
6288+
.replace(/[\.\(\)]/g, '');
62886289

62896290
return 'algoliasearch: `' + previousUsage + '` was replaced by `' + newUsage +
62906291
'`. Please see https://github.com/algolia/algoliasearch-client-javascript/wiki/Deprecated#' + githubAnchorLink;
@@ -6559,6 +6560,6 @@ function cleanup() {
65596560
},{"1":1}],36:[function(require,module,exports){
65606561
'use strict';
65616562

6562-
module.exports = '3.24.1';
6563+
module.exports = '3.24.2';
65636564

65646565
},{}]},{},[19]);

dist/algoliasearch.angular.min.js

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/algoliasearch.jquery.js

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! algoliasearch 3.24.1 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */
1+
/*! algoliasearch 3.24.2 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */
22
(function(f){var g;if(typeof window!=='undefined'){g=window}else if(typeof self!=='undefined'){g=self}g.ALGOLIA_MIGRATION_LAYER=f()})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
33

44
module.exports = function load (src, opts, cb) {
@@ -4050,7 +4050,7 @@ inherits(Index, IndexCore);
40504050
* error: null or Error('message')
40514051
* content: the server answer that contains 3 elements: createAt, taskId and objectID
40524052
*/
4053-
Index.prototype.addObject = function(content, objectID, callback) {
4053+
Index.prototype.addObject = deprecate(function(content, objectID, callback) {
40544054
var indexObj = this;
40554055

40564056
if (arguments.length === 1 || typeof objectID === 'function') {
@@ -4068,7 +4068,7 @@ Index.prototype.addObject = function(content, objectID, callback) {
40684068
hostType: 'write',
40694069
callback: callback
40704070
});
4071-
};
4071+
}, deprecatedMessage('index.addObject(obj)', 'index.addObjects([obj])'));
40724072

40734073
/*
40744074
* Add several objects
@@ -4116,7 +4116,7 @@ Index.prototype.addObjects = function(objects, callback) {
41164116
* error: null or Error('message')
41174117
* content: the server answer that contains 3 elements: createAt, taskId and objectID
41184118
*/
4119-
Index.prototype.partialUpdateObject = function(partialObject, createIfNotExists, callback) {
4119+
Index.prototype.partialUpdateObject = deprecate(function(partialObject, createIfNotExists, callback) {
41204120
if (arguments.length === 1 || typeof createIfNotExists === 'function') {
41214121
callback = createIfNotExists;
41224122
createIfNotExists = undefined;
@@ -4135,7 +4135,7 @@ Index.prototype.partialUpdateObject = function(partialObject, createIfNotExists,
41354135
hostType: 'write',
41364136
callback: callback
41374137
});
4138-
};
4138+
}, deprecatedMessage('index.partialUpdateObject(obj)', 'partialUpdateObjects([obj])'));
41394139

41404140
/*
41414141
* Partially Override the content of several objects
@@ -4187,7 +4187,7 @@ Index.prototype.partialUpdateObjects = function(objects, createIfNotExists, call
41874187
* error: null or Error('message')
41884188
* content: the server answer that updateAt and taskID
41894189
*/
4190-
Index.prototype.saveObject = function(object, callback) {
4190+
Index.prototype.saveObject = deprecate(function(object, callback) {
41914191
var indexObj = this;
41924192
return this.as._jsonRequest({
41934193
method: 'PUT',
@@ -4196,7 +4196,7 @@ Index.prototype.saveObject = function(object, callback) {
41964196
hostType: 'write',
41974197
callback: callback
41984198
});
4199-
};
4199+
}, deprecatedMessage('index.saveObject(obj)', 'index.saveObjects([obj])'));
42004200

42014201
/*
42024202
* Override the content of several objects
@@ -4243,7 +4243,7 @@ Index.prototype.saveObjects = function(objects, callback) {
42434243
* error: null or Error('message')
42444244
* content: the server answer that contains 3 elements: createAt, taskId and objectID
42454245
*/
4246-
Index.prototype.deleteObject = function(objectID, callback) {
4246+
Index.prototype.deleteObject = deprecate(function(objectID, callback) {
42474247
if (typeof objectID === 'function' || typeof objectID !== 'string' && typeof objectID !== 'number') {
42484248
var err = new errors.AlgoliaSearchError('Cannot delete an object without an objectID');
42494249
callback = objectID;
@@ -4261,7 +4261,7 @@ Index.prototype.deleteObject = function(objectID, callback) {
42614261
hostType: 'write',
42624262
callback: callback
42634263
});
4264-
};
4264+
}, deprecatedMessage('index.deleteObject(objectID)', 'index.deleteObjects([objectID])'));
42654265

42664266
/*
42674267
* Delete several objects from an index
@@ -4493,7 +4493,7 @@ Index.prototype.browseAll = function(query, queryParameters) {
44934493
* Get a Typeahead.js adapter
44944494
* @param searchParams contains an object with query parameters (see search for details)
44954495
*/
4496-
Index.prototype.ttAdapter = function(params) {
4496+
Index.prototype.ttAdapter = deprecate(function(params) {
44974497
var self = this;
44984498
return function ttAdapter(query, syncCb, asyncCb) {
44994499
var cb;
@@ -4515,7 +4515,9 @@ Index.prototype.ttAdapter = function(params) {
45154515
cb(content.hits);
45164516
});
45174517
};
4518-
};
4518+
},
4519+
'ttAdapter is not necessary anymore and will be removed in the next version,\n' +
4520+
'have a look at autocomplete.js (https://github.com/algolia/autocomplete.js)');
45194521

45204522
/*
45214523
* Wait the publication of a task on the server.
@@ -5512,7 +5514,7 @@ IndexCore.prototype._search = function(params, url, callback, additionalUA) {
55125514
* error: null or Error('message')
55135515
* content: the object to retrieve or the error message if a failure occured
55145516
*/
5515-
IndexCore.prototype.getObject = function(objectID, attrs, callback) {
5517+
IndexCore.prototype.getObject = deprecate(function(objectID, attrs, callback) {
55165518
var indexObj = this;
55175519

55185520
if (arguments.length === 1 || typeof attrs === 'function') {
@@ -5537,7 +5539,7 @@ IndexCore.prototype.getObject = function(objectID, attrs, callback) {
55375539
hostType: 'read',
55385540
callback: callback
55395541
});
5540-
};
5542+
}, deprecatedMessage('index.getObject(objectID)', 'index.getObjects([objectID])'));
55415543

55425544
/*
55435545
* Get several objects from this index
@@ -6229,8 +6231,7 @@ module.exports = function deprecate(fn, message) {
62296231
},{}],28:[function(require,module,exports){
62306232
module.exports = function deprecatedMessage(previousUsage, newUsage) {
62316233
var githubAnchorLink = previousUsage.toLowerCase()
6232-
.replace('.', '')
6233-
.replace('()', '');
6234+
.replace(/[\.\(\)]/g, '');
62346235

62356236
return 'algoliasearch: `' + previousUsage + '` was replaced by `' + newUsage +
62366237
'`. Please see https://github.com/algolia/algoliasearch-client-javascript/wiki/Deprecated#' + githubAnchorLink;
@@ -6505,6 +6506,6 @@ function cleanup() {
65056506
},{"1":1}],36:[function(require,module,exports){
65066507
'use strict';
65076508

6508-
module.exports = '3.24.1';
6509+
module.exports = '3.24.2';
65096510

65106511
},{}]},{},[19]);

dist/algoliasearch.jquery.min.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)