clubhouse-lib
Advanced tools
Comparing version 0.12.0 to 0.13.0
@@ -10,2 +10,4 @@ "use strict"; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
@@ -12,0 +14,0 @@ function __() { this.constructor = d; } |
@@ -7,2 +7,5 @@ "use strict"; | ||
this.parseResponse = function (response) { | ||
if (response.status === 204) { | ||
return Promise.resolve({}); | ||
} | ||
return response | ||
@@ -9,0 +12,0 @@ .json() |
@@ -1,2 +0,2 @@ | ||
import { Comment, CreateTaskParams, CurrentMember, Epic, EpicChange, File, FileChange, ID, Iteration, IterationChange, Label, LinkedFile, LinkedFileChange, Member, Project, ProjectChange, RequestFactory, RequestPerformer, ResponseParser, Story, StoryChange, StoryLink, StoryLinkChange, StorySearchResult, Task, Team, UpdateTaskParams, Workflow } from './types'; | ||
import { Comment, CreateTaskParams, CurrentMember, Epic, EpicChange, EpicSlim, File, FileChange, ID, Iteration, IterationChange, Label, LinkedFile, LinkedFileChange, Member, Milestone, MilestoneUpdate, Project, ProjectChange, Repository, RequestFactory, RequestPerformer, ResponseParser, Story, StoryChange, StoryLink, StoryLinkChange, StorySearchResult, Task, Team, UpdateTaskParams, Workflow } from './types'; | ||
export * from './types'; | ||
@@ -42,3 +42,3 @@ /** */ | ||
/** */ | ||
listEpics(): Promise<Array<Epic>>; | ||
listEpics(includesDescription?: boolean): Promise<Array<Epic>>; | ||
/** */ | ||
@@ -52,2 +52,3 @@ getEpic(epicID: ID): Promise<Epic>; | ||
deleteEpic(epicID: ID): Promise<Record<string, unknown>>; | ||
listEpicStories(epicID: ID, includesDescription?: boolean): Promise<Array<Story>>; | ||
/** */ | ||
@@ -125,3 +126,15 @@ addReaction(storyId: ID, commentId: ID, emoji: string): Promise<void>; | ||
deleteIteration(iterationID: ID): Promise<Record<string, unknown>>; | ||
/** */ | ||
listRepositories(): Promise<Array<Repository>>; | ||
/** */ | ||
getRepository(repositoryID: ID): Promise<Repository>; | ||
listMilestones(): Promise<Array<Milestone>>; | ||
listMilestoneEpics(milestoneID: ID): Promise<Array<EpicSlim>>; | ||
/** */ | ||
createMilestone(params: MilestoneUpdate): Promise<Milestone>; | ||
/** */ | ||
getMilestone(milestoneID: ID): Promise<Milestone>; | ||
/** */ | ||
updateMilestone(milestoneID: ID, params: MilestoneUpdate): Promise<Milestone>; | ||
} | ||
export default Client; |
@@ -28,3 +28,3 @@ "use strict"; | ||
__exportStar(require("./types"), exports); | ||
var API_BASE_URL = 'https://api.clubhouse.io'; | ||
var API_BASE_URL = 'https://api.app.shortcut.com'; | ||
var API_VERSION = 'v3'; | ||
@@ -116,4 +116,6 @@ var defaultConfig = { | ||
/** */ | ||
Client.prototype.listEpics = function () { | ||
return this.listResource('epics'); | ||
Client.prototype.listEpics = function (includesDescription) { | ||
return this.listResource('epics', { | ||
includes_description: Boolean(includesDescription), | ||
}); | ||
}; | ||
@@ -136,2 +138,7 @@ /** */ | ||
}; | ||
Client.prototype.listEpicStories = function (epicID, includesDescription) { | ||
return this.listResource("epics/" + epicID + "/stories", { | ||
includes_description: Boolean(includesDescription), | ||
}); | ||
}; | ||
/** */ | ||
@@ -299,2 +306,28 @@ Client.prototype.addReaction = function (storyId, commentId, emoji) { | ||
}; | ||
/** */ | ||
Client.prototype.listRepositories = function () { | ||
return this.listResource("repositories"); | ||
}; | ||
/** */ | ||
Client.prototype.getRepository = function (repositoryID) { | ||
return this.getResource("repositories/" + repositoryID); | ||
}; | ||
Client.prototype.listMilestones = function () { | ||
return this.listResource("milestones"); | ||
}; | ||
Client.prototype.listMilestoneEpics = function (milestoneID) { | ||
return this.listResource("milestones/" + milestoneID + "/epics"); | ||
}; | ||
/** */ | ||
Client.prototype.createMilestone = function (params) { | ||
return this.createResource("milestones", params); | ||
}; | ||
/** */ | ||
Client.prototype.getMilestone = function (milestoneID) { | ||
return this.getResource("milestones/" + milestoneID); | ||
}; | ||
/** */ | ||
Client.prototype.updateMilestone = function (milestoneID, params) { | ||
return this.updateResource("milestones/" + milestoneID, params); | ||
}; | ||
return Client; | ||
@@ -301,0 +334,0 @@ }()); |
@@ -24,4 +24,4 @@ "use strict"; | ||
'Content-Type': 'application/json; charset=utf-8', | ||
'Shortcut-Token': this.token, | ||
}; | ||
url.searchParams.append('token', this.token); | ||
if (method === 'GET') { | ||
@@ -28,0 +28,0 @@ if (body) { |
@@ -109,2 +109,3 @@ export declare type ID = string | number; | ||
export declare type Label = { | ||
app_url: string; | ||
archived: boolean; | ||
@@ -313,3 +314,2 @@ color: string | null; | ||
external_links: Array<string>; | ||
external_tickets: Array<ExternalTicket>; | ||
files: Array<File>; | ||
@@ -330,2 +330,3 @@ follower_ids: Array<ID>; | ||
project_id: number; | ||
pull_requests: Array<PullRequest>; | ||
requested_by_id: ID; | ||
@@ -337,3 +338,3 @@ started: boolean; | ||
tasks: Array<Task>; | ||
tasks_id: Array<ID>; | ||
task_ids: Array<ID>; | ||
updated_at: string | null; | ||
@@ -353,2 +354,3 @@ workflow_state_id: number; | ||
external_id?: string; | ||
external_links: Array<string>; | ||
file_ids?: Array<ID>; | ||
@@ -372,3 +374,2 @@ follower_ids?: Array<ID>; | ||
}; | ||
export declare type EpicStates = 'to do' | 'in progress' | 'done'; | ||
export declare type EpicStats = { | ||
@@ -387,2 +388,34 @@ average_cycle_time: number; | ||
}; | ||
export declare type EpicSlim = { | ||
id: number; | ||
app_url: string; | ||
archived: boolean; | ||
completed: boolean; | ||
completed_at: Date | null; | ||
completed_at_override: Date | null; | ||
created_at: Date | null; | ||
deadline: Date | null; | ||
entity_type: string; | ||
epic_state_id: number; | ||
external_id: string | null; | ||
follower_ids: Array<ID>; | ||
group_mention_ids: Array<ID>; | ||
labels: Array<Label>; | ||
member_mention_ids: Array<ID>; | ||
mention_ids: Array<ID>; | ||
milestone_id: number | null; | ||
name: string; | ||
owner_ids: Array<ID>; | ||
planned_start_date: Date | null; | ||
position: number; | ||
project_ids: Array<number>; | ||
requested_by_id: ID; | ||
started: boolean; | ||
started_at: Date | null; | ||
started_at_override: Date | null; | ||
state: string; | ||
stats: EpicStats; | ||
updated_at: Date | null; | ||
}; | ||
export declare type EpicStates = 'to do' | 'in progress' | 'done'; | ||
export declare type Epic = { | ||
@@ -401,3 +434,2 @@ app_url: string; | ||
external_id: string | null; | ||
external_tickets: Array<Record<string, any>>; | ||
follower_ids: Array<ID>; | ||
@@ -481,7 +513,51 @@ group_id: string | null; | ||
}; | ||
export declare type Category = { | ||
id: ID; | ||
archived: boolean; | ||
color: string | null; | ||
created_at: Date; | ||
entity_type: string; | ||
external_id: string | null; | ||
name: string; | ||
type: string; | ||
updated_at: string; | ||
}; | ||
export declare type CreateCategoryParams = { | ||
color: string; | ||
external_id: string; | ||
name: string; | ||
}; | ||
export declare type MilestoneStats = { | ||
average_cycle_time: number; | ||
average_lead_time: number; | ||
}; | ||
export declare type Milestone = { | ||
id: ID; | ||
app_url: string; | ||
categories: Array<Category>; | ||
completed: boolean; | ||
completed_at: Date | null; | ||
completed_at_override: Date | null; | ||
created_at: Date; | ||
description: string; | ||
entity_type: string; | ||
name: string; | ||
position: number; | ||
started: boolean; | ||
started_at: Date | null; | ||
started_at_override: Date | null; | ||
state: string; | ||
stats: MilestoneStats; | ||
updated_at: Date; | ||
}; | ||
export declare type MilestoneStateTypes = 'done' | 'in progress' | 'to do'; | ||
export declare type MilestoneUpdate = { | ||
after_id: number; | ||
before_id: number; | ||
categories: Array<CreateCategoryParams>; | ||
completed_at_override: Date | null; | ||
description: string; | ||
name: string; | ||
started_at_override: Date | null; | ||
state: MilestoneStateTypes; | ||
}; | ||
@@ -539,1 +615,12 @@ export declare type Fact = { | ||
}; | ||
export declare type Repository = { | ||
created_ad: string; | ||
entity_type: string; | ||
external_id?: string | null; | ||
full_name: string; | ||
id: number; | ||
name: string; | ||
type: string; | ||
updated_at: string | null; | ||
url: string; | ||
}; |
{ | ||
"name": "clubhouse-lib", | ||
"version": "0.12.0", | ||
"description": "A Promise based library to the Clubhouse REST API", | ||
"version": "0.13.0", | ||
"description": "A Promise based library to the Shortcut REST API", | ||
"main": "lib/index.js", | ||
@@ -11,15 +11,13 @@ "types": "lib/index.d.ts", | ||
"bugs": { | ||
"url": "https://github.com/clubhouse/clubhouse-lib/issues" | ||
"url": "https://github.com/useshortcut/clubhouse-lib/issues" | ||
}, | ||
"homepage": "https://github.com/clubhouse/clubhouse-lib", | ||
"readme": "https://github.com/clubhouse/clubhouse-lib#readme", | ||
"homepage": "https://github.com/useshortcut/clubhouse-lib", | ||
"readme": "https://github.com/useshortcut/clubhouse-lib#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/clubhouse/clubhouse-lib.git" | ||
"url": "https://github.com/useshortcut/clubhouse-lib.git" | ||
}, | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "rimraf ./lib && yarn build:typescript && yarn build:flow", | ||
"build:typescript": "tsc", | ||
"build:flow": "scripts/generate-flow-types.sh && node scripts/convert-import-from-types", | ||
"build": "rimraf ./lib && tsc", | ||
"lint": "eslint 'src/**/*.{js,ts}'", | ||
@@ -30,29 +28,21 @@ "test": "jest", | ||
"dependencies": { | ||
"cross-fetch": "^3.0.6", | ||
"query-string": "^6.14.0", | ||
"cross-fetch": "^3.1.4", | ||
"universal-url": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^26.0.20", | ||
"@types/node": "^14.14.31", | ||
"@typescript-eslint/eslint-plugin": "^4.15.2", | ||
"@typescript-eslint/parser": "^4.15.2", | ||
"benchmark": "^2.1.4", | ||
"bluebird": "^3.5.0", | ||
"eslint": "^7.20.0", | ||
"eslint-config-airbnb": "^18.0.1", | ||
"eslint-config-prettier": "^8.1.0", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-jest": "^24.1.5", | ||
"eslint-plugin-jsx-a11y": "^6.2.3", | ||
"eslint-plugin-prettier": "^3.1.1", | ||
"eslint-plugin-react": "^7.16.0", | ||
"eslint-plugin-react-hooks": "^4.2.0", | ||
"flowgen": "^1.10.0", | ||
"jest": "^26.6.3", | ||
"prettier": "2.2.1", | ||
"rimraf": "^3.0.0", | ||
"save": "^2.3.1", | ||
"ts-jest": "^26.5.2", | ||
"typescript": "4.1.5" | ||
"@types/jest": "^27.0.1", | ||
"@types/node": "^16.9.1", | ||
"@typescript-eslint/eslint-plugin": "^4.31.1", | ||
"@typescript-eslint/parser": "^4.31.1", | ||
"eslint": "^7.32.0", | ||
"eslint-config-airbnb-base": "^14.2.1", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-import": "^2.24.2", | ||
"eslint-plugin-jest": "^24.4.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"jest": "^27.2.0", | ||
"prettier": "2.4.0", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "^27.0.5", | ||
"typescript": "4.4.3" | ||
}, | ||
@@ -59,0 +49,0 @@ "jest": { |
@@ -10,3 +10,3 @@ <p align="center"> | ||
<p align="center"> | ||
A library for interacting with the Clubhouse REST API | ||
A library for interacting with the Shortcut REST API | ||
</p> | ||
@@ -18,10 +18,10 @@ | ||
</a> | ||
<a href="https://circleci.com/gh/clubhouse/clubhouse-lib"> | ||
<img src="https://circleci.com/gh/clubhouse/clubhouse-lib.svg?style=shield" alt="Current CircleCI build status." /> | ||
<a href="https://circleci.com/gh/useshortcut/clubhouse-lib"> | ||
<img src="https://circleci.com/gh/useshortcut/clubhouse-lib.svg?style=shield" alt="Current CircleCI build status." /> | ||
</a> | ||
<a href="https://circleci.com/gh/clubhouse/clubhouse-lib"> | ||
<a href="https://circleci.com/gh/useshortcut/clubhouse-lib"> | ||
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" /> | ||
</a> | ||
<a href="https://twitter.com/intent/follow?screen_name=clubhouse"> | ||
<img src="https://img.shields.io/twitter/follow/clubhouse.svg?label=Follow%20@clubhouse" alt="Follow @clubhouse" /> | ||
<a href="https://twitter.com/intent/follow?screen_name=useshortcut"> | ||
<img src="https://img.shields.io/twitter/follow/useshortcut.svg?label=Follow%20@useshortcut" alt="Follow @useshortcut" /> | ||
</a> | ||
@@ -50,8 +50,8 @@ </p> | ||
The Clubhouse API uses token-based authentication, you will need one to use this library. | ||
The Shortcut API uses token-based authentication, you will need one to use this library. | ||
To generate an API token, go to https://app.clubhouse.io/settings/account/api-tokens. To make it easier to explore our API, we recommend saving this token as an environment variable in your local dev environment: | ||
To generate an API token, go to https://app.shortcut.com/settings/account/api-tokens. To make it easier to explore our API, we recommend saving this token as an environment variable in your local dev environment: | ||
```bash | ||
export CLUBHOUSE_API_TOKEN="YOUR API TOKEN HERE" | ||
export SHORTCUT_API_TOKEN="YOUR API TOKEN HERE" | ||
``` | ||
@@ -61,3 +61,3 @@ | ||
Requests made with a missing or invalid token will get a `401 Unauthorized` response. All requests must be made over HTTPS. Tokens provide complete access to your Clubhouse account, **so keep them secure**. Don’t paste them into your source code, use an environment variable instead. For security reasons, we will immediately invalidate any tokens we find have been made public. | ||
Requests made with a missing or invalid token will get a `401 Unauthorized` response. All requests must be made over HTTPS. Tokens provide complete access to your Shortcut account, **so keep them secure**. Don’t paste them into your source code, use an environment variable instead. For security reasons, we will immediately invalidate any tokens we find have been made public. | ||
@@ -67,5 +67,5 @@ ## Usage | ||
```javascript | ||
import Clubhouse from 'clubhouse-lib'; | ||
import Shortcut from 'clubhouse-lib'; | ||
const client = Clubhouse.create('your token value'); // See https://github.com/clubhouse/clubhouse-lib#how-to-get-an-api-token | ||
const client = Shortcut.create('your token value'); // See https://github.com/useshortcut/clubhouse-lib#how-to-get-an-api-token | ||
@@ -89,2 +89,2 @@ client.listMembers().then(console.log); | ||
[Documentation for the REST API](https://clubhouse.io/api/rest). | ||
[Documentation for the REST API](https://shortcut.com/api/rest). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2
15
1222
43427
14
- Removedquery-string@^6.14.0
- Removeddecode-uri-component@0.2.2(transitive)
- Removedfilter-obj@1.1.0(transitive)
- Removedquery-string@6.14.1(transitive)
- Removedsplit-on-first@1.1.0(transitive)
- Removedstrict-uri-encode@2.0.0(transitive)
Updatedcross-fetch@^3.1.4