File tree Expand file tree Collapse file tree 4 files changed +16
-8
lines changed Expand file tree Collapse file tree 4 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 12
12
" modelcontextprotocol"
13
13
],
14
14
"license" : " MIT" ,
15
- "version" : " 0.5.0 " ,
15
+ "version" : " 0.5.1 " ,
16
16
"type" : " module" ,
17
17
"main" : " dist/index.js" ,
18
18
"bin" : {
Original file line number Diff line number Diff line change @@ -279,7 +279,7 @@ describe("EpicTools", () => {
279
279
} ) ;
280
280
281
281
expect ( searchEpicsMock . mock . calls ?. [ 0 ] ?. [ 0 ] ) . toBe (
282
- 'id:1 name :"Test Epic" description:"Test Description" state:started objective:123 owner:testuser team :engineering is:archived' ,
282
+ 'id:1 title :"Test Epic" description:"Test Description" state:started objective:123 owner:testuser group :engineering is:archived' ,
283
283
) ;
284
284
} ) ;
285
285
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ describe("buildSearchQuery", () => {
48
48
state : "started" ,
49
49
} ;
50
50
const result = await buildSearchQuery ( params , null ) ;
51
- expect ( result ) . toBe ( "name :test state:started" ) ;
51
+ expect ( result ) . toBe ( "title :test state:started" ) ;
52
52
} ) ;
53
53
54
54
test ( "should quote string parameters with spaces" , async ( ) => {
@@ -57,7 +57,7 @@ describe("buildSearchQuery", () => {
57
57
description : "some description" ,
58
58
} ;
59
59
const result = await buildSearchQuery ( params , null ) ;
60
- expect ( result ) . toBe ( 'name :"test story" description:"some description"' ) ;
60
+ expect ( result ) . toBe ( 'title :"test story" description:"some description"' ) ;
61
61
} ) ;
62
62
63
63
test ( "should handle mixed parameter types correctly" , async ( ) => {
@@ -68,7 +68,7 @@ describe("buildSearchQuery", () => {
68
68
hasOwner : false ,
69
69
} ;
70
70
const result = await buildSearchQuery ( params , null ) ;
71
- expect ( result ) . toBe ( "id:123 name :test is:started !has:owner" ) ;
71
+ expect ( result ) . toBe ( "id:123 title :test is:started !has:owner" ) ;
72
72
} ) ;
73
73
74
74
test ( 'should replace "me" with current user mention name for owner parameter' , async ( ) => {
Original file line number Diff line number Diff line change 1
1
import type { MemberInfo } from "@shortcut/client" ;
2
2
3
+ const keyRenames = { team : "group" , name : "title" } as const ;
4
+
5
+ const mapKeyName = ( key : string ) => {
6
+ const lowercaseKey = key . toLowerCase ( ) ;
7
+
8
+ return keyRenames [ lowercaseKey as keyof typeof keyRenames ] || lowercaseKey ;
9
+ } ;
10
+
3
11
const getKey = ( prop : string ) => {
4
- if ( prop . startsWith ( "is" ) ) return `is:${ prop . slice ( 2 ) . toLowerCase ( ) } ` ;
5
- if ( prop . startsWith ( "has" ) ) return `has:${ prop . slice ( 3 ) . toLowerCase ( ) } ` ;
6
- return prop ;
12
+ if ( prop . startsWith ( "is" ) ) return `is:${ mapKeyName ( prop . slice ( 2 ) ) } ` ;
13
+ if ( prop . startsWith ( "has" ) ) return `has:${ mapKeyName ( prop . slice ( 3 ) ) } ` ;
14
+ return mapKeyName ( prop ) ;
7
15
} ;
8
16
9
17
export type QueryParams = { [ key : string ] : boolean | string | number } ;
You can’t perform that action at this time.
0 commit comments