@@ -37,93 +37,119 @@ function getGatewayContext(envId, configPath) {
3737}
3838const commands = [
3939 {
40- cmd : 'gateway :create <gatewayPath> [envId] ' ,
40+ cmd : 'service :create <servicePath> ' ,
4141 options : [
42+ {
43+ flags : '-e, --envId [envId]' ,
44+ desc : '环境 Id'
45+ } ,
4246 {
4347 flags : '-f, --function <function>' ,
44- desc : '创建云函数网关. '
48+ desc : '创建云函数HTTP service '
4549 }
4650 ] ,
47- desc : '创建云函数网关. ' ,
48- handler : ( gatewayPath , envId , options ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
49- const { configFile } = options . parent ;
51+ desc : '创建HTTP service ' ,
52+ handler : ( servicePath , options ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
53+ const { parent : { configFile } , envId } = options ;
5054 const ctx = yield getGatewayContext ( envId , configFile ) ;
51- yield create_1 . createGw ( ctx , gatewayPath , options ) ;
55+ yield create_1 . createGw ( ctx , servicePath , options ) ;
5256 } )
5357 } ,
5458 {
55- cmd : 'gateway :delete [envId] ' ,
59+ cmd : 'service :delete' ,
5660 options : [
5761 {
58- flags : '-p, --gateway-path <gatewayPath>' ,
59- desc : 'API Path'
62+ flags : '-e, --envId [envId]' ,
63+ desc : '环境 Id'
64+ } ,
65+ {
66+ flags : '-p, --service-path <servicePath>' ,
67+ desc : 'Service Path'
6068 } ,
6169 {
62- flags : '-i, --gateway -id <gatewayId >' ,
63- desc : 'API id '
70+ flags : '-i, --service -id <serviceId >' ,
71+ desc : 'Service Id '
6472 }
6573 ] ,
66- desc : '删除云函数网关. ' ,
67- handler : ( envId , options ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
68- const { configFile } = options . parent ;
74+ desc : '删除HTTP service ' ,
75+ handler : ( options ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
76+ const { parent : { configFile } , envId } = options ;
6977 const ctx = yield getGatewayContext ( envId , configFile ) ;
7078 yield delete_1 . deleteGw ( ctx , options ) ;
7179 } )
7280 } ,
7381 {
74- cmd : 'gateway :list [envId] ' ,
82+ cmd : 'service :list' ,
7583 options : [
84+ {
85+ flags : '-e, --envId [envId]' ,
86+ desc : '环境 Id'
87+ } ,
7688 {
7789 flags : '-d, --domain <domain>' ,
7890 desc : '域名'
7991 } ,
8092 {
81- flags : '-p, --gateway -path <gatewayPath >' ,
82- desc : 'API Path'
93+ flags : '-p, --service -path <servicePath >' ,
94+ desc : 'Service Path'
8395 } ,
8496 {
85- flags : '-i, --gateway -id <gatewayId >' ,
86- desc : 'API id '
97+ flags : '-i, --service -id <serviceId >' ,
98+ desc : 'Service Id '
8799 }
88100 ] ,
89- desc : '查询云函数网关. ' ,
90- handler : ( envId , options ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
91- const { configFile } = options . parent ;
101+ desc : '查询HTTP service ' ,
102+ handler : ( options ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
103+ const { parent : { configFile } , envId } = options ;
92104 const ctx = yield getGatewayContext ( envId , configFile ) ;
93105 yield query_1 . queryGw ( ctx , options ) ;
94106 } )
95107 } ,
96108 {
97- cmd : 'gateway:domain:bind <customDomain> [envId]' ,
98- options : [ ] ,
99- desc : '绑定自定义网关域名.' ,
100- handler : ( customDomain , envId , options ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
101- const { configFile } = options . parent ;
109+ cmd : 'service:domain:bind <domain>' ,
110+ options : [
111+ {
112+ flags : '-e, --envId [envId]' ,
113+ desc : '环境 Id'
114+ }
115+ ] ,
116+ desc : '绑定HTTP service域名' ,
117+ handler : ( domain , options ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
118+ const { parent : { configFile } , envId } = options ;
102119 const ctx = yield getGatewayContext ( envId , configFile ) ;
103- yield domain_bind_1 . bindGwDomain ( ctx , customDomain ) ;
120+ yield domain_bind_1 . bindGwDomain ( ctx , domain ) ;
104121 } )
105122 } ,
106123 {
107- cmd : 'gateway:domain:unbind <customDomain> [envId]' ,
108- options : [ ] ,
109- desc : '解绑自定义网关名.' ,
110- handler : ( customDomain , envId , options ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
111- const { configFile } = options . parent ;
124+ cmd : 'service:domain:unbind <domain>' ,
125+ options : [
126+ {
127+ flags : '-e, --envId [envId]' ,
128+ desc : '环境 Id'
129+ }
130+ ] ,
131+ desc : '解绑HTTP service域名' ,
132+ handler : ( domain , options ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
133+ const { parent : { configFile } , envId } = options ;
112134 const ctx = yield getGatewayContext ( envId , configFile ) ;
113- yield domain_unbind_1 . unbindGwDomain ( ctx , customDomain ) ;
135+ yield domain_unbind_1 . unbindGwDomain ( ctx , domain ) ;
114136 } )
115137 } ,
116138 {
117- cmd : 'gateway :domain:list [envId] ' ,
139+ cmd : 'service :domain:list' ,
118140 options : [
141+ {
142+ flags : '-e, --envId [envId]' ,
143+ desc : '环境 Id'
144+ } ,
119145 {
120146 flags : '-d, --domain <domain>' ,
121147 desc : '域名'
122148 }
123149 ] ,
124- desc : '查询自定义网关域名. ' ,
125- handler : ( envId , options ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
126- const { configFile } = options . parent ;
150+ desc : '查询HTTP service域名 ' ,
151+ handler : ( options ) => __awaiter ( void 0 , void 0 , void 0 , function * ( ) {
152+ const { parent : { configFile } , envId } = options ;
127153 const ctx = yield getGatewayContext ( envId , configFile ) ;
128154 yield domain_query_1 . queryGwDomain ( ctx , options ) ;
129155 } )
0 commit comments