@absmartly/cli 1.1.0 → 1.2.0

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.
Files changed (116) hide show
  1. package/dist/api-client/api-client.d.ts +132 -14
  2. package/dist/api-client/api-client.d.ts.map +1 -1
  3. package/dist/api-client/api-client.js +255 -66
  4. package/dist/api-client/api-client.js.map +1 -1
  5. package/dist/commands/apikeys/index.js +9 -1
  6. package/dist/commands/apikeys/index.js.map +1 -1
  7. package/dist/commands/apps/index.js +9 -1
  8. package/dist/commands/apps/index.js.map +1 -1
  9. package/dist/commands/auth/index.js +30 -0
  10. package/dist/commands/auth/index.js.map +1 -1
  11. package/dist/commands/customfields/index.js +9 -1
  12. package/dist/commands/customfields/index.js.map +1 -1
  13. package/dist/commands/envs/index.js +9 -1
  14. package/dist/commands/envs/index.js.map +1 -1
  15. package/dist/commands/experiments/activity.js +1 -1
  16. package/dist/commands/experiments/activity.js.map +1 -1
  17. package/dist/commands/experiments/list.js +1 -1
  18. package/dist/commands/experiments/list.js.map +1 -1
  19. package/dist/commands/goals/index.js +9 -1
  20. package/dist/commands/goals/index.js.map +1 -1
  21. package/dist/commands/goaltags/index.js +9 -1
  22. package/dist/commands/goaltags/index.js.map +1 -1
  23. package/dist/commands/metriccategories/index.js +9 -1
  24. package/dist/commands/metriccategories/index.js.map +1 -1
  25. package/dist/commands/metrics/index.d.ts.map +1 -1
  26. package/dist/commands/metrics/index.js +179 -29
  27. package/dist/commands/metrics/index.js.map +1 -1
  28. package/dist/commands/metrictags/index.js +9 -1
  29. package/dist/commands/metrictags/index.js.map +1 -1
  30. package/dist/commands/roles/index.js +9 -1
  31. package/dist/commands/roles/index.js.map +1 -1
  32. package/dist/commands/segments/index.js +9 -1
  33. package/dist/commands/segments/index.js.map +1 -1
  34. package/dist/commands/tags/index.js +9 -1
  35. package/dist/commands/tags/index.js.map +1 -1
  36. package/dist/commands/teams/index.js +10 -1
  37. package/dist/commands/teams/index.js.map +1 -1
  38. package/dist/commands/units/index.js +9 -1
  39. package/dist/commands/units/index.js.map +1 -1
  40. package/dist/commands/webhooks/index.js +9 -1
  41. package/dist/commands/webhooks/index.js.map +1 -1
  42. package/dist/core/activity/activity.js +1 -1
  43. package/dist/core/activity/activity.js.map +1 -1
  44. package/dist/core/apikeys/apikeys.js +1 -1
  45. package/dist/core/apikeys/apikeys.js.map +1 -1
  46. package/dist/core/apps/apps.js +1 -1
  47. package/dist/core/apps/apps.js.map +1 -1
  48. package/dist/core/customfields/list.js +1 -1
  49. package/dist/core/customfields/list.js.map +1 -1
  50. package/dist/core/envs/envs.js +1 -1
  51. package/dist/core/envs/envs.js.map +1 -1
  52. package/dist/core/experiments/custom-fields.js +1 -1
  53. package/dist/core/experiments/custom-fields.js.map +1 -1
  54. package/dist/core/experiments/metrics.js +1 -1
  55. package/dist/core/experiments/metrics.js.map +1 -1
  56. package/dist/core/goals/list.js +1 -1
  57. package/dist/core/goals/list.js.map +1 -1
  58. package/dist/core/goaltags/goaltags.js +1 -1
  59. package/dist/core/goaltags/goaltags.js.map +1 -1
  60. package/dist/core/metriccategories/metriccategories.js +1 -1
  61. package/dist/core/metriccategories/metriccategories.js.map +1 -1
  62. package/dist/core/metrics/create.d.ts +2 -12
  63. package/dist/core/metrics/create.d.ts.map +1 -1
  64. package/dist/core/metrics/create.js +3 -19
  65. package/dist/core/metrics/create.js.map +1 -1
  66. package/dist/core/metrics/new-version.d.ts +13 -0
  67. package/dist/core/metrics/new-version.d.ts.map +1 -0
  68. package/dist/core/metrics/new-version.js +9 -0
  69. package/dist/core/metrics/new-version.js.map +1 -0
  70. package/dist/core/metrics/payload.d.ts +56 -0
  71. package/dist/core/metrics/payload.d.ts.map +1 -0
  72. package/dist/core/metrics/payload.js +173 -0
  73. package/dist/core/metrics/payload.js.map +1 -0
  74. package/dist/core/metrics/update.d.ts +2 -0
  75. package/dist/core/metrics/update.d.ts.map +1 -1
  76. package/dist/core/metrics/update.js +4 -0
  77. package/dist/core/metrics/update.js.map +1 -1
  78. package/dist/core/metrictags/metrictags.js +1 -1
  79. package/dist/core/metrictags/metrictags.js.map +1 -1
  80. package/dist/core/resolve.d.ts +1 -0
  81. package/dist/core/resolve.d.ts.map +1 -1
  82. package/dist/core/resolve.js +8 -0
  83. package/dist/core/resolve.js.map +1 -1
  84. package/dist/core/roles/roles.js +1 -1
  85. package/dist/core/roles/roles.js.map +1 -1
  86. package/dist/core/segments/segments.js +1 -1
  87. package/dist/core/segments/segments.js.map +1 -1
  88. package/dist/core/tags/tags.js +1 -1
  89. package/dist/core/tags/tags.js.map +1 -1
  90. package/dist/core/teams/list.d.ts.map +1 -1
  91. package/dist/core/teams/list.js +5 -1
  92. package/dist/core/teams/list.js.map +1 -1
  93. package/dist/core/units/units.js +1 -1
  94. package/dist/core/units/units.js.map +1 -1
  95. package/dist/core/webhooks/list.js +1 -1
  96. package/dist/core/webhooks/list.js.map +1 -1
  97. package/dist/index.js +1 -1
  98. package/dist/index.js.map +1 -1
  99. package/dist/lib/api/axios-adapter.d.ts +14 -0
  100. package/dist/lib/api/axios-adapter.d.ts.map +1 -1
  101. package/dist/lib/api/axios-adapter.js +101 -2
  102. package/dist/lib/api/axios-adapter.js.map +1 -1
  103. package/dist/lib/auth/token-exchange.d.ts.map +1 -1
  104. package/dist/lib/auth/token-exchange.js +30 -4
  105. package/dist/lib/auth/token-exchange.js.map +1 -1
  106. package/dist/lib/output/formatter.d.ts +1 -1
  107. package/dist/lib/output/formatter.d.ts.map +1 -1
  108. package/dist/lib/output/formatter.js +5 -0
  109. package/dist/lib/output/formatter.js.map +1 -1
  110. package/dist/lib/utils/api-helper.d.ts.map +1 -1
  111. package/dist/lib/utils/api-helper.js +1 -0
  112. package/dist/lib/utils/api-helper.js.map +1 -1
  113. package/dist/lib/utils/list-command.d.ts.map +1 -1
  114. package/dist/lib/utils/list-command.js +7 -1
  115. package/dist/lib/utils/list-command.js.map +1 -1
  116. package/package.json +1 -1
