Skip to content

Commit b7bd36b

Browse files
author
vvo
committed
3.22.0
* feat(API): rename all *userKey[s] methods to *apiKey[s] * client/index.listUserKeys() => client/index.listApiKeys() * client/index.getUserKeyACL() => client/index.getApiKey() * client/index.deleteUserKey() => client/index.deleteApiKey() * client/index.addUserKey() => client/index.addApiKey() * client/index.udpateUserKey() => client/index.updateApiKey() * fix(packaging): remove useless files for packaging (reduce package file size)
1 parent df6ff4b commit b7bd36b

13 files changed

+470
-182
lines changed

CHANGELOG.md

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
CHANGELOG
22

3+
2017-03-13 3.22.0
4+
5+
* feat(API): rename all *userKey[s] methods to *apiKey[s]
6+
* client/index.listUserKeys() => client/index.listApiKeys()
7+
* client/index.getUserKeyACL() => client/index.getApiKey()
8+
* client/index.deleteUserKey() => client/index.deleteApiKey()
9+
* client/index.addUserKey() => client/index.addApiKey()
10+
* client/index.udpateUserKey() => client/index.updateApiKey()
11+
* fix(packaging): remove useless files for packaging (reduce package file size)
12+
313
2017-02-08 3.21.1
4-
* fix(browse*): use POST instead of GET to avoid limits (#503)
14+
15+
* fix(browse*): use POST instead of GET to avoid limits (#503)
516

617
2017-02-06 3.21.0
7-
* feat(x-algolia-agent): specify x-algolia-agent at search time
8-
* fix(parse): check for `global` existence before erasing
18+
19+
* feat(x-algolia-agent): specify x-algolia-agent at search time
20+
* fix(parse): check for `global` existence before erasing
921

1022
2017-01-16 3.20.4
1123

bower.json

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

dist/algoliasearch.angular.js

+110-41
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! algoliasearch 3.21.1 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */
1+
/*! algoliasearch 3.22.0 | © 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) {
@@ -2851,13 +2851,20 @@ AlgoliaSearch.prototype.initIndex = function(indexName) {
28512851
};
28522852

28532853
/*
2854-
* List all existing user keys with their associated ACLs
2854+
* @deprecated use client.listApiKeys
2855+
*/
2856+
AlgoliaSearch.prototype.listUserKeys = deprecate(function(callback) {
2857+
return this.listApiKeys(callback);
2858+
}, deprecatedMessage('client.listUserKeys()', 'client.listApiKeys()'));
2859+
2860+
/*
2861+
* List all existing api keys with their associated ACLs
28552862
*
28562863
* @param callback the result callback called with two arguments
28572864
* error: null or Error('message')
2858-
* content: the server answer with user keys list
2865+
* content: the server answer with api keys list
28592866
*/
2860-
AlgoliaSearch.prototype.listUserKeys = function(callback) {
2867+
AlgoliaSearch.prototype.listApiKeys = function(callback) {
28612868
return this._jsonRequest({
28622869
method: 'GET',
28632870
url: '/1/keys',
@@ -2867,14 +2874,21 @@ AlgoliaSearch.prototype.listUserKeys = function(callback) {
28672874
};
28682875

28692876
/*
2870-
* Get ACL of a user key
2877+
* @deprecated see client.getApiKey
2878+
*/
2879+
AlgoliaSearch.prototype.getUserKeyACL = deprecate(function(key, callback) {
2880+
return this.getApiKey(key, callback);
2881+
}, deprecatedMessage('client.getUserKeyACL()', 'client.getApiKey()'));
2882+
2883+
/*
2884+
* Get an API key
28712885
*
28722886
* @param key
28732887
* @param callback the result callback called with two arguments
28742888
* error: null or Error('message')
2875-
* content: the server answer with user keys list
2889+
* content: the server answer with the right API key
28762890
*/
2877-
AlgoliaSearch.prototype.getUserKeyACL = function(key, callback) {
2891+
AlgoliaSearch.prototype.getApiKey = function(key, callback) {
28782892
return this._jsonRequest({
28792893
method: 'GET',
28802894
url: '/1/keys/' + key,
@@ -2884,13 +2898,20 @@ AlgoliaSearch.prototype.getUserKeyACL = function(key, callback) {
28842898
};
28852899

28862900
/*
2887-
* Delete an existing user key
2901+
* @deprecated see client.deleteApiKey
2902+
*/
2903+
AlgoliaSearch.prototype.deleteUserKey = deprecate(function(key, callback) {
2904+
return this.deleteApiKey(key, callback);
2905+
}, deprecatedMessage('client.deleteUserKey()', 'client.deleteApiKey()'));
2906+
2907+
/*
2908+
* Delete an existing API key
28882909
* @param key
28892910
* @param callback the result callback called with two arguments
28902911
* error: null or Error('message')
2891-
* content: the server answer with user keys list
2912+
* content: the server answer with the date of deletion
28922913
*/
2893-
AlgoliaSearch.prototype.deleteUserKey = function(key, callback) {
2914+
AlgoliaSearch.prototype.deleteApiKey = function(key, callback) {
28942915
return this._jsonRequest({
28952916
method: 'DELETE',
28962917
url: '/1/keys/' + key,
@@ -2899,6 +2920,13 @@ AlgoliaSearch.prototype.deleteUserKey = function(key, callback) {
28992920
});
29002921
};
29012922

2923+
/*
2924+
@deprecated see client.addApiKey
2925+
*/
2926+
AlgoliaSearch.prototype.addUserKey = deprecate(function(acls, params, callback) {
2927+
return this.addApiKey(acls, params, callback);
2928+
}, deprecatedMessage('client.addUserKey()', 'client.addApiKey()'));
2929+
29022930
/*
29032931
* Add a new global API key
29042932
*
@@ -2920,7 +2948,7 @@ AlgoliaSearch.prototype.deleteUserKey = function(key, callback) {
29202948
* @param {Object} params.queryParameters - Force the key to use specific query parameters
29212949
* @param {Function} callback - The result callback called with two arguments
29222950
* error: null or Error('message')
2923-
* content: the server answer with user keys list
2951+
* content: the server answer with the added API key
29242952
* @return {Promise|undefined} Returns a promise if no callback given
29252953
* @example
29262954
* client.addUserKey(['search'], {
@@ -2936,9 +2964,9 @@ AlgoliaSearch.prototype.deleteUserKey = function(key, callback) {
29362964
* })
29372965
* @see {@link https://www.algolia.com/doc/rest_api#AddKey|Algolia REST API Documentation}
29382966
*/
2939-
AlgoliaSearch.prototype.addUserKey = function(acls, params, callback) {
2967+
AlgoliaSearch.prototype.addApiKey = function(acls, params, callback) {
29402968
var isArray = require(8);
2941-
var usage = 'Usage: client.addUserKey(arrayOfAcls[, params, callback])';
2969+
var usage = 'Usage: client.addApiKey(arrayOfAcls[, params, callback])';
29422970

29432971
if (!isArray(acls)) {
29442972
throw new Error(usage);
@@ -2977,12 +3005,18 @@ AlgoliaSearch.prototype.addUserKey = function(acls, params, callback) {
29773005
};
29783006

29793007
/**
2980-
* Add a new global API key
2981-
* @deprecated Please use client.addUserKey()
3008+
* @deprecated Please use client.addApiKey()
29823009
*/
29833010
AlgoliaSearch.prototype.addUserKeyWithValidity = deprecate(function(acls, params, callback) {
2984-
return this.addUserKey(acls, params, callback);
2985-
}, deprecatedMessage('client.addUserKeyWithValidity()', 'client.addUserKey()'));
3011+
return this.addApiKey(acls, params, callback);
3012+
}, deprecatedMessage('client.addUserKeyWithValidity()', 'client.addApiKey()'));
3013+
3014+
/**
3015+
* @deprecated Please use client.updateApiKey()
3016+
*/
3017+
AlgoliaSearch.prototype.updateUserKey = deprecate(function(key, acls, params, callback) {
3018+
return this.updateApiKey(key, acls, params, callback);
3019+
}, deprecatedMessage('client.updateUserKey()', 'client.updateApiKey()'));
29863020

29873021
/**
29883022
* Update an existing API key
@@ -3005,10 +3039,10 @@ AlgoliaSearch.prototype.addUserKeyWithValidity = deprecate(function(acls, params
30053039
* @param {Object} params.queryParameters - Force the key to use specific query parameters
30063040
* @param {Function} callback - The result callback called with two arguments
30073041
* error: null or Error('message')
3008-
* content: the server answer with user keys list
3042+
* content: the server answer with the modified API key
30093043
* @return {Promise|undefined} Returns a promise if no callback given
30103044
* @example
3011-
* client.updateUserKey('APIKEY', ['search'], {
3045+
* client.updateApiKey('APIKEY', ['search'], {
30123046
* validity: 300,
30133047
* maxQueriesPerIPPerHour: 2000,
30143048
* maxHitsPerQuery: 3,
@@ -3021,9 +3055,9 @@ AlgoliaSearch.prototype.addUserKeyWithValidity = deprecate(function(acls, params
30213055
* })
30223056
* @see {@link https://www.algolia.com/doc/rest_api#UpdateIndexKey|Algolia REST API Documentation}
30233057
*/
3024-
AlgoliaSearch.prototype.updateUserKey = function(key, acls, params, callback) {
3058+
AlgoliaSearch.prototype.updateApiKey = function(key, acls, params, callback) {
30253059
var isArray = require(8);
3026-
var usage = 'Usage: client.updateUserKey(key, arrayOfAcls[, params, callback])';
3060+
var usage = 'Usage: client.updateApiKey(key, arrayOfAcls[, params, callback])';
30273061

30283062
if (!isArray(acls)) {
30293063
throw new Error(usage);
@@ -4742,13 +4776,20 @@ Index.prototype.setSettings = function(settings, opts, callback) {
47424776
};
47434777

47444778
/*
4745-
* List all existing user keys associated to this index
4779+
@deprecated see index.listApiKeys
4780+
*/
4781+
Index.prototype.listUserKeys = deprecate(function(callback) {
4782+
return this.listApiKeys(callback);
4783+
}, deprecatedMessage('index.listUserKeys()', 'index.listApiKeys()'));
4784+
4785+
/*
4786+
* List all existing API keys to this index
47464787
*
47474788
* @param callback the result callback called with two arguments
47484789
* error: null or Error('message')
4749-
* content: the server answer with user keys list
4790+
* content: the server answer with API keys belonging to the index
47504791
*/
4751-
Index.prototype.listUserKeys = function(callback) {
4792+
Index.prototype.listApiKeys = function(callback) {
47524793
var indexObj = this;
47534794
return this.as._jsonRequest({
47544795
method: 'GET',
@@ -4759,14 +4800,22 @@ Index.prototype.listUserKeys = function(callback) {
47594800
};
47604801

47614802
/*
4762-
* Get ACL of a user key associated to this index
4803+
@deprecated see index.getApiKey
4804+
*/
4805+
Index.prototype.getUserKeyACL = deprecate(function(key, callback) {
4806+
return this.getApiKey(key, callback);
4807+
}, deprecatedMessage('index.getUserKeyACL()', 'index.getApiKey()'));
4808+
4809+
4810+
/*
4811+
* Get an API key from this index
47634812
*
47644813
* @param key
47654814
* @param callback the result callback called with two arguments
47664815
* error: null or Error('message')
4767-
* content: the server answer with user keys list
4816+
* content: the server answer with the right API key
47684817
*/
4769-
Index.prototype.getUserKeyACL = function(key, callback) {
4818+
Index.prototype.getApiKey = function(key, callback) {
47704819
var indexObj = this;
47714820
return this.as._jsonRequest({
47724821
method: 'GET',
@@ -4777,14 +4826,21 @@ Index.prototype.getUserKeyACL = function(key, callback) {
47774826
};
47784827

47794828
/*
4780-
* Delete an existing user key associated to this index
4829+
@deprecated see index.deleteApiKey
4830+
*/
4831+
Index.prototype.deleteUserKey = deprecate(function(key, callback) {
4832+
return this.deleteApiKey(key, callback);
4833+
}, deprecatedMessage('index.deleteUserKey()', 'index.deleteApiKey()'));
4834+
4835+
/*
4836+
* Delete an existing API key associated to this index
47814837
*
47824838
* @param key
47834839
* @param callback the result callback called with two arguments
47844840
* error: null or Error('message')
4785-
* content: the server answer with user keys list
4841+
* content: the server answer with the deletion date
47864842
*/
4787-
Index.prototype.deleteUserKey = function(key, callback) {
4843+
Index.prototype.deleteApiKey = function(key, callback) {
47884844
var indexObj = this;
47894845
return this.as._jsonRequest({
47904846
method: 'DELETE',
@@ -4794,6 +4850,13 @@ Index.prototype.deleteUserKey = function(key, callback) {
47944850
});
47954851
};
47964852

4853+
/*
4854+
@deprecated see index.addApiKey
4855+
*/
4856+
Index.prototype.addUserKey = deprecate(function(acls, params, callback) {
4857+
return this.addApiKey(acls, params, callback);
4858+
}, deprecatedMessage('index.addUserKey()', 'index.addApiKey()'));
4859+
47974860
/*
47984861
* Add a new API key to this index
47994862
*
@@ -4815,7 +4878,7 @@ Index.prototype.deleteUserKey = function(key, callback) {
48154878
* @param {Object} params.queryParameters - Force the key to use specific query parameters
48164879
* @param {Function} callback - The result callback called with two arguments
48174880
* error: null or Error('message')
4818-
* content: the server answer with user keys list
4881+
* content: the server answer with the added API key
48194882
* @return {Promise|undefined} Returns a promise if no callback given
48204883
* @example
48214884
* index.addUserKey(['search'], {
@@ -4830,9 +4893,9 @@ Index.prototype.deleteUserKey = function(key, callback) {
48304893
* })
48314894
* @see {@link https://www.algolia.com/doc/rest_api#AddIndexKey|Algolia REST API Documentation}
48324895
*/
4833-
Index.prototype.addUserKey = function(acls, params, callback) {
4896+
Index.prototype.addApiKey = function(acls, params, callback) {
48344897
var isArray = require(8);
4835-
var usage = 'Usage: index.addUserKey(arrayOfAcls[, params, callback])';
4898+
var usage = 'Usage: index.addApiKey(arrayOfAcls[, params, callback])';
48364899

48374900
if (!isArray(acls)) {
48384901
throw new Error(usage);
@@ -4870,12 +4933,18 @@ Index.prototype.addUserKey = function(acls, params, callback) {
48704933
};
48714934

48724935
/**
4873-
* Add an existing user key associated to this index
4874-
* @deprecated use index.addUserKey()
4936+
* @deprecated use index.addApiKey()
48754937
*/
48764938
Index.prototype.addUserKeyWithValidity = deprecate(function deprecatedAddUserKeyWithValidity(acls, params, callback) {
4877-
return this.addUserKey(acls, params, callback);
4878-
}, deprecatedMessage('index.addUserKeyWithValidity()', 'index.addUserKey()'));
4939+
return this.addApiKey(acls, params, callback);
4940+
}, deprecatedMessage('index.addUserKeyWithValidity()', 'index.addApiKey()'));
4941+
4942+
/*
4943+
@deprecated see index.updateApiKey
4944+
*/
4945+
Index.prototype.updateUserKey = deprecate(function(key, acls, params, callback) {
4946+
return this.updateApiKey(key, acls, params, callback);
4947+
}, deprecatedMessage('index.updateUserKey()', 'index.updateApiKey()'));
48794948

48804949
/**
48814950
* Update an existing API key of this index
@@ -4901,7 +4970,7 @@ Index.prototype.addUserKeyWithValidity = deprecate(function deprecatedAddUserKey
49014970
* content: the server answer with user keys list
49024971
* @return {Promise|undefined} Returns a promise if no callback given
49034972
* @example
4904-
* index.updateUserKey('APIKEY', ['search'], {
4973+
* index.updateApiKey('APIKEY', ['search'], {
49054974
* validity: 300,
49064975
* maxQueriesPerIPPerHour: 2000,
49074976
* maxHitsPerQuery: 3,
@@ -4913,9 +4982,9 @@ Index.prototype.addUserKeyWithValidity = deprecate(function deprecatedAddUserKey
49134982
* })
49144983
* @see {@link https://www.algolia.com/doc/rest_api#UpdateIndexKey|Algolia REST API Documentation}
49154984
*/
4916-
Index.prototype.updateUserKey = function(key, acls, params, callback) {
4985+
Index.prototype.updateApiKey = function(key, acls, params, callback) {
49174986
var isArray = require(8);
4918-
var usage = 'Usage: index.updateUserKey(key, arrayOfAcls[, params, callback])';
4987+
var usage = 'Usage: index.updateApiKey(key, arrayOfAcls[, params, callback])';
49194988

49204989
if (!isArray(acls)) {
49214990
throw new Error(usage);
@@ -6339,6 +6408,6 @@ function cleanup() {
63396408
},{"1":1}],36:[function(require,module,exports){
63406409
'use strict';
63416410

6342-
module.exports = '3.21.1';
6411+
module.exports = '3.22.0';
63436412

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

dist/algoliasearch.angular.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)