@ovh-ux/ng-ovh-contact 5.1.2 → 5.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [5.1.3](https://github.com/ovh/manager/compare/@ovh-ux/ng-ovh-contact@5.1.2...@ovh-ux/ng-ovh-contact@5.1.3) (2022-07-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **contact:** replace $resource call using iceberg ([e46eaaf](https://github.com/ovh/manager/commit/e46eaaf3e5f004eede27c07d89080e00fb456715))
7
+ * **deps:** bump dependencies ([2bbbf54](https://github.com/ovh/manager/commit/2bbbf540b44ed1bffb555fc55045a6f9ea756e78))
8
+
9
+
10
+
1
11
  ## [5.1.2](https://github.com/ovh/manager/compare/@ovh-ux/ng-ovh-contact@5.1.1...@ovh-ux/ng-ovh-contact@5.1.2) (2022-06-07)
2
12
 
3
13
 
package/dist/cjs/index.js CHANGED
@@ -1,4 +1,4 @@
1
- function cssInjectcab539baeec27d3d(css) {
1
+ function cssInject9dfdbe6f8ee1b21b(css) {
2
2
  if (!css || typeof document === 'undefined') return '';
3
3
  const head = document.head || document.getElementsByTagName('head')[0];
4
4
  const style = document.createElement('style');
@@ -40,6 +40,7 @@ require('angular-translate');
40
40
  require('ovh-api-services');
41
41
  require('ui-select');
42
42
  require('angular-ui-bootstrap');
43
+ require('@ovh-ux/ng-ovh-api-wrappers');
43
44
  var moment = require('moment');
44
45
 
45
46
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -2001,7 +2002,7 @@ MapCache.prototype.set = mapCacheSet;
2001
2002
 
2002
2003
  /** Error message constants. */
2003
2004
 
2004
- var FUNC_ERROR_TEXT$1 = 'Expected a function';
2005
+ var FUNC_ERROR_TEXT = 'Expected a function';
2005
2006
  /**
2006
2007
  * Creates a function that memoizes the result of `func`. If `resolver` is
2007
2008
  * provided, it determines the cache key for storing the result based on the
@@ -2049,7 +2050,7 @@ var FUNC_ERROR_TEXT$1 = 'Expected a function';
2049
2050
 
2050
2051
  function memoize(func, resolver) {
2051
2052
  if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {
2052
- throw new TypeError(FUNC_ERROR_TEXT$1);
2053
+ throw new TypeError(FUNC_ERROR_TEXT);
2053
2054
  }
2054
2055
 
2055
2056
  var memoized = function memoized() {
@@ -4283,54 +4284,6 @@ function baseMap(collection, iteratee) {
4283
4284
  return result;
4284
4285
  }
4285
4286
 
4286
- /**
4287
- * Creates an array of values by running each element in `collection` thru
4288
- * `iteratee`. The iteratee is invoked with three arguments:
4289
- * (value, index|key, collection).
4290
- *
4291
- * Many lodash methods are guarded to work as iteratees for methods like
4292
- * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
4293
- *
4294
- * The guarded methods are:
4295
- * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
4296
- * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
4297
- * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
4298
- * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
4299
- *
4300
- * @static
4301
- * @memberOf _
4302
- * @since 0.1.0
4303
- * @category Collection
4304
- * @param {Array|Object} collection The collection to iterate over.
4305
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
4306
- * @returns {Array} Returns the new mapped array.
4307
- * @example
4308
- *
4309
- * function square(n) {
4310
- * return n * n;
4311
- * }
4312
- *
4313
- * _.map([4, 8], square);
4314
- * // => [16, 64]
4315
- *
4316
- * _.map({ 'a': 4, 'b': 8 }, square);
4317
- * // => [16, 64] (iteration order is not guaranteed)
4318
- *
4319
- * var users = [
4320
- * { 'user': 'barney' },
4321
- * { 'user': 'fred' }
4322
- * ];
4323
- *
4324
- * // The `_.property` iteratee shorthand.
4325
- * _.map(users, 'user');
4326
- * // => ['barney', 'fred']
4327
- */
4328
-
4329
- function map(collection, iteratee) {
4330
- var func = isArray(collection) ? arrayMap : baseMap;
4331
- return func(collection, baseIteratee(iteratee));
4332
- }
4333
-
4334
4287
  /** Used for built-in method references. */
4335
4288
  var objectProto = Object.prototype;
4336
4289
  /** Used to check objects for own properties. */
@@ -4402,55 +4355,6 @@ function isUndefined(value) {
4402
4355
  return value === undefined;
4403
4356
  }
4404
4357
 
4405
- /** Error message constants. */
4406
- var FUNC_ERROR_TEXT = 'Expected a function';
4407
- /**
4408
- * Creates a function that negates the result of the predicate `func`. The
4409
- * `func` predicate is invoked with the `this` binding and arguments of the
4410
- * created function.
4411
- *
4412
- * @static
4413
- * @memberOf _
4414
- * @since 3.0.0
4415
- * @category Function
4416
- * @param {Function} predicate The predicate to negate.
4417
- * @returns {Function} Returns the new negated function.
4418
- * @example
4419
- *
4420
- * function isEven(n) {
4421
- * return n % 2 == 0;
4422
- * }
4423
- *
4424
- * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
4425
- * // => [1, 3, 5]
4426
- */
4427
-
4428
- function negate(predicate) {
4429
- if (typeof predicate != 'function') {
4430
- throw new TypeError(FUNC_ERROR_TEXT);
4431
- }
4432
-
4433
- return function () {
4434
- var args = arguments;
4435
-
4436
- switch (args.length) {
4437
- case 0:
4438
- return !predicate.call(this);
4439
-
4440
- case 1:
4441
- return !predicate.call(this, args[0]);
4442
-
4443
- case 2:
4444
- return !predicate.call(this, args[0], args[1]);
4445
-
4446
- case 3:
4447
- return !predicate.call(this, args[0], args[1], args[2]);
4448
- }
4449
-
4450
- return !predicate.apply(this, args);
4451
- };
4452
- }
4453
-
4454
4358
  /**
4455
4359
  * The base implementation of `_.set`.
4456
4360
  *
@@ -4619,46 +4523,6 @@ function baseOrderBy(collection, iteratees, orders) {
4619
4523
  });
4620
4524
  }
4621
4525
 
4622
- /**
4623
- * The opposite of `_.filter`; this method returns the elements of `collection`
4624
- * that `predicate` does **not** return truthy for.
4625
- *
4626
- * @static
4627
- * @memberOf _
4628
- * @since 0.1.0
4629
- * @category Collection
4630
- * @param {Array|Object} collection The collection to iterate over.
4631
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
4632
- * @returns {Array} Returns the new filtered array.
4633
- * @see _.filter
4634
- * @example
4635
- *
4636
- * var users = [
4637
- * { 'user': 'barney', 'age': 36, 'active': false },
4638
- * { 'user': 'fred', 'age': 40, 'active': true }
4639
- * ];
4640
- *
4641
- * _.reject(users, function(o) { return !o.active; });
4642
- * // => objects for ['fred']
4643
- *
4644
- * // The `_.matches` iteratee shorthand.
4645
- * _.reject(users, { 'age': 40, 'active': true });
4646
- * // => objects for ['barney']
4647
- *
4648
- * // The `_.matchesProperty` iteratee shorthand.
4649
- * _.reject(users, ['active', false]);
4650
- * // => objects for ['fred']
4651
- *
4652
- * // The `_.property` iteratee shorthand.
4653
- * _.reject(users, 'active');
4654
- * // => objects for ['barney']
4655
- */
4656
-
4657
- function reject(collection, predicate) {
4658
- var func = isArray(collection) ? arrayFilter : baseFilter;
4659
- return func(collection, negate(baseIteratee(predicate)));
4660
- }
4661
-
4662
4526
  /**
4663
4527
  * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
4664
4528
  * it's created. Arrays are created for missing index properties while objects
@@ -4718,72 +4582,6 @@ var snakeCase = createCompounder(function (result, word, index) {
4718
4582
  return result + (index ? '_' : '') + word.toLowerCase();
4719
4583
  });
4720
4584
 
4721
- /**
4722
- * The base implementation of `_.some` without support for iteratee shorthands.
4723
- *
4724
- * @private
4725
- * @param {Array|Object} collection The collection to iterate over.
4726
- * @param {Function} predicate The function invoked per iteration.
4727
- * @returns {boolean} Returns `true` if any element passes the predicate check,
4728
- * else `false`.
4729
- */
4730
-
4731
- function baseSome(collection, predicate) {
4732
- var result;
4733
- baseEach(collection, function (value, index, collection) {
4734
- result = predicate(value, index, collection);
4735
- return !result;
4736
- });
4737
- return !!result;
4738
- }
4739
-
4740
- /**
4741
- * Checks if `predicate` returns truthy for **any** element of `collection`.
4742
- * Iteration is stopped once `predicate` returns truthy. The predicate is
4743
- * invoked with three arguments: (value, index|key, collection).
4744
- *
4745
- * @static
4746
- * @memberOf _
4747
- * @since 0.1.0
4748
- * @category Collection
4749
- * @param {Array|Object} collection The collection to iterate over.
4750
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
4751
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
4752
- * @returns {boolean} Returns `true` if any element passes the predicate check,
4753
- * else `false`.
4754
- * @example
4755
- *
4756
- * _.some([null, 0, 'yes', false], Boolean);
4757
- * // => true
4758
- *
4759
- * var users = [
4760
- * { 'user': 'barney', 'active': true },
4761
- * { 'user': 'fred', 'active': false }
4762
- * ];
4763
- *
4764
- * // The `_.matches` iteratee shorthand.
4765
- * _.some(users, { 'user': 'barney', 'active': false });
4766
- * // => false
4767
- *
4768
- * // The `_.matchesProperty` iteratee shorthand.
4769
- * _.some(users, ['active', false]);
4770
- * // => true
4771
- *
4772
- * // The `_.property` iteratee shorthand.
4773
- * _.some(users, 'active');
4774
- * // => true
4775
- */
4776
-
4777
- function some(collection, predicate, guard) {
4778
- var func = isArray(collection) ? arraySome : baseSome;
4779
-
4780
- if (guard && isIterateeCall(collection, predicate, guard)) {
4781
- predicate = undefined;
4782
- }
4783
-
4784
- return func(collection, baseIteratee(predicate));
4785
- }
4786
-
4787
4585
  /**
4788
4586
  * Creates an array of elements, sorted in ascending order by the results of
4789
4587
  * running each element in a collection thru each iteratee. This method
@@ -8752,7 +8550,7 @@ function _ngInjectExport(OvhApiMe, CONTACT_PROTOTYPE_PATH) {
8752
8550
 
8753
8551
  function provider () {
8754
8552
  var self = this;
8755
- self.$get = ["$q", "$translate", "OvhContact", "OvhApiMe", "CONTACT_EMAIL_REGEX", function $get($q, $translate, OvhContact, OvhApiMe, CONTACT_EMAIL_REGEX) {
8553
+ self.$get = ["$q", "$translate", "OvhContact", "OvhApiMe", "CONTACT_EMAIL_REGEX", "iceberg", function $get($q, $translate, OvhContact, OvhApiMe, CONTACT_EMAIL_REGEX, iceberg) {
8756
8554
  /**
8757
8555
  * @ngdoc service
8758
8556
  * @name ovhContact.service:ovhContact
@@ -8870,7 +8668,7 @@ function provider () {
8870
8668
  * @methodOf ovhContact.service:ovhContact
8871
8669
  *
8872
8670
  * @description
8873
- * Get the entire list of contacts. This use api v7 to get all contacts details.
8671
+ * Get the entire list of contacts. This use api iceberg to get all contacts details.
8874
8672
  *
8875
8673
  * @param {Boolean} refresh Flag telling to fully recreate the contact list.
8876
8674
  *
@@ -8885,13 +8683,15 @@ function provider () {
8885
8683
  contacts = [];
8886
8684
  }
8887
8685
 
8888
- return OvhApiMe.Contact().v7().query().$promise.then(function (contactsList) {
8686
+ return iceberg('/me/contact').query().expand('CachedObjectList-Pages').execute().$promise.then(function (_ref) {
8687
+ var contactsList = _ref.data;
8889
8688
  // filter contact that are not already added
8890
8689
  // this avoid loosing contact object reference
8891
8690
  // then add contact to contact list (at given index)
8892
- var contactsToAdd = reject(map(contactsList, 'value'), function (contact) {
8893
- return some(contacts, {
8894
- id: contact.id
8691
+ var contactsToAdd = contactsList.filter(function (contact) {
8692
+ return !contacts.some(function (_ref2) {
8693
+ var id = _ref2.id;
8694
+ return contact.id === id;
8895
8695
  });
8896
8696
  });
8897
8697
  forEach(contactsToAdd, function (contact) {
@@ -8947,8 +8747,8 @@ function provider () {
8947
8747
  return rules;
8948
8748
  }
8949
8749
 
8950
- return getApiSchemas().then(function (_ref) {
8951
- var schemaModels = _ref.models;
8750
+ return getApiSchemas().then(function (_ref3) {
8751
+ var schemaModels = _ref3.models;
8952
8752
  models = schemaModels;
8953
8753
  return updateCreationRules(models['contact.Contact'].properties);
8954
8754
  });
@@ -9010,7 +8810,7 @@ var EDITION = {
9010
8810
  var PROTOTYPE_PATH = ['organisationName', 'vat', 'spareEmail', 'email', 'birthDay', 'phone', 'cellPhone', 'fax', 'id', 'firstName', 'lastName', 'address.country', 'address.line1', 'address.line2', 'address.line3', 'address.otherDetails', 'address.zip', 'address.city', 'address.province', 'gender', 'language', 'organisationType', 'legalForm', 'birthCity', 'birthZip', 'birthCountry', 'nationality', 'nationalIdentificationNumber', 'companyNationalIdentificationNumber', 'emailConfirmation'];
9011
8811
  var EMAIL_REGEX = "^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?.)+[a-zA-Z0-9]{2}(?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$";
9012
8812
 
9013
- cssInjectcab539baeec27d3d(".ovh-contact .ovh-contact-choice .ovh-contact-select {\n cursor: default;\n position: relative;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-match {\n height: auto;\n box-shadow: none;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container {\n position: absolute;\n left: -22px;\n right: -22px;\n border: 2px solid #e1e4df;\n border-radius: 4px;\n margin-top: -1px;\n padding: 6px 22px;\n background-color: #fff;\n z-index: 1000;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container .ui-select-dropdown {\n max-height: 200px;\n overflow-x: hidden;\n overflow-y: auto;\n border: 0;\n position: static;\n width: 100%;\n box-shadow: none;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container .ui-select-dropdown .ui-select-choices-group {\n display: block;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.direction-up .ui-select-match {\n border-top: 0;\n margin-top: -3px;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.direction-up .ui-select-dropdown-container {\n border-bottom: 0;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.open:not(.direction-up) .ui-select-match {\n border-bottom: 0;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.open:not(.direction-up) .ui-select-dropdown-container {\n border-top: 0;\n}\n.ovh-contact .ovh-contact-edit .iti {\n display: block;\n}\n.ovh-contact .ovh-contact-edit [data-ng-messages][role='alert'] {\n margin-top: 4px;\n}\n");
8813
+ cssInject9dfdbe6f8ee1b21b(".ovh-contact .ovh-contact-choice .ovh-contact-select {\n cursor: default;\n position: relative;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-match {\n height: auto;\n box-shadow: none;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container {\n position: absolute;\n left: -22px;\n right: -22px;\n border: 2px solid #e1e4df;\n border-radius: 4px;\n margin-top: -1px;\n padding: 6px 22px;\n background-color: #fff;\n z-index: 1000;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container .ui-select-dropdown {\n max-height: 200px;\n overflow-x: hidden;\n overflow-y: auto;\n border: 0;\n position: static;\n width: 100%;\n box-shadow: none;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container .ui-select-dropdown .ui-select-choices-group {\n display: block;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.direction-up .ui-select-match {\n border-top: 0;\n margin-top: -3px;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.direction-up .ui-select-dropdown-container {\n border-bottom: 0;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.open:not(.direction-up) .ui-select-match {\n border-bottom: 0;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.open:not(.direction-up) .ui-select-dropdown-container {\n border-top: 0;\n}\n.ovh-contact .ovh-contact-edit .iti {\n display: block;\n}\n.ovh-contact .ovh-contact-edit [data-ng-messages][role='alert'] {\n margin-top: 4px;\n}\n");
9014
8814
 
9015
8815
  function __variableDynamicImportRuntime1__(path) {
9016
8816
  switch (path) {
@@ -9050,7 +8850,7 @@ function __variableDynamicImportRuntime0__(path) {
9050
8850
  }
9051
8851
  }
9052
8852
  var moduleName = 'ngOvhContact';
9053
- angular__default['default'].module(moduleName, ['ngTranslateAsyncLoader', 'pascalprecht.translate', 'ovh-api-services', 'ui.select', 'ui.bootstrap']).constant('CONTACT_EDITION', EDITION).constant('CONTACT_PROTOTYPE_PATH', PROTOTYPE_PATH).constant('CONTACT_EMAIL_REGEX', EMAIL_REGEX).component('ovhContactChoice', choiceComponent).component('ovhContact', component).component('ovhContactEdit', editComponent).factory('OvhContact', _ngInjectExport).provider('ovhContact', provider).run(["$templateCache", function ($templateCache) {
8853
+ angular__default['default'].module(moduleName, ['ngTranslateAsyncLoader', 'pascalprecht.translate', 'ovh-api-services', 'ui.select', 'ui.bootstrap', 'ngOvhApiWrappers']).constant('CONTACT_EDITION', EDITION).constant('CONTACT_PROTOTYPE_PATH', PROTOTYPE_PATH).constant('CONTACT_EMAIL_REGEX', EMAIL_REGEX).component('ovhContactChoice', choiceComponent).component('ovhContact', component).component('ovhContactEdit', editComponent).factory('OvhContact', _ngInjectExport).provider('ovhContact', provider).run(["$templateCache", function ($templateCache) {
9054
8854
  $templateCache.put('ngOvhContacts/choice/templates/match.tpl.html', choiceMatchTemplate);
9055
8855
  $templateCache.put('ngOvhContacts/choice/templates/select.tpl.html', choiceSelectTemplate);
9056
8856
  }]).run(["$translate", "$q", "asyncLoader", function ($translate, $q, asyncLoader) {
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- function cssInjectcab539baeec27d3d(css) {
1
+ function cssInject9dfdbe6f8ee1b21b(css) {
2
2
  if (!css || typeof document === 'undefined') return '';
3
3
  const head = document.head || document.getElementsByTagName('head')[0];
4
4
  const style = document.createElement('style');
@@ -36,6 +36,7 @@ import 'angular-translate';
36
36
  import 'ovh-api-services';
37
37
  import 'ui-select';
38
38
  import 'angular-ui-bootstrap';
39
+ import '@ovh-ux/ng-ovh-api-wrappers';
39
40
  import moment from 'moment';
40
41
 
41
42
  function _typeof(obj) {
@@ -1992,7 +1993,7 @@ MapCache.prototype.set = mapCacheSet;
1992
1993
 
1993
1994
  /** Error message constants. */
1994
1995
 
1995
- var FUNC_ERROR_TEXT$1 = 'Expected a function';
1996
+ var FUNC_ERROR_TEXT = 'Expected a function';
1996
1997
  /**
1997
1998
  * Creates a function that memoizes the result of `func`. If `resolver` is
1998
1999
  * provided, it determines the cache key for storing the result based on the
@@ -2040,7 +2041,7 @@ var FUNC_ERROR_TEXT$1 = 'Expected a function';
2040
2041
 
2041
2042
  function memoize(func, resolver) {
2042
2043
  if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {
2043
- throw new TypeError(FUNC_ERROR_TEXT$1);
2044
+ throw new TypeError(FUNC_ERROR_TEXT);
2044
2045
  }
2045
2046
 
2046
2047
  var memoized = function memoized() {
@@ -4274,54 +4275,6 @@ function baseMap(collection, iteratee) {
4274
4275
  return result;
4275
4276
  }
4276
4277
 
4277
- /**
4278
- * Creates an array of values by running each element in `collection` thru
4279
- * `iteratee`. The iteratee is invoked with three arguments:
4280
- * (value, index|key, collection).
4281
- *
4282
- * Many lodash methods are guarded to work as iteratees for methods like
4283
- * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
4284
- *
4285
- * The guarded methods are:
4286
- * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
4287
- * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
4288
- * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
4289
- * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
4290
- *
4291
- * @static
4292
- * @memberOf _
4293
- * @since 0.1.0
4294
- * @category Collection
4295
- * @param {Array|Object} collection The collection to iterate over.
4296
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
4297
- * @returns {Array} Returns the new mapped array.
4298
- * @example
4299
- *
4300
- * function square(n) {
4301
- * return n * n;
4302
- * }
4303
- *
4304
- * _.map([4, 8], square);
4305
- * // => [16, 64]
4306
- *
4307
- * _.map({ 'a': 4, 'b': 8 }, square);
4308
- * // => [16, 64] (iteration order is not guaranteed)
4309
- *
4310
- * var users = [
4311
- * { 'user': 'barney' },
4312
- * { 'user': 'fred' }
4313
- * ];
4314
- *
4315
- * // The `_.property` iteratee shorthand.
4316
- * _.map(users, 'user');
4317
- * // => ['barney', 'fred']
4318
- */
4319
-
4320
- function map(collection, iteratee) {
4321
- var func = isArray(collection) ? arrayMap : baseMap;
4322
- return func(collection, baseIteratee(iteratee));
4323
- }
4324
-
4325
4278
  /** Used for built-in method references. */
4326
4279
  var objectProto = Object.prototype;
4327
4280
  /** Used to check objects for own properties. */
@@ -4393,55 +4346,6 @@ function isUndefined(value) {
4393
4346
  return value === undefined;
4394
4347
  }
4395
4348
 
4396
- /** Error message constants. */
4397
- var FUNC_ERROR_TEXT = 'Expected a function';
4398
- /**
4399
- * Creates a function that negates the result of the predicate `func`. The
4400
- * `func` predicate is invoked with the `this` binding and arguments of the
4401
- * created function.
4402
- *
4403
- * @static
4404
- * @memberOf _
4405
- * @since 3.0.0
4406
- * @category Function
4407
- * @param {Function} predicate The predicate to negate.
4408
- * @returns {Function} Returns the new negated function.
4409
- * @example
4410
- *
4411
- * function isEven(n) {
4412
- * return n % 2 == 0;
4413
- * }
4414
- *
4415
- * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
4416
- * // => [1, 3, 5]
4417
- */
4418
-
4419
- function negate(predicate) {
4420
- if (typeof predicate != 'function') {
4421
- throw new TypeError(FUNC_ERROR_TEXT);
4422
- }
4423
-
4424
- return function () {
4425
- var args = arguments;
4426
-
4427
- switch (args.length) {
4428
- case 0:
4429
- return !predicate.call(this);
4430
-
4431
- case 1:
4432
- return !predicate.call(this, args[0]);
4433
-
4434
- case 2:
4435
- return !predicate.call(this, args[0], args[1]);
4436
-
4437
- case 3:
4438
- return !predicate.call(this, args[0], args[1], args[2]);
4439
- }
4440
-
4441
- return !predicate.apply(this, args);
4442
- };
4443
- }
4444
-
4445
4349
  /**
4446
4350
  * The base implementation of `_.set`.
4447
4351
  *
@@ -4610,46 +4514,6 @@ function baseOrderBy(collection, iteratees, orders) {
4610
4514
  });
4611
4515
  }
4612
4516
 
4613
- /**
4614
- * The opposite of `_.filter`; this method returns the elements of `collection`
4615
- * that `predicate` does **not** return truthy for.
4616
- *
4617
- * @static
4618
- * @memberOf _
4619
- * @since 0.1.0
4620
- * @category Collection
4621
- * @param {Array|Object} collection The collection to iterate over.
4622
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
4623
- * @returns {Array} Returns the new filtered array.
4624
- * @see _.filter
4625
- * @example
4626
- *
4627
- * var users = [
4628
- * { 'user': 'barney', 'age': 36, 'active': false },
4629
- * { 'user': 'fred', 'age': 40, 'active': true }
4630
- * ];
4631
- *
4632
- * _.reject(users, function(o) { return !o.active; });
4633
- * // => objects for ['fred']
4634
- *
4635
- * // The `_.matches` iteratee shorthand.
4636
- * _.reject(users, { 'age': 40, 'active': true });
4637
- * // => objects for ['barney']
4638
- *
4639
- * // The `_.matchesProperty` iteratee shorthand.
4640
- * _.reject(users, ['active', false]);
4641
- * // => objects for ['fred']
4642
- *
4643
- * // The `_.property` iteratee shorthand.
4644
- * _.reject(users, 'active');
4645
- * // => objects for ['barney']
4646
- */
4647
-
4648
- function reject(collection, predicate) {
4649
- var func = isArray(collection) ? arrayFilter : baseFilter;
4650
- return func(collection, negate(baseIteratee(predicate)));
4651
- }
4652
-
4653
4517
  /**
4654
4518
  * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
4655
4519
  * it's created. Arrays are created for missing index properties while objects
@@ -4709,72 +4573,6 @@ var snakeCase = createCompounder(function (result, word, index) {
4709
4573
  return result + (index ? '_' : '') + word.toLowerCase();
4710
4574
  });
4711
4575
 
4712
- /**
4713
- * The base implementation of `_.some` without support for iteratee shorthands.
4714
- *
4715
- * @private
4716
- * @param {Array|Object} collection The collection to iterate over.
4717
- * @param {Function} predicate The function invoked per iteration.
4718
- * @returns {boolean} Returns `true` if any element passes the predicate check,
4719
- * else `false`.
4720
- */
4721
-
4722
- function baseSome(collection, predicate) {
4723
- var result;
4724
- baseEach(collection, function (value, index, collection) {
4725
- result = predicate(value, index, collection);
4726
- return !result;
4727
- });
4728
- return !!result;
4729
- }
4730
-
4731
- /**
4732
- * Checks if `predicate` returns truthy for **any** element of `collection`.
4733
- * Iteration is stopped once `predicate` returns truthy. The predicate is
4734
- * invoked with three arguments: (value, index|key, collection).
4735
- *
4736
- * @static
4737
- * @memberOf _
4738
- * @since 0.1.0
4739
- * @category Collection
4740
- * @param {Array|Object} collection The collection to iterate over.
4741
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
4742
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
4743
- * @returns {boolean} Returns `true` if any element passes the predicate check,
4744
- * else `false`.
4745
- * @example
4746
- *
4747
- * _.some([null, 0, 'yes', false], Boolean);
4748
- * // => true
4749
- *
4750
- * var users = [
4751
- * { 'user': 'barney', 'active': true },
4752
- * { 'user': 'fred', 'active': false }
4753
- * ];
4754
- *
4755
- * // The `_.matches` iteratee shorthand.
4756
- * _.some(users, { 'user': 'barney', 'active': false });
4757
- * // => false
4758
- *
4759
- * // The `_.matchesProperty` iteratee shorthand.
4760
- * _.some(users, ['active', false]);
4761
- * // => true
4762
- *
4763
- * // The `_.property` iteratee shorthand.
4764
- * _.some(users, 'active');
4765
- * // => true
4766
- */
4767
-
4768
- function some(collection, predicate, guard) {
4769
- var func = isArray(collection) ? arraySome : baseSome;
4770
-
4771
- if (guard && isIterateeCall(collection, predicate, guard)) {
4772
- predicate = undefined;
4773
- }
4774
-
4775
- return func(collection, baseIteratee(predicate));
4776
- }
4777
-
4778
4576
  /**
4779
4577
  * Creates an array of elements, sorted in ascending order by the results of
4780
4578
  * running each element in a collection thru each iteratee. This method
@@ -8743,7 +8541,7 @@ function _ngInjectExport(OvhApiMe, CONTACT_PROTOTYPE_PATH) {
8743
8541
 
8744
8542
  function provider () {
8745
8543
  var self = this;
8746
- self.$get = ["$q", "$translate", "OvhContact", "OvhApiMe", "CONTACT_EMAIL_REGEX", function $get($q, $translate, OvhContact, OvhApiMe, CONTACT_EMAIL_REGEX) {
8544
+ self.$get = ["$q", "$translate", "OvhContact", "OvhApiMe", "CONTACT_EMAIL_REGEX", "iceberg", function $get($q, $translate, OvhContact, OvhApiMe, CONTACT_EMAIL_REGEX, iceberg) {
8747
8545
  /**
8748
8546
  * @ngdoc service
8749
8547
  * @name ovhContact.service:ovhContact
@@ -8861,7 +8659,7 @@ function provider () {
8861
8659
  * @methodOf ovhContact.service:ovhContact
8862
8660
  *
8863
8661
  * @description
8864
- * Get the entire list of contacts. This use api v7 to get all contacts details.
8662
+ * Get the entire list of contacts. This use api iceberg to get all contacts details.
8865
8663
  *
8866
8664
  * @param {Boolean} refresh Flag telling to fully recreate the contact list.
8867
8665
  *
@@ -8876,13 +8674,15 @@ function provider () {
8876
8674
  contacts = [];
8877
8675
  }
8878
8676
 
8879
- return OvhApiMe.Contact().v7().query().$promise.then(function (contactsList) {
8677
+ return iceberg('/me/contact').query().expand('CachedObjectList-Pages').execute().$promise.then(function (_ref) {
8678
+ var contactsList = _ref.data;
8880
8679
  // filter contact that are not already added
8881
8680
  // this avoid loosing contact object reference
8882
8681
  // then add contact to contact list (at given index)
8883
- var contactsToAdd = reject(map(contactsList, 'value'), function (contact) {
8884
- return some(contacts, {
8885
- id: contact.id
8682
+ var contactsToAdd = contactsList.filter(function (contact) {
8683
+ return !contacts.some(function (_ref2) {
8684
+ var id = _ref2.id;
8685
+ return contact.id === id;
8886
8686
  });
8887
8687
  });
8888
8688
  forEach(contactsToAdd, function (contact) {
@@ -8938,8 +8738,8 @@ function provider () {
8938
8738
  return rules;
8939
8739
  }
8940
8740
 
8941
- return getApiSchemas().then(function (_ref) {
8942
- var schemaModels = _ref.models;
8741
+ return getApiSchemas().then(function (_ref3) {
8742
+ var schemaModels = _ref3.models;
8943
8743
  models = schemaModels;
8944
8744
  return updateCreationRules(models['contact.Contact'].properties);
8945
8745
  });
@@ -9001,7 +8801,7 @@ var EDITION = {
9001
8801
  var PROTOTYPE_PATH = ['organisationName', 'vat', 'spareEmail', 'email', 'birthDay', 'phone', 'cellPhone', 'fax', 'id', 'firstName', 'lastName', 'address.country', 'address.line1', 'address.line2', 'address.line3', 'address.otherDetails', 'address.zip', 'address.city', 'address.province', 'gender', 'language', 'organisationType', 'legalForm', 'birthCity', 'birthZip', 'birthCountry', 'nationality', 'nationalIdentificationNumber', 'companyNationalIdentificationNumber', 'emailConfirmation'];
9002
8802
  var EMAIL_REGEX = "^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?.)+[a-zA-Z0-9]{2}(?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$";
9003
8803
 
9004
- cssInjectcab539baeec27d3d(".ovh-contact .ovh-contact-choice .ovh-contact-select {\n cursor: default;\n position: relative;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-match {\n height: auto;\n box-shadow: none;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container {\n position: absolute;\n left: -22px;\n right: -22px;\n border: 2px solid #e1e4df;\n border-radius: 4px;\n margin-top: -1px;\n padding: 6px 22px;\n background-color: #fff;\n z-index: 1000;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container .ui-select-dropdown {\n max-height: 200px;\n overflow-x: hidden;\n overflow-y: auto;\n border: 0;\n position: static;\n width: 100%;\n box-shadow: none;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container .ui-select-dropdown .ui-select-choices-group {\n display: block;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.direction-up .ui-select-match {\n border-top: 0;\n margin-top: -3px;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.direction-up .ui-select-dropdown-container {\n border-bottom: 0;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.open:not(.direction-up) .ui-select-match {\n border-bottom: 0;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.open:not(.direction-up) .ui-select-dropdown-container {\n border-top: 0;\n}\n.ovh-contact .ovh-contact-edit .iti {\n display: block;\n}\n.ovh-contact .ovh-contact-edit [data-ng-messages][role='alert'] {\n margin-top: 4px;\n}\n");
8804
+ cssInject9dfdbe6f8ee1b21b(".ovh-contact .ovh-contact-choice .ovh-contact-select {\n cursor: default;\n position: relative;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-match {\n height: auto;\n box-shadow: none;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container {\n position: absolute;\n left: -22px;\n right: -22px;\n border: 2px solid #e1e4df;\n border-radius: 4px;\n margin-top: -1px;\n padding: 6px 22px;\n background-color: #fff;\n z-index: 1000;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container .ui-select-dropdown {\n max-height: 200px;\n overflow-x: hidden;\n overflow-y: auto;\n border: 0;\n position: static;\n width: 100%;\n box-shadow: none;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container .ui-select-dropdown .ui-select-choices-group {\n display: block;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.direction-up .ui-select-match {\n border-top: 0;\n margin-top: -3px;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.direction-up .ui-select-dropdown-container {\n border-bottom: 0;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.open:not(.direction-up) .ui-select-match {\n border-bottom: 0;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.open:not(.direction-up) .ui-select-dropdown-container {\n border-top: 0;\n}\n.ovh-contact .ovh-contact-edit .iti {\n display: block;\n}\n.ovh-contact .ovh-contact-edit [data-ng-messages][role='alert'] {\n margin-top: 4px;\n}\n");
9005
8805
 
9006
8806
  function __variableDynamicImportRuntime1__(path) {
9007
8807
  switch (path) {
@@ -9041,7 +8841,7 @@ function __variableDynamicImportRuntime0__(path) {
9041
8841
  }
9042
8842
  }
9043
8843
  var moduleName = 'ngOvhContact';
9044
- angular.module(moduleName, ['ngTranslateAsyncLoader', 'pascalprecht.translate', 'ovh-api-services', 'ui.select', 'ui.bootstrap']).constant('CONTACT_EDITION', EDITION).constant('CONTACT_PROTOTYPE_PATH', PROTOTYPE_PATH).constant('CONTACT_EMAIL_REGEX', EMAIL_REGEX).component('ovhContactChoice', choiceComponent).component('ovhContact', component).component('ovhContactEdit', editComponent).factory('OvhContact', _ngInjectExport).provider('ovhContact', provider).run(["$templateCache", function ($templateCache) {
8844
+ angular.module(moduleName, ['ngTranslateAsyncLoader', 'pascalprecht.translate', 'ovh-api-services', 'ui.select', 'ui.bootstrap', 'ngOvhApiWrappers']).constant('CONTACT_EDITION', EDITION).constant('CONTACT_PROTOTYPE_PATH', PROTOTYPE_PATH).constant('CONTACT_EMAIL_REGEX', EMAIL_REGEX).component('ovhContactChoice', choiceComponent).component('ovhContact', component).component('ovhContactEdit', editComponent).factory('OvhContact', _ngInjectExport).provider('ovhContact', provider).run(["$templateCache", function ($templateCache) {
9045
8845
  $templateCache.put('ngOvhContacts/choice/templates/match.tpl.html', choiceMatchTemplate);
9046
8846
  $templateCache.put('ngOvhContacts/choice/templates/select.tpl.html', choiceSelectTemplate);
9047
8847
  }]).run(["$translate", "$q", "asyncLoader", function ($translate, $q, asyncLoader) {
@@ -1,4 +1,4 @@
1
- function cssInjectcab539baeec27d3d(css) {
1
+ function cssInject9dfdbe6f8ee1b21b(css) {
2
2
  if (!css || typeof document === 'undefined') return '';
3
3
  const head = document.head || document.getElementsByTagName('head')[0];
4
4
  const style = document.createElement('style');
@@ -15,10 +15,10 @@ function cssInjectcab539baeec27d3d(css) {
15
15
  return css;
16
16
  }
17
17
  (function (global, factory) {
18
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('angular'), require('@ovh-ux/ng-translate-async-loader'), require('angular-translate'), require('ovh-api-services'), require('ui-select'), require('angular-ui-bootstrap'), require('moment')) :
19
- typeof define === 'function' && define.amd ? define(['angular', '@ovh-ux/ng-translate-async-loader', 'angular-translate', 'ovh-api-services', 'ui-select', 'angular-ui-bootstrap', 'moment'], factory) :
20
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global['ng-ovh-contact'] = factory(global.angular, null, null, null, null, null, global.moment));
21
- }(this, (function (angular, ngTranslateAsyncLoader, angularTranslate, ovhApiServices, uiSelect, angularUiBootstrap, moment) { 'use strict';
18
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('angular'), require('@ovh-ux/ng-translate-async-loader'), require('angular-translate'), require('ovh-api-services'), require('ui-select'), require('angular-ui-bootstrap'), require('@ovh-ux/ng-ovh-api-wrappers'), require('moment')) :
19
+ typeof define === 'function' && define.amd ? define(['angular', '@ovh-ux/ng-translate-async-loader', 'angular-translate', 'ovh-api-services', 'ui-select', 'angular-ui-bootstrap', '@ovh-ux/ng-ovh-api-wrappers', 'moment'], factory) :
20
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global['ng-ovh-contact'] = factory(global.angular, null, null, null, null, null, null, global.moment));
21
+ }(this, (function (angular, ngTranslateAsyncLoader, angularTranslate, ovhApiServices, uiSelect, angularUiBootstrap, ngOvhApiWrappers, moment) { 'use strict';
22
22
 
23
23
  function ___$insertStyle(css) {
24
24
  if (!css) {
@@ -1995,7 +1995,7 @@ function cssInjectcab539baeec27d3d(css) {
1995
1995
 
1996
1996
  /** Error message constants. */
1997
1997
 
1998
- var FUNC_ERROR_TEXT$1 = 'Expected a function';
1998
+ var FUNC_ERROR_TEXT = 'Expected a function';
1999
1999
  /**
2000
2000
  * Creates a function that memoizes the result of `func`. If `resolver` is
2001
2001
  * provided, it determines the cache key for storing the result based on the
@@ -2043,7 +2043,7 @@ function cssInjectcab539baeec27d3d(css) {
2043
2043
 
2044
2044
  function memoize(func, resolver) {
2045
2045
  if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {
2046
- throw new TypeError(FUNC_ERROR_TEXT$1);
2046
+ throw new TypeError(FUNC_ERROR_TEXT);
2047
2047
  }
2048
2048
 
2049
2049
  var memoized = function memoized() {
@@ -4277,54 +4277,6 @@ function cssInjectcab539baeec27d3d(css) {
4277
4277
  return result;
4278
4278
  }
4279
4279
 
4280
- /**
4281
- * Creates an array of values by running each element in `collection` thru
4282
- * `iteratee`. The iteratee is invoked with three arguments:
4283
- * (value, index|key, collection).
4284
- *
4285
- * Many lodash methods are guarded to work as iteratees for methods like
4286
- * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
4287
- *
4288
- * The guarded methods are:
4289
- * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
4290
- * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
4291
- * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
4292
- * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
4293
- *
4294
- * @static
4295
- * @memberOf _
4296
- * @since 0.1.0
4297
- * @category Collection
4298
- * @param {Array|Object} collection The collection to iterate over.
4299
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
4300
- * @returns {Array} Returns the new mapped array.
4301
- * @example
4302
- *
4303
- * function square(n) {
4304
- * return n * n;
4305
- * }
4306
- *
4307
- * _.map([4, 8], square);
4308
- * // => [16, 64]
4309
- *
4310
- * _.map({ 'a': 4, 'b': 8 }, square);
4311
- * // => [16, 64] (iteration order is not guaranteed)
4312
- *
4313
- * var users = [
4314
- * { 'user': 'barney' },
4315
- * { 'user': 'fred' }
4316
- * ];
4317
- *
4318
- * // The `_.property` iteratee shorthand.
4319
- * _.map(users, 'user');
4320
- * // => ['barney', 'fred']
4321
- */
4322
-
4323
- function map(collection, iteratee) {
4324
- var func = isArray(collection) ? arrayMap : baseMap;
4325
- return func(collection, baseIteratee(iteratee));
4326
- }
4327
-
4328
4280
  /** Used for built-in method references. */
4329
4281
  var objectProto = Object.prototype;
4330
4282
  /** Used to check objects for own properties. */
@@ -4396,55 +4348,6 @@ function cssInjectcab539baeec27d3d(css) {
4396
4348
  return value === undefined;
4397
4349
  }
4398
4350
 
4399
- /** Error message constants. */
4400
- var FUNC_ERROR_TEXT = 'Expected a function';
4401
- /**
4402
- * Creates a function that negates the result of the predicate `func`. The
4403
- * `func` predicate is invoked with the `this` binding and arguments of the
4404
- * created function.
4405
- *
4406
- * @static
4407
- * @memberOf _
4408
- * @since 3.0.0
4409
- * @category Function
4410
- * @param {Function} predicate The predicate to negate.
4411
- * @returns {Function} Returns the new negated function.
4412
- * @example
4413
- *
4414
- * function isEven(n) {
4415
- * return n % 2 == 0;
4416
- * }
4417
- *
4418
- * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
4419
- * // => [1, 3, 5]
4420
- */
4421
-
4422
- function negate(predicate) {
4423
- if (typeof predicate != 'function') {
4424
- throw new TypeError(FUNC_ERROR_TEXT);
4425
- }
4426
-
4427
- return function () {
4428
- var args = arguments;
4429
-
4430
- switch (args.length) {
4431
- case 0:
4432
- return !predicate.call(this);
4433
-
4434
- case 1:
4435
- return !predicate.call(this, args[0]);
4436
-
4437
- case 2:
4438
- return !predicate.call(this, args[0], args[1]);
4439
-
4440
- case 3:
4441
- return !predicate.call(this, args[0], args[1], args[2]);
4442
- }
4443
-
4444
- return !predicate.apply(this, args);
4445
- };
4446
- }
4447
-
4448
4351
  /**
4449
4352
  * The base implementation of `_.set`.
4450
4353
  *
@@ -4613,46 +4516,6 @@ function cssInjectcab539baeec27d3d(css) {
4613
4516
  });
4614
4517
  }
4615
4518
 
4616
- /**
4617
- * The opposite of `_.filter`; this method returns the elements of `collection`
4618
- * that `predicate` does **not** return truthy for.
4619
- *
4620
- * @static
4621
- * @memberOf _
4622
- * @since 0.1.0
4623
- * @category Collection
4624
- * @param {Array|Object} collection The collection to iterate over.
4625
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
4626
- * @returns {Array} Returns the new filtered array.
4627
- * @see _.filter
4628
- * @example
4629
- *
4630
- * var users = [
4631
- * { 'user': 'barney', 'age': 36, 'active': false },
4632
- * { 'user': 'fred', 'age': 40, 'active': true }
4633
- * ];
4634
- *
4635
- * _.reject(users, function(o) { return !o.active; });
4636
- * // => objects for ['fred']
4637
- *
4638
- * // The `_.matches` iteratee shorthand.
4639
- * _.reject(users, { 'age': 40, 'active': true });
4640
- * // => objects for ['barney']
4641
- *
4642
- * // The `_.matchesProperty` iteratee shorthand.
4643
- * _.reject(users, ['active', false]);
4644
- * // => objects for ['fred']
4645
- *
4646
- * // The `_.property` iteratee shorthand.
4647
- * _.reject(users, 'active');
4648
- * // => objects for ['barney']
4649
- */
4650
-
4651
- function reject(collection, predicate) {
4652
- var func = isArray(collection) ? arrayFilter : baseFilter;
4653
- return func(collection, negate(baseIteratee(predicate)));
4654
- }
4655
-
4656
4519
  /**
4657
4520
  * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
4658
4521
  * it's created. Arrays are created for missing index properties while objects
@@ -4712,72 +4575,6 @@ function cssInjectcab539baeec27d3d(css) {
4712
4575
  return result + (index ? '_' : '') + word.toLowerCase();
4713
4576
  });
4714
4577
 
4715
- /**
4716
- * The base implementation of `_.some` without support for iteratee shorthands.
4717
- *
4718
- * @private
4719
- * @param {Array|Object} collection The collection to iterate over.
4720
- * @param {Function} predicate The function invoked per iteration.
4721
- * @returns {boolean} Returns `true` if any element passes the predicate check,
4722
- * else `false`.
4723
- */
4724
-
4725
- function baseSome(collection, predicate) {
4726
- var result;
4727
- baseEach(collection, function (value, index, collection) {
4728
- result = predicate(value, index, collection);
4729
- return !result;
4730
- });
4731
- return !!result;
4732
- }
4733
-
4734
- /**
4735
- * Checks if `predicate` returns truthy for **any** element of `collection`.
4736
- * Iteration is stopped once `predicate` returns truthy. The predicate is
4737
- * invoked with three arguments: (value, index|key, collection).
4738
- *
4739
- * @static
4740
- * @memberOf _
4741
- * @since 0.1.0
4742
- * @category Collection
4743
- * @param {Array|Object} collection The collection to iterate over.
4744
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
4745
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
4746
- * @returns {boolean} Returns `true` if any element passes the predicate check,
4747
- * else `false`.
4748
- * @example
4749
- *
4750
- * _.some([null, 0, 'yes', false], Boolean);
4751
- * // => true
4752
- *
4753
- * var users = [
4754
- * { 'user': 'barney', 'active': true },
4755
- * { 'user': 'fred', 'active': false }
4756
- * ];
4757
- *
4758
- * // The `_.matches` iteratee shorthand.
4759
- * _.some(users, { 'user': 'barney', 'active': false });
4760
- * // => false
4761
- *
4762
- * // The `_.matchesProperty` iteratee shorthand.
4763
- * _.some(users, ['active', false]);
4764
- * // => true
4765
- *
4766
- * // The `_.property` iteratee shorthand.
4767
- * _.some(users, 'active');
4768
- * // => true
4769
- */
4770
-
4771
- function some(collection, predicate, guard) {
4772
- var func = isArray(collection) ? arraySome : baseSome;
4773
-
4774
- if (guard && isIterateeCall(collection, predicate, guard)) {
4775
- predicate = undefined;
4776
- }
4777
-
4778
- return func(collection, baseIteratee(predicate));
4779
- }
4780
-
4781
4578
  /**
4782
4579
  * Creates an array of elements, sorted in ascending order by the results of
4783
4580
  * running each element in a collection thru each iteratee. This method
@@ -8746,7 +8543,7 @@ function cssInjectcab539baeec27d3d(css) {
8746
8543
 
8747
8544
  function provider () {
8748
8545
  var self = this;
8749
- self.$get = ["$q", "$translate", "OvhContact", "OvhApiMe", "CONTACT_EMAIL_REGEX", function $get($q, $translate, OvhContact, OvhApiMe, CONTACT_EMAIL_REGEX) {
8546
+ self.$get = ["$q", "$translate", "OvhContact", "OvhApiMe", "CONTACT_EMAIL_REGEX", "iceberg", function $get($q, $translate, OvhContact, OvhApiMe, CONTACT_EMAIL_REGEX, iceberg) {
8750
8547
  /**
8751
8548
  * @ngdoc service
8752
8549
  * @name ovhContact.service:ovhContact
@@ -8864,7 +8661,7 @@ function cssInjectcab539baeec27d3d(css) {
8864
8661
  * @methodOf ovhContact.service:ovhContact
8865
8662
  *
8866
8663
  * @description
8867
- * Get the entire list of contacts. This use api v7 to get all contacts details.
8664
+ * Get the entire list of contacts. This use api iceberg to get all contacts details.
8868
8665
  *
8869
8666
  * @param {Boolean} refresh Flag telling to fully recreate the contact list.
8870
8667
  *
@@ -8879,13 +8676,15 @@ function cssInjectcab539baeec27d3d(css) {
8879
8676
  contacts = [];
8880
8677
  }
8881
8678
 
8882
- return OvhApiMe.Contact().v7().query().$promise.then(function (contactsList) {
8679
+ return iceberg('/me/contact').query().expand('CachedObjectList-Pages').execute().$promise.then(function (_ref) {
8680
+ var contactsList = _ref.data;
8883
8681
  // filter contact that are not already added
8884
8682
  // this avoid loosing contact object reference
8885
8683
  // then add contact to contact list (at given index)
8886
- var contactsToAdd = reject(map(contactsList, 'value'), function (contact) {
8887
- return some(contacts, {
8888
- id: contact.id
8684
+ var contactsToAdd = contactsList.filter(function (contact) {
8685
+ return !contacts.some(function (_ref2) {
8686
+ var id = _ref2.id;
8687
+ return contact.id === id;
8889
8688
  });
8890
8689
  });
8891
8690
  forEach(contactsToAdd, function (contact) {
@@ -8941,8 +8740,8 @@ function cssInjectcab539baeec27d3d(css) {
8941
8740
  return rules;
8942
8741
  }
8943
8742
 
8944
- return getApiSchemas().then(function (_ref) {
8945
- var schemaModels = _ref.models;
8743
+ return getApiSchemas().then(function (_ref3) {
8744
+ var schemaModels = _ref3.models;
8946
8745
  models = schemaModels;
8947
8746
  return updateCreationRules(models['contact.Contact'].properties);
8948
8747
  });
@@ -9004,7 +8803,7 @@ function cssInjectcab539baeec27d3d(css) {
9004
8803
  var PROTOTYPE_PATH = ['organisationName', 'vat', 'spareEmail', 'email', 'birthDay', 'phone', 'cellPhone', 'fax', 'id', 'firstName', 'lastName', 'address.country', 'address.line1', 'address.line2', 'address.line3', 'address.otherDetails', 'address.zip', 'address.city', 'address.province', 'gender', 'language', 'organisationType', 'legalForm', 'birthCity', 'birthZip', 'birthCountry', 'nationality', 'nationalIdentificationNumber', 'companyNationalIdentificationNumber', 'emailConfirmation'];
9005
8804
  var EMAIL_REGEX = "^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?.)+[a-zA-Z0-9]{2}(?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$";
9006
8805
 
9007
- cssInjectcab539baeec27d3d(".ovh-contact .ovh-contact-choice .ovh-contact-select {\n cursor: default;\n position: relative;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-match {\n height: auto;\n box-shadow: none;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container {\n position: absolute;\n left: -22px;\n right: -22px;\n border: 2px solid #e1e4df;\n border-radius: 4px;\n margin-top: -1px;\n padding: 6px 22px;\n background-color: #fff;\n z-index: 1000;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container .ui-select-dropdown {\n max-height: 200px;\n overflow-x: hidden;\n overflow-y: auto;\n border: 0;\n position: static;\n width: 100%;\n box-shadow: none;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container .ui-select-dropdown .ui-select-choices-group {\n display: block;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.direction-up .ui-select-match {\n border-top: 0;\n margin-top: -3px;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.direction-up .ui-select-dropdown-container {\n border-bottom: 0;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.open:not(.direction-up) .ui-select-match {\n border-bottom: 0;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.open:not(.direction-up) .ui-select-dropdown-container {\n border-top: 0;\n}\n.ovh-contact .ovh-contact-edit .iti {\n display: block;\n}\n.ovh-contact .ovh-contact-edit [data-ng-messages][role='alert'] {\n margin-top: 4px;\n}\n");
8806
+ cssInject9dfdbe6f8ee1b21b(".ovh-contact .ovh-contact-choice .ovh-contact-select {\n cursor: default;\n position: relative;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-match {\n height: auto;\n box-shadow: none;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container {\n position: absolute;\n left: -22px;\n right: -22px;\n border: 2px solid #e1e4df;\n border-radius: 4px;\n margin-top: -1px;\n padding: 6px 22px;\n background-color: #fff;\n z-index: 1000;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container .ui-select-dropdown {\n max-height: 200px;\n overflow-x: hidden;\n overflow-y: auto;\n border: 0;\n position: static;\n width: 100%;\n box-shadow: none;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select .ui-select-dropdown-container .ui-select-dropdown .ui-select-choices-group {\n display: block;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.direction-up .ui-select-match {\n border-top: 0;\n margin-top: -3px;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.direction-up .ui-select-dropdown-container {\n border-bottom: 0;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.open:not(.direction-up) .ui-select-match {\n border-bottom: 0;\n}\n.ovh-contact .ovh-contact-choice .ovh-contact-select.open:not(.direction-up) .ui-select-dropdown-container {\n border-top: 0;\n}\n.ovh-contact .ovh-contact-edit .iti {\n display: block;\n}\n.ovh-contact .ovh-contact-edit [data-ng-messages][role='alert'] {\n margin-top: 4px;\n}\n");
9008
8807
 
9009
8808
  function __variableDynamicImportRuntime1__(path) {
9010
8809
  switch (path) {
@@ -9044,7 +8843,7 @@ function cssInjectcab539baeec27d3d(css) {
9044
8843
  }
9045
8844
  }
9046
8845
  var moduleName = 'ngOvhContact';
9047
- angular__default['default'].module(moduleName, ['ngTranslateAsyncLoader', 'pascalprecht.translate', 'ovh-api-services', 'ui.select', 'ui.bootstrap']).constant('CONTACT_EDITION', EDITION).constant('CONTACT_PROTOTYPE_PATH', PROTOTYPE_PATH).constant('CONTACT_EMAIL_REGEX', EMAIL_REGEX).component('ovhContactChoice', choiceComponent).component('ovhContact', component).component('ovhContactEdit', editComponent).factory('OvhContact', _ngInjectExport).provider('ovhContact', provider).run(["$templateCache", function ($templateCache) {
8846
+ angular__default['default'].module(moduleName, ['ngTranslateAsyncLoader', 'pascalprecht.translate', 'ovh-api-services', 'ui.select', 'ui.bootstrap', 'ngOvhApiWrappers']).constant('CONTACT_EDITION', EDITION).constant('CONTACT_PROTOTYPE_PATH', PROTOTYPE_PATH).constant('CONTACT_EMAIL_REGEX', EMAIL_REGEX).component('ovhContactChoice', choiceComponent).component('ovhContact', component).component('ovhContactEdit', editComponent).factory('OvhContact', _ngInjectExport).provider('ovhContact', provider).run(["$templateCache", function ($templateCache) {
9048
8847
  $templateCache.put('ngOvhContacts/choice/templates/match.tpl.html', choiceMatchTemplate);
9049
8848
  $templateCache.put('ngOvhContacts/choice/templates/select.tpl.html', choiceSelectTemplate);
9050
8849
  }]).run(["$translate", "$q", "asyncLoader", function ($translate, $q, asyncLoader) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovh-ux/ng-ovh-contact",
3
- "version": "5.1.2",
3
+ "version": "5.1.3",
4
4
  "description": "Helps you dealing with OVHcloud contacts from /me/contact API.",
5
5
  "keywords": [
6
6
  "angularjs",
@@ -42,12 +42,13 @@
42
42
  "@ovh-ux/component-rollup-config": "^11.0.0 || ^12.0.0"
43
43
  },
44
44
  "peerDependencies": {
45
+ "@ovh-ux/ng-ovh-api-wrappers": "^5.0.0",
45
46
  "@ovh-ux/ng-translate-async-loader": "^2.1.4",
46
47
  "angular": "^1.7.8",
47
48
  "angular-translate": "^2.18.1",
48
49
  "angular-ui-bootstrap": "~1.3.3",
49
50
  "moment": "^2.24.0",
50
- "ovh-api-services": "^14.0.6",
51
+ "ovh-api-services": "^15.0.0",
51
52
  "ovh-manager-webfont": "^1.2.0",
52
53
  "ui-select": "^0.19.8"
53
54
  }