@absmartly/cli 1.1.0 → 1.3.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.
- package/README.md +24 -0
- package/dist/api-client/api-client.d.ts +132 -14
- package/dist/api-client/api-client.d.ts.map +1 -1
- package/dist/api-client/api-client.js +255 -66
- package/dist/api-client/api-client.js.map +1 -1
- package/dist/commands/apikeys/index.js +9 -1
- package/dist/commands/apikeys/index.js.map +1 -1
- package/dist/commands/apps/index.js +9 -1
- package/dist/commands/apps/index.js.map +1 -1
- package/dist/commands/auth/index.js +30 -0
- package/dist/commands/auth/index.js.map +1 -1
- package/dist/commands/customfields/index.js +9 -1
- package/dist/commands/customfields/index.js.map +1 -1
- package/dist/commands/envs/index.js +9 -1
- package/dist/commands/envs/index.js.map +1 -1
- package/dist/commands/experiments/activity.js +1 -1
- package/dist/commands/experiments/activity.js.map +1 -1
- package/dist/commands/experiments/export.d.ts.map +1 -1
- package/dist/commands/experiments/export.js +11 -4
- package/dist/commands/experiments/export.js.map +1 -1
- package/dist/commands/experiments/list.js +1 -1
- package/dist/commands/experiments/list.js.map +1 -1
- package/dist/commands/goals/index.js +9 -1
- package/dist/commands/goals/index.js.map +1 -1
- package/dist/commands/goaltags/index.js +9 -1
- package/dist/commands/goaltags/index.js.map +1 -1
- package/dist/commands/metriccategories/index.js +9 -1
- package/dist/commands/metriccategories/index.js.map +1 -1
- package/dist/commands/metrics/index.d.ts.map +1 -1
- package/dist/commands/metrics/index.js +179 -29
- package/dist/commands/metrics/index.js.map +1 -1
- package/dist/commands/metrictags/index.js +9 -1
- package/dist/commands/metrictags/index.js.map +1 -1
- package/dist/commands/roles/index.js +9 -1
- package/dist/commands/roles/index.js.map +1 -1
- package/dist/commands/segments/index.js +9 -1
- package/dist/commands/segments/index.js.map +1 -1
- package/dist/commands/tags/index.js +9 -1
- package/dist/commands/tags/index.js.map +1 -1
- package/dist/commands/teams/index.js +10 -1
- package/dist/commands/teams/index.js.map +1 -1
- package/dist/commands/units/index.js +9 -1
- package/dist/commands/units/index.js.map +1 -1
- package/dist/commands/webhooks/index.js +9 -1
- package/dist/commands/webhooks/index.js.map +1 -1
- package/dist/core/activity/activity.js +1 -1
- package/dist/core/activity/activity.js.map +1 -1
- package/dist/core/apikeys/apikeys.js +1 -1
- package/dist/core/apikeys/apikeys.js.map +1 -1
- package/dist/core/apps/apps.js +1 -1
- package/dist/core/apps/apps.js.map +1 -1
- package/dist/core/customfields/list.js +1 -1
- package/dist/core/customfields/list.js.map +1 -1
- package/dist/core/envs/envs.js +1 -1
- package/dist/core/envs/envs.js.map +1 -1
- package/dist/core/experiments/custom-fields.js +1 -1
- package/dist/core/experiments/custom-fields.js.map +1 -1
- package/dist/core/experiments/metrics.js +1 -1
- package/dist/core/experiments/metrics.js.map +1 -1
- package/dist/core/goals/list.js +1 -1
- package/dist/core/goals/list.js.map +1 -1
- package/dist/core/goaltags/goaltags.js +1 -1
- package/dist/core/goaltags/goaltags.js.map +1 -1
- package/dist/core/metriccategories/metriccategories.js +1 -1
- package/dist/core/metriccategories/metriccategories.js.map +1 -1
- package/dist/core/metrics/create.d.ts +2 -12
- package/dist/core/metrics/create.d.ts.map +1 -1
- package/dist/core/metrics/create.js +3 -19
- package/dist/core/metrics/create.js.map +1 -1
- package/dist/core/metrics/new-version.d.ts +13 -0
- package/dist/core/metrics/new-version.d.ts.map +1 -0
- package/dist/core/metrics/new-version.js +9 -0
- package/dist/core/metrics/new-version.js.map +1 -0
- package/dist/core/metrics/payload.d.ts +56 -0
- package/dist/core/metrics/payload.d.ts.map +1 -0
- package/dist/core/metrics/payload.js +173 -0
- package/dist/core/metrics/payload.js.map +1 -0
- package/dist/core/metrics/update.d.ts +2 -0
- package/dist/core/metrics/update.d.ts.map +1 -1
- package/dist/core/metrics/update.js +4 -0
- package/dist/core/metrics/update.js.map +1 -1
- package/dist/core/metrictags/metrictags.js +1 -1
- package/dist/core/metrictags/metrictags.js.map +1 -1
- package/dist/core/resolve.d.ts +1 -0
- package/dist/core/resolve.d.ts.map +1 -1
- package/dist/core/resolve.js +8 -0
- package/dist/core/resolve.js.map +1 -1
- package/dist/core/roles/roles.js +1 -1
- package/dist/core/roles/roles.js.map +1 -1
- package/dist/core/segments/segments.js +1 -1
- package/dist/core/segments/segments.js.map +1 -1
- package/dist/core/tags/tags.js +1 -1
- package/dist/core/tags/tags.js.map +1 -1
- package/dist/core/teams/list.d.ts.map +1 -1
- package/dist/core/teams/list.js +5 -1
- package/dist/core/teams/list.js.map +1 -1
- package/dist/core/units/units.js +1 -1
- package/dist/core/units/units.js.map +1 -1
- package/dist/core/webhooks/list.js +1 -1
- package/dist/core/webhooks/list.js.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/api/axios-adapter.d.ts +44 -11
- package/dist/lib/api/axios-adapter.d.ts.map +1 -1
- package/dist/lib/api/axios-adapter.js +211 -2
- package/dist/lib/api/axios-adapter.js.map +1 -1
- package/dist/lib/api/client.d.ts +2 -6
- package/dist/lib/api/client.d.ts.map +1 -1
- package/dist/lib/api/client.js +1 -1
- package/dist/lib/api/client.js.map +1 -1
- package/dist/lib/api/request-logger.d.ts +18 -0
- package/dist/lib/api/request-logger.d.ts.map +1 -0
- package/dist/lib/api/request-logger.js +353 -0
- package/dist/lib/api/request-logger.js.map +1 -0
- package/dist/lib/auth/token-exchange.d.ts.map +1 -1
- package/dist/lib/auth/token-exchange.js +30 -4
- package/dist/lib/auth/token-exchange.js.map +1 -1
- package/dist/lib/output/formatter.d.ts +1 -1
- package/dist/lib/output/formatter.d.ts.map +1 -1
- package/dist/lib/output/formatter.js +5 -0
- package/dist/lib/output/formatter.js.map +1 -1
- package/dist/lib/utils/api-helper.d.ts +7 -0
- package/dist/lib/utils/api-helper.d.ts.map +1 -1
- package/dist/lib/utils/api-helper.js +23 -1
- package/dist/lib/utils/api-helper.js.map +1 -1
- package/dist/lib/utils/download.d.ts +10 -1
- package/dist/lib/utils/download.d.ts.map +1 -1
- package/dist/lib/utils/download.js +69 -8
- package/dist/lib/utils/download.js.map +1 -1
- package/dist/lib/utils/list-command.d.ts.map +1 -1
- package/dist/lib/utils/list-command.js +7 -1
- package/dist/lib/utils/list-command.js.map +1 -1
- 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(
|
|
439
|
-
const
|
|
440
|
-
|
|
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(
|
|
457
|
-
const
|
|
458
|
-
|
|
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(
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
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(
|
|
627
|
-
const
|
|
628
|
-
|
|
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(
|
|
678
|
-
const
|
|
679
|
-
|
|
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(
|
|
688
|
-
const
|
|
689
|
-
|
|
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(
|
|
698
|
-
const
|
|
699
|
-
|
|
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(
|
|
708
|
-
const
|
|
709
|
-
|
|
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(
|
|
729
|
-
const
|
|
730
|
-
|
|
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(
|
|
750
|
-
const
|
|
751
|
-
|
|
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(
|
|
771
|
-
const
|
|
772
|
-
|
|
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(
|
|
792
|
-
const
|
|
793
|
-
|
|
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(
|
|
821
|
-
const
|
|
822
|
-
|
|
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(
|
|
842
|
-
const
|
|
843
|
-
|
|
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
|
|
1295
|
-
return namesOrIds.map((ref) => resolveByName(
|
|
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
|
|
1299
|
-
return namesOrIds.map((ref) => resolveByName(
|
|
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
|
|
1303
|
-
return namesOrIds.map((ref) => resolveByName(
|
|
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();
|