Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shortcut/client",
"version": "3.1.0",
"version": "3.2.0",
"description": "A library for interacting with the Shortcut REST API",
"homepage": "https://github.com/useshortcut/shortcut-client-js",
"bugs": {
Expand Down
184 changes: 183 additions & 1 deletion schema/shortcut.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -9873,6 +9873,18 @@
"created_at"
]
},
"UnprocessableError": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"message"
]
},
"UnusableEntitlementError": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -10011,7 +10023,6 @@
"additionalProperties": false
},
"UpdateDoc": {
"x-doc-skip": true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this PR, I just removed this line and re-built. But I assume next sync will add this back. What is the correct way of removing this?

"type": "object",
"properties": {
"title": {
Expand Down Expand Up @@ -12111,6 +12122,140 @@
"summary": "Delete Doc"
}
},
"/api/v3/documents/{doc-public-id}/epics": {
"get": {
"parameters": [
{
"in": "path",
"name": "doc-public-id",
"description": "The public ID of the Document.",
"required": true,
"type": "string",
"format": "uuid"
}
],
"responses": {
"200": {
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/EpicSlim"
}
},
"description": "Resource"
},
"400": {
"description": "Schema mismatch"
},
"403": {
"description": "",
"schema": {
"$ref": "#/definitions/DisabledFeatureError"
}
},
"404": {
"description": "Resource does not exist"
},
"422": {
"description": "Unprocessable"
}
},
"operationId": "listDocumentEpics",
"description": "Get a list of all Epics related to this Document.",
"summary": "List Document Epics"
}
},
"/api/v3/documents/{doc-public-id}/epics/{epic-public-id}": {
"put": {
"parameters": [
{
"in": "path",
"name": "doc-public-id",
"description": "The public ID of the Document.",
"required": true,
"type": "string",
"format": "uuid"
},
{
"in": "path",
"name": "epic-public-id",
"description": "The public ID of the Epic.",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Schema mismatch"
},
"403": {
"description": "",
"schema": {
"$ref": "#/definitions/DisabledFeatureError"
}
},
"404": {
"description": "Resource does not exist"
},
"422": {
"description": "**Either:** (1) Unprocessable **or** (2) ",
"schema": {
"$ref": "#/definitions/UnprocessableError"
}
}
},
"operationId": "linkDocumentToEpic",
"description": "Create a relationship between a Document and an Epic.",
"summary": "Link Document to Epic"
},
"delete": {
"parameters": [
{
"in": "path",
"name": "doc-public-id",
"description": "The public ID of the Document.",
"required": true,
"type": "string",
"format": "uuid"
},
{
"in": "path",
"name": "epic-public-id",
"description": "The public ID of the Epic.",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Schema mismatch"
},
"403": {
"description": "",
"schema": {
"$ref": "#/definitions/DisabledFeatureError"
}
},
"404": {
"description": "Resource does not exist"
},
"422": {
"description": "Unprocessable"
}
},
"operationId": "unlinkDocumentFromEpic",
"description": "Remove a relationship between a Document and an Epic.",
"summary": "Unlink Document from Epic"
}
},
"/api/v3/entity-templates": {
"get": {
"responses": {
Expand Down Expand Up @@ -12817,6 +12962,43 @@
"summary": "Delete Epic Comment"
}
},
"/api/v3/epics/{epic-public-id}/documents": {
"get": {
"parameters": [
{
"in": "path",
"name": "epic-public-id",
"description": "The unique ID of the Epic.",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"200": {
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/DocSlim"
}
},
"description": "Resource"
},
"400": {
"description": "Schema mismatch"
},
"404": {
"description": "Resource does not exist"
},
"422": {
"description": "Unprocessable"
}
},
"operationId": "listEpicDocuments",
"description": "Get a list of all Documents related to this Epic.",
"summary": "List Epic Documents"
}
},
"/api/v3/epics/{epic-public-id}/health": {
"get": {
"parameters": [
Expand Down
71 changes: 71 additions & 0 deletions src/generated/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import type {
StorySlim,
Task,
ThreadedComment,
UnprocessableError,
UnusableEntitlementError,
UpdateCategory,
UpdateComment,
Expand Down Expand Up @@ -411,6 +412,60 @@ export class Api<
type: ContentType.Json,
...params,
});
/**
* @description Get a list of all Epics related to this Document.
*
* @name ListDocumentEpics
* @summary List Document Epics
* @request GET:/api/v3/documents/{doc-public-id}/epics
* @secure
*/
listDocumentEpics = (docPublicId: string, params: RequestParams = {}) =>
this.request<EpicSlim[], void | DisabledFeatureError>({
path: `/api/v3/documents/${docPublicId}/epics`,
method: "GET",
secure: true,
format: "json",
...params,
});
/**
* @description Create a relationship between a Document and an Epic.
*
* @name LinkDocumentToEpic
* @summary Link Document to Epic
* @request PUT:/api/v3/documents/{doc-public-id}/epics/{epic-public-id}
* @secure
*/
linkDocumentToEpic = (
docPublicId: string,
epicPublicId: number,
params: RequestParams = {},
) =>
this.request<void, void | DisabledFeatureError | UnprocessableError>({
path: `/api/v3/documents/${docPublicId}/epics/${epicPublicId}`,
method: "PUT",
secure: true,
...params,
});
/**
* @description Remove a relationship between a Document and an Epic.
*
* @name UnlinkDocumentFromEpic
* @summary Unlink Document from Epic
* @request DELETE:/api/v3/documents/{doc-public-id}/epics/{epic-public-id}
* @secure
*/
unlinkDocumentFromEpic = (
docPublicId: string,
epicPublicId: number,
params: RequestParams = {},
) =>
this.request<void, void | DisabledFeatureError>({
path: `/api/v3/documents/${docPublicId}/epics/${epicPublicId}`,
method: "DELETE",
secure: true,
...params,
});
/**
* @description List all the entity templates for the Workspace.
*
Expand Down Expand Up @@ -803,6 +858,22 @@ export class Api<
secure: true,
...params,
});
/**
* @description Get a list of all Documents related to this Epic.
*
* @name ListEpicDocuments
* @summary List Epic Documents
* @request GET:/api/v3/epics/{epic-public-id}/documents
* @secure
*/
listEpicDocuments = (epicPublicId: number, params: RequestParams = {}) =>
this.request<DocSlim[], void>({
path: `/api/v3/epics/${epicPublicId}/documents`,
method: "GET",
secure: true,
format: "json",
...params,
});
/**
* @description Get the current health for the specified Epic.
*
Expand Down
4 changes: 4 additions & 0 deletions src/generated/data-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5282,6 +5282,10 @@ export interface TypedStoryLink {
created_at: string;
}

export interface UnprocessableError {
message: string;
}

export interface UnusableEntitlementError {
/** The tag for violating an entitlement action. */
reason_tag: "entitlement-violation";
Expand Down