File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " @bucketco/cli" ,
3- "version" : " 0.1.3 " ,
3+ "version" : " 0.1.4 " ,
44 "packageManager" : " yarn@4.1.1" ,
55 "description" : " CLI for Bucket service" ,
66 "main" : " ./dist/index.js" ,
Original file line number Diff line number Diff line change @@ -31,22 +31,13 @@ export async function listFeatures(
3131 appId : string ,
3232 options : ListOptions = { } ,
3333) : Promise < Feature [ ] > {
34- const response = await authRequest < FeaturesResponse > (
35- `/apps/${ appId } /features` ,
36- {
37- params : {
38- sortBy : "name" ,
39- sortOrder : "desc" ,
40- includeRemoteConfigs : options . includeRemoteConfigs ? "true" : "false" ,
41- } ,
34+ return authRequest < FeaturesResponse > ( `/apps/${ appId } /features` , {
35+ params : {
36+ sortBy : "key" ,
37+ sortOrder : "asc" ,
38+ includeRemoteConfigs : options . includeRemoteConfigs ? "true" : "false" ,
4239 } ,
43- ) ;
44-
45- return response . data . map ( ( { name, key, remoteConfigs } ) => ( {
46- name,
47- key,
48- remoteConfigs,
49- } ) ) ;
40+ } ) . then ( ( { data } ) => data ) ;
5041}
5142
5243type FeatureResponse = {
@@ -58,19 +49,15 @@ export async function createFeature(
5849 name : string ,
5950 key : string ,
6051) : Promise < Feature > {
61- const response = await authRequest < FeatureResponse > (
62- `/apps/${ appId } /features` ,
63- {
64- method : "POST" ,
65- headers : {
66- "Content-Type" : "application/json" ,
67- } ,
68- body : JSON . stringify ( {
69- name,
70- key,
71- source : "event" ,
72- } ) ,
52+ return authRequest < FeatureResponse > ( `/apps/${ appId } /features` , {
53+ method : "POST" ,
54+ headers : {
55+ "Content-Type" : "application/json" ,
7356 } ,
74- ) ;
75- return response . feature ;
57+ body : JSON . stringify ( {
58+ name,
59+ key,
60+ source : "event" ,
61+ } ) ,
62+ } ) . then ( ( { feature } ) => feature ) ;
7663}
You can’t perform that action at this time.
0 commit comments