@@ -435,10 +435,23 @@ export class APIClient {
435
435
  const response = await this.request('PUT', `/experiment_recommended_actions/${id}/dismiss`);
436
436
  this.validateOkResponse(response, 'dismissRecommendedAction');
437
437
  }
438
- async listGoals(items = 100, page = 1) {
439
- const response = await this.request('GET', '/goals', {
440
- params: { items: String(items), page: String(page) },
441
- });
438
+ async listGoals(options = {}) {
439
+ const params = {};
440
+ if (options.items !== undefined)
441
+ params.items = String(options.items);
442
+ if (options.page !== undefined)
443
+ params.page = String(options.page);
444
+ if (options.search)
445
+ params.search = options.search;
446
+ if (options.sort)
447
+ params.sort = options.sort;
448
+ if (options.sort_asc !== undefined)
449
+ params.sort_asc = String(options.sort_asc);
450
+ if (options.archived)
451
+ params.archived = 'true';
452
+ if (options.ids)
453
+ params.ids = options.ids;
454
+ const response = await this.request('GET', '/goals', { params });
442
455
  return this.validateListResponse(response, 'goals', 'listGoals');
443
456
  }
444
457
  async getGoal(id) {
@@ -453,10 +466,23 @@ export class APIClient {
453
466
  const response = await this.request('PUT', `/goals/${id}`, { data: { data } });
454
467
  return this.validateEntityResponse(response, 'goal', 'updateGoal');
455
468
  }
456
- async listSegments(items = 100, page = 1) {
457
- const response = await this.request('GET', '/segments', {
458
- params: { items: String(items), page: String(page) },
459
- });
469
+ async listSegments(options = {}) {
470
+ const params = {};
471
+ if (options.items !== undefined)
472
+ params.items = String(options.items);
473
+ if (options.page !== undefined)
474
+ params.page = String(options.page);
475
+ if (options.search)
476
+ params.search = options.search;
477
+ if (options.sort)
478
+ params.sort = options.sort;
479
+ if (options.sort_asc !== undefined)
480
+ params.sort_asc = String(options.sort_asc);
481
+ if (options.archived)
482
+ params.archived = 'true';
483
+ if (options.ids)
484
+ params.ids = options.ids;
485
+ const response = await this.request('GET', '/segments', { params });
460
486
  return this.validateListResponse(response, 'segments', 'listSegments');
461
487
  }
462
488
  async getSegment(id) {
@@ -474,14 +500,23 @@ export class APIClient {
474
500
  async deleteSegment(id) {
475
501
  await this.request('DELETE', `/segments/${id}`);
476
502
  }
477
- async listTeams(includeArchived = false, items = 100, page = 1) {
478
- const response = await this.request('GET', '/teams', {
479
- params: {
480
- include_archived: includeArchived ? '1' : '0',
481
- items: String(items),
482
- page: String(page),
483
- },
484
- });
503
+ async listTeams(options = {}) {
504
+ const params = {};
505
+ if (options.includeArchived || options.archived)
506
+ params.include_archived = '1';
507
+ if (options.items !== undefined)
508
+ params.items = String(options.items);
509
+ if (options.page !== undefined)
510
+ params.page = String(options.page);
511
+ if (options.search)
512
+ params.search = options.search;
513
+ if (options.sort)
514
+ params.sort = options.sort;
515
+ if (options.sort_asc !== undefined)
516
+ params.sort_asc = String(options.sort_asc);
517
+ if (options.ids)
518
+ params.ids = options.ids;
519
+ const response = await this.request('GET', '/teams', { params });
485
520
  return this.validateListResponse(response, 'teams', 'listTeams');
486
521
  }
487
522
  async getTeam(id) {
@@ -620,13 +655,33 @@ export class APIClient {
620
655
  const response = await this.request('PUT', `/metrics/${id}/activate`, { data: { reason } });
621
656
  return this.validateEntityResponse(response, 'metric', 'activateMetric');
622
657
  }
658
+ async createMetricVersion(id, data, reason) {
659
+ const payload = { data };
660
+ if (reason !== undefined)
661
+ payload.reason = reason;
662
+ const response = await this.request('POST', `/metrics/${id}/version`, { data: payload });
663
+ return this.validateEntityResponse(response, 'metric', 'createMetricVersion');
664
+ }
623
665
  async archiveMetric(id, unarchive = false) {
624
666
  await this.request('PUT', `/metrics/${id}/archive`, { data: { archive: !unarchive } });
625
667
  }
626
- async listCustomSectionFields(items = 100, page = 1) {
627
- const response = await this.request('GET', '/experiment_custom_section_fields', {
628
- params: { items: String(items), page: String(page) },
629
- });
668
+ async listCustomSectionFields(options = {}) {
669
+ const params = {};
670
+ if (options.items !== undefined)
671
+ params.items = String(options.items);
672
+ if (options.page !== undefined)
673
+ params.page = String(options.page);
674
+ if (options.search)
675
+ params.search = options.search;
676
+ if (options.sort)
677
+ params.sort = options.sort;
678
+ if (options.sort_asc !== undefined)
679
+ params.sort_asc = String(options.sort_asc);
680
+ if (options.archived)
681
+ params.archived = 'true';
682
+ if (options.ids)
683
+ params.ids = options.ids;
684
+ const response = await this.request('GET', '/experiment_custom_section_fields', { params });
630
685
  return this.validateListResponse(response, 'experiment_custom_section_fields', 'listCustomSectionFields');
631
686
  }
632
687
  async getCustomSectionField(id) {
@@ -674,40 +729,92 @@ export class APIClient {
674
729
  });
675
730
  this.validateOkResponse(response, 'reorderCustomSections');
676
731
  }
677
- async listApplications(items = 100, page = 1) {
678
- const response = await this.request('GET', '/applications', {
679
- params: { items: String(items), page: String(page) },
680
- });
732
+ async listApplications(options = {}) {
733
+ const params = {};
734
+ if (options.items !== undefined)
735
+ params.items = String(options.items);
736
+ if (options.page !== undefined)
737
+ params.page = String(options.page);
738
+ if (options.search)
739
+ params.search = options.search;
740
+ if (options.sort)
741
+ params.sort = options.sort;
742
+ if (options.sort_asc !== undefined)
743
+ params.sort_asc = String(options.sort_asc);
744
+ if (options.archived)
745
+ params.archived = 'true';
746
+ if (options.ids)
747
+ params.ids = options.ids;
748
+ const response = await this.request('GET', '/applications', { params });
681
749
  return this.validateListResponse(response, 'applications', 'listApplications');
682
750
  }
683
751
  async getApplication(id) {
684
752
  const response = await this.request('GET', `/applications/${id}`);
685
753
  return this.validateEntityResponse(response, 'application', 'getApplication');
686
754
  }
687
- async listEnvironments(items = 100, page = 1) {
688
- const response = await this.request('GET', '/environments', {
689
- params: { items: String(items), page: String(page) },
690
- });
755
+ async listEnvironments(options = {}) {
756
+ const params = {};
757
+ if (options.items !== undefined)
758
+ params.items = String(options.items);
759
+ if (options.page !== undefined)
760
+ params.page = String(options.page);
761
+ if (options.search)
762
+ params.search = options.search;
763
+ if (options.sort)
764
+ params.sort = options.sort;
765
+ if (options.sort_asc !== undefined)
766
+ params.sort_asc = String(options.sort_asc);
767
+ if (options.archived)
768
+ params.archived = 'true';
769
+ if (options.ids)
770
+ params.ids = options.ids;
771
+ const response = await this.request('GET', '/environments', { params });
691
772
  return this.validateListResponse(response, 'environments', 'listEnvironments');
692
773
  }
693
774
  async getEnvironment(id) {
694
775
  const response = await this.request('GET', `/environments/${id}`);
695
776
  return this.validateEntityResponse(response, 'environment', 'getEnvironment');
696
777
  }
697
- async listUnitTypes(items = 100, page = 1) {
698
- const response = await this.request('GET', '/unit_types', {
699
- params: { items: String(items), page: String(page) },
700
- });
778
+ async listUnitTypes(options = {}) {
779
+ const params = {};
780
+ if (options.items !== undefined)
781
+ params.items = String(options.items);
782
+ if (options.page !== undefined)
783
+ params.page = String(options.page);
784
+ if (options.search)
785
+ params.search = options.search;
786
+ if (options.sort)
787
+ params.sort = options.sort;
788
+ if (options.sort_asc !== undefined)
789
+ params.sort_asc = String(options.sort_asc);
790
+ if (options.archived)
791
+ params.archived = 'true';
792
+ if (options.ids)
793
+ params.ids = options.ids;
794
+ const response = await this.request('GET', '/unit_types', { params });
701
795
  return this.validateListResponse(response, 'unit_types', 'listUnitTypes');
702
796
  }
703
797
  async getUnitType(id) {
704
798
  const response = await this.request('GET', `/unit_types/${id}`);
705
799
  return this.validateEntityResponse(response, 'unit_type', 'getUnitType');
706
800
  }
707
- async listExperimentTags(items = 100, page = 1) {
708
- const response = await this.request('GET', '/experiment_tags', {
709
- params: { items: String(items), page: String(page) },
710
- });
801
+ async listExperimentTags(options = {}) {
802
+ const params = {};
803
+ if (options.items !== undefined)
804
+ params.items = String(options.items);
805
+ if (options.page !== undefined)
806
+ params.page = String(options.page);
807
+ if (options.search)
808
+ params.search = options.search;
809
+ if (options.sort)
810
+ params.sort = options.sort;
811
+ if (options.sort_asc !== undefined)
812
+ params.sort_asc = String(options.sort_asc);
813
+ if (options.archived)
814
+ params.archived = 'true';
815
+ if (options.ids)
816
+ params.ids = options.ids;
817
+ const response = await this.request('GET', '/experiment_tags', { params });
711
818
  return this.validateListResponse(response, 'experiment_tags', 'listExperimentTags');
712
819
  }
713
820
  async getExperimentTag(id) {
@@ -725,10 +832,23 @@ export class APIClient {
725
832
  async deleteExperimentTag(id) {
726
833
  await this.request('DELETE', `/experiment_tags/${id}`);
727
834
  }
728
- async listGoalTags(items = 100, page = 1) {
729
- const response = await this.request('GET', '/goal_tags', {
730
- params: { items: String(items), page: String(page) },
731
- });
835
+ async listGoalTags(options = {}) {
836
+ const params = {};
837
+ if (options.items !== undefined)
838
+ params.items = String(options.items);
839
+ if (options.page !== undefined)
840
+ params.page = String(options.page);
841
+ if (options.search)
842
+ params.search = options.search;
843
+ if (options.sort)
844
+ params.sort = options.sort;
845
+ if (options.sort_asc !== undefined)
846
+ params.sort_asc = String(options.sort_asc);
847
+ if (options.archived)
848
+ params.archived = 'true';
849
+ if (options.ids)
850
+ params.ids = options.ids;
851
+ const response = await this.request('GET', '/goal_tags', { params });
732
852
  return this.validateListResponse(response, 'goal_tags', 'listGoalTags');
733
853
  }
734
854
  async getGoalTag(id) {
@@ -746,10 +866,23 @@ export class APIClient {
746
866
  async deleteGoalTag(id) {
747
867
  await this.request('DELETE', `/goal_tags/${id}`);
748
868
  }
749
- async listMetricTags(items = 100, page = 1) {
750
- const response = await this.request('GET', '/metric_tags', {
751
- params: { items: String(items), page: String(page) },
752
- });
869
+ async listMetricTags(options = {}) {
870
+ const params = {};
871
+ if (options.items !== undefined)
872
+ params.items = String(options.items);
873
+ if (options.page !== undefined)
874
+ params.page = String(options.page);
875
+ if (options.search)
876
+ params.search = options.search;
877
+ if (options.sort)
878
+ params.sort = options.sort;
879
+ if (options.sort_asc !== undefined)
880
+ params.sort_asc = String(options.sort_asc);
881
+ if (options.archived)
882
+ params.archived = 'true';
883
+ if (options.ids)
884
+ params.ids = options.ids;
885
+ const response = await this.request('GET', '/metric_tags', { params });
753
886
  return this.validateListResponse(response, 'metric_tags', 'listMetricTags');
754
887
  }
755
888
  async getMetricTag(id) {
@@ -767,10 +900,23 @@ export class APIClient {
767
900
  async deleteMetricTag(id) {
768
901
  await this.request('DELETE', `/metric_tags/${id}`);
769
902
  }
770
- async listMetricCategories(items = 100, page = 1) {
771
- const response = await this.request('GET', '/metric_categories', {
772
- params: { items: String(items), page: String(page) },
773
- });
903
+ async listMetricCategories(options = {}) {
904
+ const params = {};
905
+ if (options.items !== undefined)
906
+ params.items = String(options.items);
907
+ if (options.page !== undefined)
908
+ params.page = String(options.page);
909
+ if (options.search)
910
+ params.search = options.search;
911
+ if (options.sort)
912
+ params.sort = options.sort;
913
+ if (options.sort_asc !== undefined)
914
+ params.sort_asc = String(options.sort_asc);
915
+ if (options.archived)
916
+ params.archived = 'true';
917
+ if (options.ids)
918
+ params.ids = options.ids;
919
+ const response = await this.request('GET', '/metric_categories', { params });
774
920
  return this.validateListResponse(response, 'metric_categories', 'listMetricCategories');
775
921
  }
776
922
  async getMetricCategory(id) {
@@ -788,10 +934,23 @@ export class APIClient {
788
934
  async archiveMetricCategory(id, archive = true) {
789
935
  await this.request('PUT', `/metric_categories/${id}/archive`, { data: { archive } });
790
936
  }
791
- async listRoles(items = 20, page = 1) {
792
- const response = await this.request('GET', '/roles', {
793
- params: { items: String(items), page: String(page) },
794
- });
937
+ async listRoles(options = {}) {
938
+ const params = {};
939
+ if (options.items !== undefined)
940
+ params.items = String(options.items);
941
+ if (options.page !== undefined)
942
+ params.page = String(options.page);
943
+ if (options.search)
944
+ params.search = options.search;
945
+ if (options.sort)
946
+ params.sort = options.sort;
947
+ if (options.sort_asc !== undefined)
948
+ params.sort_asc = String(options.sort_asc);
949
+ if (options.archived)
950
+ params.archived = 'true';
951
+ if (options.ids)
952
+ params.ids = options.ids;
953
+ const response = await this.request('GET', '/roles', { params });
795
954
  return this.validateListResponse(response, 'roles', 'listRoles');
796
955
  }
797
956
  async getRole(id) {
@@ -817,10 +976,23 @@ export class APIClient {
817
976
  const response = await this.request('GET', '/permission_categories');
818
977
  return this.validateListResponse(response, 'permission_categories', 'listPermissionCategories');
819
978
  }
820
- async listApiKeys(items = 20, page = 1) {
821
- const response = await this.request('GET', '/api_keys', {
822
- params: { items: String(items), page: String(page) },
823
- });
979
+ async listApiKeys(options = {}) {
980
+ const params = {};
981
+ if (options.items !== undefined)
982
+ params.items = String(options.items);
983
+ if (options.page !== undefined)
984
+ params.page = String(options.page);
985
+ if (options.search)
986
+ params.search = options.search;
987
+ if (options.sort)
988
+ params.sort = options.sort;
989
+ if (options.sort_asc !== undefined)
990
+ params.sort_asc = String(options.sort_asc);
991
+ if (options.archived)
992
+ params.archived = 'true';
993
+ if (options.ids)
994
+ params.ids = options.ids;
995
+ const response = await this.request('GET', '/api_keys', { params });
824
996
  return this.validateListResponse(response, 'api_keys', 'listApiKeys');
825
997
  }
826
998
  async getApiKey(id) {
@@ -838,10 +1010,23 @@ export class APIClient {
838
1010
  async deleteApiKey(id) {
839
1011
  await this.request('DELETE', `/api_keys/${id}`);
840
1012
  }
841
- async listWebhooks(items = 20, page = 1) {
842
- const response = await this.request('GET', '/webhooks', {
843
- params: { items: String(items), page: String(page) },
844
- });
1013
+ async listWebhooks(options = {}) {
1014
+ const params = {};
1015
+ if (options.items !== undefined)
1016
+ params.items = String(options.items);
1017
+ if (options.page !== undefined)
1018
+ params.page = String(options.page);
1019
+ if (options.search)
1020
+ params.search = options.search;
1021
+ if (options.sort)
1022
+ params.sort = options.sort;
1023
+ if (options.sort_asc !== undefined)
1024
+ params.sort_asc = String(options.sort_asc);
1025
+ if (options.archived)
1026
+ params.archived = 'true';
1027
+ if (options.ids)
1028
+ params.ids = options.ids;
1029
+ const response = await this.request('GET', '/webhooks', { params });
845
1030
  return this.validateListResponse(response, 'webhooks', 'listWebhooks');
846
1031
  }
847
1032
  async getWebhook(id) {
@@ -1290,17 +1475,21 @@ export class APIClient {
1290
1475
  const results = await resolveBySearch(namesOrIds, (name) => this.listMetrics({ search: name, archived: true }));
1291
1476
  return namesOrIds.map((ref) => resolveByName(results, ref, 'Metric'));
1292
1477
  }
1478
+ async resolveGoals(namesOrIds) {
1479
+ const results = await resolveBySearch(namesOrIds, (name) => this.listGoals({ search: name }));
1480
+ return namesOrIds.map((ref) => resolveByName(results, ref, 'Goal'));
1481
+ }
1293
1482
  async resolveTeams(namesOrIds) {
1294
- const teams = await this.listTeams();
1295
- return namesOrIds.map((ref) => resolveByName(teams, ref, 'Team'));
1483
+ const results = await resolveBySearch(namesOrIds, (name) => this.listTeams({ search: name }));
1484
+ return namesOrIds.map((ref) => resolveByName(results, ref, 'Team'));
1296
1485
  }
1297
1486
  async resolveApplications(namesOrIds) {
1298
- const apps = await this.listApplications();
1299
- return namesOrIds.map((ref) => resolveByName(apps, ref, 'Application'));
1487
+ const results = await resolveBySearch(namesOrIds, (name) => this.listApplications({ search: name }));
1488
+ return namesOrIds.map((ref) => resolveByName(results, ref, 'Application'));
1300
1489
  }
1301
1490
  async resolveUnitTypes(namesOrIds) {
1302
- const unitTypes = await this.listUnitTypes();
1303
- return namesOrIds.map((ref) => resolveByName(unitTypes, ref, 'Unit type'));
1491
+ const results = await resolveBySearch(namesOrIds, (name) => this.listUnitTypes({ search: name }));
1492
+ return namesOrIds.map((ref) => resolveByName(results, ref, 'Unit type'));
1304
1493
  }
1305
1494
  async resolveTags(namesOrIds) {
1306
1495
  const tags = await this.listExperimentTags();