Skip to content

Commit bd1c6a7

Browse files
authored
Better sub-task support; optional archived filtering for /groups (#194)
1 parent 224438c commit bd1c6a7

File tree

3 files changed

+177
-37
lines changed

3 files changed

+177
-37
lines changed

schema/shortcut.swagger.json

Lines changed: 91 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -413,17 +413,26 @@
413413
]
414414
},
415415
"CreateDoc": {
416+
"x-doc-skip": true,
416417
"type": "object",
417418
"properties": {
418419
"title": {
419420
"maxLength": 256,
420421
"minLength": 1,
421-
"description": "The title for the new document",
422+
"description": "The title for the new document.",
422423
"type": "string"
423424
},
424425
"content": {
425-
"description": "The content for the new document",
426+
"description": "The content for the new document.",
426427
"type": "string"
428+
},
429+
"content_format": {
430+
"description": "Format of the content being sent. Defaults to 'html'. If 'markdown', content will be converted to HTML for storage. Storage is always HTML; this parameter just tells us what format you're sending.",
431+
"type": "string",
432+
"enum": [
433+
"markdown",
434+
"html"
435+
]
427436
}
428437
},
429438
"additionalProperties": false,
@@ -1236,8 +1245,7 @@
12361245
}
12371246
},
12381247
"sub_tasks": {
1239-
"description": "An array of sub-tasks connected to the story",
1240-
"x-doc-skip": true,
1248+
"description": "An array of maps specifying the sub-tasks to create and link to the story.\nField only applicable when Sub-task feature is enabled.",
12411249
"type": "array",
12421250
"items": {
12431251
"$ref": "#/definitions/CreateSubTaskParams"
@@ -1460,8 +1468,7 @@
14601468
"uniqueItems": true
14611469
},
14621470
"sub_tasks": {
1463-
"description": "A list of either params to create a new sub-task or link an existing story as a sub-task",
1464-
"x-doc-skip": true,
1471+
"description": "An array of maps specifying sub-tasks to be associated with the created story. Each map can either link to an existing story or create a new sub-task story to be linked to the created story.\nField only applicable when Sub-task feature is enabled.",
14651472
"type": "array",
14661473
"items": {
14671474
"x-oneOf": [
@@ -1562,7 +1569,7 @@
15621569
"type": "string"
15631570
},
15641571
"parent_story_id": {
1565-
"description": "The id of the parent story to associate with this story.",
1572+
"description": "The ID of the parent story to associate with this story (making the created story a sub-task).\nField only applicable when Sub-task feature is enabled.",
15661573
"type": "integer",
15671574
"format": "int64",
15681575
"x-nullable": true
@@ -1820,8 +1827,7 @@
18201827
}
18211828
},
18221829
"sub_tasks": {
1823-
"description": "A list of either params to create a new sub-task or link an existing story as a sub-task",
1824-
"x-doc-skip": true,
1830+
"description": "An array of maps specifying sub-tasks to be associated with the created story. Each map can either link to an existing story or create a new sub-task story to be linked to the created story.\nField only applicable when Sub-task feature is enabled.",
18251831
"type": "array",
18261832
"items": {
18271833
"x-oneOf": [
@@ -1897,7 +1903,7 @@
18971903
"type": "string"
18981904
},
18991905
"parent_story_id": {
1900-
"description": "The id of the parent story to associate with this story.",
1906+
"description": "The ID of the parent story to associate with this story (making the created story a sub-task).\nField only applicable when Sub-task feature is enabled.",
19011907
"type": "integer",
19021908
"format": "int64",
19031909
"x-nullable": true
@@ -1941,7 +1947,6 @@
19411947
]
19421948
},
19431949
"CreateSubTaskParams": {
1944-
"x-doc-skip": true,
19451950
"type": "object",
19461951
"properties": {
19471952
"name": {
@@ -2282,6 +2287,7 @@
22822287
]
22832288
},
22842289
"DocSlim": {
2290+
"x-doc-skip": true,
22852291
"type": "object",
22862292
"properties": {
22872293
"id": {
@@ -6293,7 +6299,6 @@
62936299
]
62946300
},
62956301
"LinkSubTaskParams": {
6296-
"x-doc-skip": true,
62976302
"type": "object",
62986303
"properties": {
62996304
"story_id": {
@@ -7932,7 +7937,7 @@
79327937
"x-nullable": true
79337938
},
79347939
"sub_task_story_ids": {
7935-
"x-doc-skip": true,
7940+
"description": "The Story IDs of Sub-tasks attached to the Story\nField only applicable when Sub-task feature is enabled.",
79367941
"type": "array",
79377942
"items": {
79387943
"type": "integer",
@@ -8030,7 +8035,7 @@
80308035
"format": "int64"
80318036
},
80328037
"parent_story_id": {
8033-
"x-doc-skip": true,
8038+
"description": "The ID of the parent story to this story (making this story a sub-task).\nField only applicable when Sub-task feature is enabled.",
80348039
"type": "integer",
80358040
"format": "int64",
80368041
"x-nullable": true
@@ -8332,8 +8337,7 @@
83328337
}
83338338
},
83348339
"sub_tasks": {
8335-
"description": "An array of sub-tasks connected to the story",
8336-
"x-doc-skip": true,
8340+
"description": "An array of maps specifying the sub-tasks to create and link to the story.\nField only applicable when Sub-task feature is enabled.",
83378341
"type": "array",
83388342
"items": {
83398343
"$ref": "#/definitions/CreateSubTaskParams"
@@ -8848,7 +8852,7 @@
88488852
"x-nullable": true
88498853
},
88508854
"sub_task_story_ids": {
8851-
"x-doc-skip": true,
8855+
"description": "The Story IDs of Sub-tasks attached to the Story\nField only applicable when Sub-task feature is enabled.",
88528856
"type": "array",
88538857
"items": {
88548858
"type": "integer",
@@ -8946,7 +8950,7 @@
89468950
"format": "int64"
89478951
},
89488952
"parent_story_id": {
8949-
"x-doc-skip": true,
8953+
"description": "The ID of the parent story to this story (making this story a sub-task).\nField only applicable when Sub-task feature is enabled.",
89508954
"type": "integer",
89518955
"format": "int64",
89528956
"x-nullable": true
@@ -9269,7 +9273,7 @@
92699273
"x-nullable": true
92709274
},
92719275
"sub_task_story_ids": {
9272-
"x-doc-skip": true,
9276+
"description": "The Story IDs of Sub-tasks attached to the Story\nField only applicable when Sub-task feature is enabled.",
92739277
"type": "array",
92749278
"items": {
92759279
"type": "integer",
@@ -9353,7 +9357,7 @@
93539357
"format": "int64"
93549358
},
93559359
"parent_story_id": {
9356-
"x-doc-skip": true,
9360+
"description": "The ID of the parent story to this story (making this story a sub-task).\nField only applicable when Sub-task feature is enabled.",
93579361
"type": "integer",
93589362
"format": "int64",
93599363
"x-nullable": true
@@ -9770,6 +9774,18 @@
97709774
"created_at"
97719775
]
97729776
},
9777+
"UnprocessableError": {
9778+
"type": "object",
9779+
"properties": {
9780+
"message": {
9781+
"type": "string"
9782+
}
9783+
},
9784+
"additionalProperties": false,
9785+
"required": [
9786+
"message"
9787+
]
9788+
},
97739789
"UnusableEntitlementError": {
97749790
"type": "object",
97759791
"properties": {
@@ -10802,6 +10818,13 @@
1080210818
},
1080310819
"uniqueItems": true
1080410820
},
10821+
"sub_tasks": {
10822+
"description": "An array of story IDs to attach to this story as sub-tasks. This list represents the final state of the parent's sub-tasks - missing stories will be unlinked, new stories will be linked, and the input order reflects sub-task positions.",
10823+
"type": "array",
10824+
"items": {
10825+
"$ref": "#/definitions/LinkSubTaskParams"
10826+
}
10827+
},
1080510828
"requested_by_id": {
1080610829
"description": "The ID of the member that requested the story.",
1080710830
"type": "string",
@@ -10963,8 +10986,7 @@
1096310986
}
1096410987
},
1096510988
"sub_tasks": {
10966-
"description": "An array of sub-tasks connected to the story",
10967-
"x-doc-skip": true,
10989+
"description": "An array of maps specifying the sub-tasks to create and link to the story.\nField only applicable when Sub-task feature is enabled.",
1096810990
"type": "array",
1096910991
"items": {
1097010992
"$ref": "#/definitions/CreateSubTaskParams"
@@ -11831,7 +11853,7 @@
1183111853
}
1183211854
},
1183311855
"operationId": "createDoc",
11834-
"description": "Creates a new Doc.",
11856+
"description": "Creates a new Doc. Supports markdown or HTML input via content_format parameter.",
1183511857
"summary": "Create Doc"
1183611858
}
1183711859
},
@@ -12965,6 +12987,15 @@
1296512987
},
1296612988
"/api/v3/groups": {
1296712989
"get": {
12990+
"parameters": [
12991+
{
12992+
"in": "query",
12993+
"name": "archived",
12994+
"description": "Filter groups by their archived state. If true, returns only archived groups. If false, returns only unarchived groups. If not provided, returns all groups",
12995+
"required": false,
12996+
"type": "boolean"
12997+
}
12998+
],
1296812999
"responses": {
1296913000
"200": {
1297013001
"schema": {
@@ -16011,6 +16042,43 @@
1601116042
"summary": "Story History"
1601216043
}
1601316044
},
16045+
"/api/v3/stories/{story-public-id}/sub-tasks": {
16046+
"get": {
16047+
"parameters": [
16048+
{
16049+
"in": "path",
16050+
"name": "story-public-id",
16051+
"description": "The ID of the Story.",
16052+
"required": true,
16053+
"type": "integer",
16054+
"format": "int64"
16055+
}
16056+
],
16057+
"responses": {
16058+
"200": {
16059+
"schema": {
16060+
"type": "array",
16061+
"items": {
16062+
"$ref": "#/definitions/StorySlim"
16063+
}
16064+
},
16065+
"description": "Resource"
16066+
},
16067+
"400": {
16068+
"description": "Schema mismatch"
16069+
},
16070+
"404": {
16071+
"description": "Resource does not exist"
16072+
},
16073+
"422": {
16074+
"description": "Unprocessable"
16075+
}
16076+
},
16077+
"operationId": "listStorySubTasks",
16078+
"description": "List Story Sub tasks returns a list of all Sub-task Stories for a given parent Story.",
16079+
"summary": "List Story Sub tasks"
16080+
}
16081+
},
1601416082
"/api/v3/stories/{story-public-id}/tasks": {
1601516083
"post": {
1601616084
"parameters": [

src/generated/Api.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ export class Api<
323323
...params,
324324
});
325325
/**
326-
* @description Creates a new Doc.
326+
* @description Creates a new Doc. Supports markdown or HTML input via content_format parameter.
327327
*
328328
* @name CreateDoc
329329
* @summary Create Doc
@@ -979,10 +979,17 @@ export class Api<
979979
* @request GET:/api/v3/groups
980980
* @secure
981981
*/
982-
listGroups = (params: RequestParams = {}) =>
982+
listGroups = (
983+
query?: {
984+
/** Filter groups by their archived state. If true, returns only archived groups. If false, returns only unarchived groups. If not provided, returns all groups */
985+
archived?: boolean;
986+
},
987+
params: RequestParams = {},
988+
) =>
983989
this.request<Group[], void>({
984990
path: `/api/v3/groups`,
985991
method: "GET",
992+
query: query,
986993
secure: true,
987994
format: "json",
988995
...params,
@@ -2650,6 +2657,22 @@ export class Api<
26502657
format: "json",
26512658
...params,
26522659
});
2660+
/**
2661+
* @description List Story Sub tasks returns a list of all Sub-task Stories for a given parent Story.
2662+
*
2663+
* @name ListStorySubTasks
2664+
* @summary List Story Sub tasks
2665+
* @request GET:/api/v3/stories/{story-public-id}/sub-tasks
2666+
* @secure
2667+
*/
2668+
listStorySubTasks = (storyPublicId: number, params: RequestParams = {}) =>
2669+
this.request<StorySlim[], void>({
2670+
path: `/api/v3/stories/${storyPublicId}/sub-tasks`,
2671+
method: "GET",
2672+
secure: true,
2673+
format: "json",
2674+
...params,
2675+
});
26532676
/**
26542677
* @description Create Task is used to create a new task in a Story.
26552678
*

0 commit comments

Comments
 (0)