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 */
2
2
( 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 ) {
3
3
4
4
module . exports = function load ( src , opts , cb ) {
@@ -2851,13 +2851,20 @@ AlgoliaSearch.prototype.initIndex = function(indexName) {
2851
2851
} ;
2852
2852
2853
2853
/*
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
2855
2862
*
2856
2863
* @param callback the result callback called with two arguments
2857
2864
* error: null or Error('message')
2858
- * content: the server answer with user keys list
2865
+ * content: the server answer with api keys list
2859
2866
*/
2860
- AlgoliaSearch . prototype . listUserKeys = function ( callback ) {
2867
+ AlgoliaSearch . prototype . listApiKeys = function ( callback ) {
2861
2868
return this . _jsonRequest ( {
2862
2869
method : 'GET' ,
2863
2870
url : '/1/keys' ,
@@ -2867,14 +2874,21 @@ AlgoliaSearch.prototype.listUserKeys = function(callback) {
2867
2874
} ;
2868
2875
2869
2876
/*
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
2871
2885
*
2872
2886
* @param key
2873
2887
* @param callback the result callback called with two arguments
2874
2888
* error: null or Error('message')
2875
- * content: the server answer with user keys list
2889
+ * content: the server answer with the right API key
2876
2890
*/
2877
- AlgoliaSearch . prototype . getUserKeyACL = function ( key , callback ) {
2891
+ AlgoliaSearch . prototype . getApiKey = function ( key , callback ) {
2878
2892
return this . _jsonRequest ( {
2879
2893
method : 'GET' ,
2880
2894
url : '/1/keys/' + key ,
@@ -2884,13 +2898,20 @@ AlgoliaSearch.prototype.getUserKeyACL = function(key, callback) {
2884
2898
} ;
2885
2899
2886
2900
/*
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
2888
2909
* @param key
2889
2910
* @param callback the result callback called with two arguments
2890
2911
* error: null or Error('message')
2891
- * content: the server answer with user keys list
2912
+ * content: the server answer with the date of deletion
2892
2913
*/
2893
- AlgoliaSearch . prototype . deleteUserKey = function ( key , callback ) {
2914
+ AlgoliaSearch . prototype . deleteApiKey = function ( key , callback ) {
2894
2915
return this . _jsonRequest ( {
2895
2916
method : 'DELETE' ,
2896
2917
url : '/1/keys/' + key ,
@@ -2899,6 +2920,13 @@ AlgoliaSearch.prototype.deleteUserKey = function(key, callback) {
2899
2920
} ) ;
2900
2921
} ;
2901
2922
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
+
2902
2930
/*
2903
2931
* Add a new global API key
2904
2932
*
@@ -2920,7 +2948,7 @@ AlgoliaSearch.prototype.deleteUserKey = function(key, callback) {
2920
2948
* @param {Object } params.queryParameters - Force the key to use specific query parameters
2921
2949
* @param {Function } callback - The result callback called with two arguments
2922
2950
* error: null or Error('message')
2923
- * content: the server answer with user keys list
2951
+ * content: the server answer with the added API key
2924
2952
* @return {Promise|undefined } Returns a promise if no callback given
2925
2953
* @example
2926
2954
* client.addUserKey(['search'], {
@@ -2936,9 +2964,9 @@ AlgoliaSearch.prototype.deleteUserKey = function(key, callback) {
2936
2964
* })
2937
2965
* @see {@link https://www.algolia.com/doc/rest_api#AddKey|Algolia REST API Documentation }
2938
2966
*/
2939
- AlgoliaSearch . prototype . addUserKey = function ( acls , params , callback ) {
2967
+ AlgoliaSearch . prototype . addApiKey = function ( acls , params , callback ) {
2940
2968
var isArray = require ( 8 ) ;
2941
- var usage = 'Usage: client.addUserKey (arrayOfAcls[, params, callback])' ;
2969
+ var usage = 'Usage: client.addApiKey (arrayOfAcls[, params, callback])' ;
2942
2970
2943
2971
if ( ! isArray ( acls ) ) {
2944
2972
throw new Error ( usage ) ;
@@ -2977,12 +3005,18 @@ AlgoliaSearch.prototype.addUserKey = function(acls, params, callback) {
2977
3005
} ;
2978
3006
2979
3007
/**
2980
- * Add a new global API key
2981
- * @deprecated Please use client.addUserKey()
3008
+ * @deprecated Please use client.addApiKey()
2982
3009
*/
2983
3010
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()' ) ) ;
2986
3020
2987
3021
/**
2988
3022
* Update an existing API key
@@ -3005,10 +3039,10 @@ AlgoliaSearch.prototype.addUserKeyWithValidity = deprecate(function(acls, params
3005
3039
* @param {Object } params.queryParameters - Force the key to use specific query parameters
3006
3040
* @param {Function } callback - The result callback called with two arguments
3007
3041
* error: null or Error('message')
3008
- * content: the server answer with user keys list
3042
+ * content: the server answer with the modified API key
3009
3043
* @return {Promise|undefined } Returns a promise if no callback given
3010
3044
* @example
3011
- * client.updateUserKey ('APIKEY', ['search'], {
3045
+ * client.updateApiKey ('APIKEY', ['search'], {
3012
3046
* validity: 300,
3013
3047
* maxQueriesPerIPPerHour: 2000,
3014
3048
* maxHitsPerQuery: 3,
@@ -3021,9 +3055,9 @@ AlgoliaSearch.prototype.addUserKeyWithValidity = deprecate(function(acls, params
3021
3055
* })
3022
3056
* @see {@link https://www.algolia.com/doc/rest_api#UpdateIndexKey|Algolia REST API Documentation }
3023
3057
*/
3024
- AlgoliaSearch . prototype . updateUserKey = function ( key , acls , params , callback ) {
3058
+ AlgoliaSearch . prototype . updateApiKey = function ( key , acls , params , callback ) {
3025
3059
var isArray = require ( 8 ) ;
3026
- var usage = 'Usage: client.updateUserKey (key, arrayOfAcls[, params, callback])' ;
3060
+ var usage = 'Usage: client.updateApiKey (key, arrayOfAcls[, params, callback])' ;
3027
3061
3028
3062
if ( ! isArray ( acls ) ) {
3029
3063
throw new Error ( usage ) ;
@@ -4742,13 +4776,20 @@ Index.prototype.setSettings = function(settings, opts, callback) {
4742
4776
} ;
4743
4777
4744
4778
/*
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
4746
4787
*
4747
4788
* @param callback the result callback called with two arguments
4748
4789
* 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
4750
4791
*/
4751
- Index . prototype . listUserKeys = function ( callback ) {
4792
+ Index . prototype . listApiKeys = function ( callback ) {
4752
4793
var indexObj = this ;
4753
4794
return this . as . _jsonRequest ( {
4754
4795
method : 'GET' ,
@@ -4759,14 +4800,22 @@ Index.prototype.listUserKeys = function(callback) {
4759
4800
} ;
4760
4801
4761
4802
/*
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
4763
4812
*
4764
4813
* @param key
4765
4814
* @param callback the result callback called with two arguments
4766
4815
* error: null or Error('message')
4767
- * content: the server answer with user keys list
4816
+ * content: the server answer with the right API key
4768
4817
*/
4769
- Index . prototype . getUserKeyACL = function ( key , callback ) {
4818
+ Index . prototype . getApiKey = function ( key , callback ) {
4770
4819
var indexObj = this ;
4771
4820
return this . as . _jsonRequest ( {
4772
4821
method : 'GET' ,
@@ -4777,14 +4826,21 @@ Index.prototype.getUserKeyACL = function(key, callback) {
4777
4826
} ;
4778
4827
4779
4828
/*
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
4781
4837
*
4782
4838
* @param key
4783
4839
* @param callback the result callback called with two arguments
4784
4840
* error: null or Error('message')
4785
- * content: the server answer with user keys list
4841
+ * content: the server answer with the deletion date
4786
4842
*/
4787
- Index . prototype . deleteUserKey = function ( key , callback ) {
4843
+ Index . prototype . deleteApiKey = function ( key , callback ) {
4788
4844
var indexObj = this ;
4789
4845
return this . as . _jsonRequest ( {
4790
4846
method : 'DELETE' ,
@@ -4794,6 +4850,13 @@ Index.prototype.deleteUserKey = function(key, callback) {
4794
4850
} ) ;
4795
4851
} ;
4796
4852
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
+
4797
4860
/*
4798
4861
* Add a new API key to this index
4799
4862
*
@@ -4815,7 +4878,7 @@ Index.prototype.deleteUserKey = function(key, callback) {
4815
4878
* @param {Object } params.queryParameters - Force the key to use specific query parameters
4816
4879
* @param {Function } callback - The result callback called with two arguments
4817
4880
* error: null or Error('message')
4818
- * content: the server answer with user keys list
4881
+ * content: the server answer with the added API key
4819
4882
* @return {Promise|undefined } Returns a promise if no callback given
4820
4883
* @example
4821
4884
* index.addUserKey(['search'], {
@@ -4830,9 +4893,9 @@ Index.prototype.deleteUserKey = function(key, callback) {
4830
4893
* })
4831
4894
* @see {@link https://www.algolia.com/doc/rest_api#AddIndexKey|Algolia REST API Documentation }
4832
4895
*/
4833
- Index . prototype . addUserKey = function ( acls , params , callback ) {
4896
+ Index . prototype . addApiKey = function ( acls , params , callback ) {
4834
4897
var isArray = require ( 8 ) ;
4835
- var usage = 'Usage: index.addUserKey (arrayOfAcls[, params, callback])' ;
4898
+ var usage = 'Usage: index.addApiKey (arrayOfAcls[, params, callback])' ;
4836
4899
4837
4900
if ( ! isArray ( acls ) ) {
4838
4901
throw new Error ( usage ) ;
@@ -4870,12 +4933,18 @@ Index.prototype.addUserKey = function(acls, params, callback) {
4870
4933
} ;
4871
4934
4872
4935
/**
4873
- * Add an existing user key associated to this index
4874
- * @deprecated use index.addUserKey()
4936
+ * @deprecated use index.addApiKey()
4875
4937
*/
4876
4938
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()' ) ) ;
4879
4948
4880
4949
/**
4881
4950
* Update an existing API key of this index
@@ -4901,7 +4970,7 @@ Index.prototype.addUserKeyWithValidity = deprecate(function deprecatedAddUserKey
4901
4970
* content: the server answer with user keys list
4902
4971
* @return {Promise|undefined } Returns a promise if no callback given
4903
4972
* @example
4904
- * index.updateUserKey ('APIKEY', ['search'], {
4973
+ * index.updateApiKey ('APIKEY', ['search'], {
4905
4974
* validity: 300,
4906
4975
* maxQueriesPerIPPerHour: 2000,
4907
4976
* maxHitsPerQuery: 3,
@@ -4913,9 +4982,9 @@ Index.prototype.addUserKeyWithValidity = deprecate(function deprecatedAddUserKey
4913
4982
* })
4914
4983
* @see {@link https://www.algolia.com/doc/rest_api#UpdateIndexKey|Algolia REST API Documentation }
4915
4984
*/
4916
- Index . prototype . updateUserKey = function ( key , acls , params , callback ) {
4985
+ Index . prototype . updateApiKey = function ( key , acls , params , callback ) {
4917
4986
var isArray = require ( 8 ) ;
4918
- var usage = 'Usage: index.updateUserKey (key, arrayOfAcls[, params, callback])' ;
4987
+ var usage = 'Usage: index.updateApiKey (key, arrayOfAcls[, params, callback])' ;
4919
4988
4920
4989
if ( ! isArray ( acls ) ) {
4921
4990
throw new Error ( usage ) ;
@@ -6339,6 +6408,6 @@ function cleanup() {
6339
6408
} , { "1" :1 } ] , 36 :[ function ( require , module , exports ) {
6340
6409
'use strict' ;
6341
6410
6342
- module . exports = '3.21.1 ' ;
6411
+ module . exports = '3.22.0 ' ;
6343
6412
6344
6413
} , { } ] } , { } , [ 19 ] ) ;
0 commit comments