Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add external_links to Story type (#93) #1

Open
wants to merge 53 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
3ea61e0
Add external_links to Story type (#93)
charpeni Mar 1, 2021
da4a3aa
Make it compatible in browser (#95)
charpeni Mar 1, 2021
988c498
Support includes_description in listStories (#94)
charpeni Mar 1, 2021
eb95172
0.11.0-rc.0
charpeni Mar 1, 2021
82e0b33
Fix capitalization
charpeni Mar 1, 2021
7799ebe
0.11.0
charpeni Mar 1, 2021
e2d5750
Update PullRequest type (#96)
charpeni Mar 3, 2021
1dc9689
0.12.0
charpeni Mar 3, 2021
fa50c1c
Migrate to shortcut (#113)
steaks Sep 13, 2021
bfbe0d8
Bump ws from 7.4.3 to 7.5.5 (#117)
dependabot[bot] Sep 13, 2021
e28df02
Add milestone endpoints (#69)
adamazing Sep 13, 2021
41f1c78
Fix linting
charpeni Sep 13, 2021
6feec99
Add repository type and endpoints. Add pull_requests to Story type. (…
Sep 13, 2021
db15ef0
Updates types to add storychange (#101)
MattieTK Sep 13, 2021
d60ab8f
Bump hosted-git-info from 2.8.8 to 2.8.9 (#103)
dependabot[bot] Sep 13, 2021
96ba6bd
Bump browserslist from 4.16.3 to 4.16.6 (#104)
dependabot[bot] Sep 13, 2021
06b6835
Bump glob-parent from 5.1.1 to 5.1.2 (#106)
dependabot[bot] Sep 13, 2021
2297cfe
Bump path-parse from 1.0.6 to 1.0.7 (#109)
dependabot[bot] Sep 13, 2021
8054bec
Add listEpicStories endpoint + tests (#110)
adnanrhussain Sep 13, 2021
66b717f
fix: add missing app_url prop to label (#116)
yordis Sep 13, 2021
d4285ea
Remove typing for external_tickets (#120)
charpeni Sep 15, 2021
bfb7ca4
Remove support for Flow (#121)
charpeni Sep 15, 2021
bc21a59
Clean up and update dependencies (#122)
charpeni Sep 15, 2021
7019c72
deleteStoryComment throws error on 204 No Content (#98)
mikabytes Sep 17, 2021
6893990
Add Shortcut-Token header (#124)
charpeni Sep 17, 2021
6ce73d9
Create codeql-analysis.yml
charpeni Sep 17, 2021
c00d81a
Update badges (#123)
charpeni Sep 20, 2021
7f8bbc3
0.13.0
charpeni Sep 20, 2021
47817db
Rewrite into a generated client from Swagger schema (#127)
charpeni Oct 7, 2021
0edc27a
Fix npm badge
charpeni Oct 7, 2021
03d6c64
Bump ansi-regex from 5.0.0 to 5.0.1 (#128)
dependabot[bot] Oct 7, 2021
0d0151b
Publish GH pages (#129)
charpeni Oct 7, 2021
1a7efde
Bump nanoid from 3.1.25 to 3.2.0 (#133)
dependabot[bot] Aug 30, 2023
dedae5e
Bump minimist from 1.2.5 to 1.2.8 (#149)
dependabot[bot] Aug 30, 2023
2fd845a
Bump semver from 5.7.1 to 5.7.2 (#148)
dependabot[bot] Aug 30, 2023
fa75462
Bump validator from 13.6.0 to 13.11.0 (#147)
dependabot[bot] Aug 30, 2023
597a019
Bump word-wrap from 1.2.3 to 1.2.5 (#146)
dependabot[bot] Aug 30, 2023
047c4b7
Bump json5 from 1.0.1 to 1.0.2 (#145)
dependabot[bot] Aug 30, 2023
e3e63a7
Bump minimatch from 3.0.4 to 3.1.2 (#150)
dependabot[bot] Aug 30, 2023
d6fe660
Update Swagger definitions, deps, and library components (#151)
virgofx Sep 5, 2023
184e940
Remove CodeGL (#153)
charpeni Sep 5, 2023
7960923
Use `curl` instead of `node-wget` (#152)
charpeni Sep 5, 2023
5e96430
Bump node-fetch from 2.6.2 to 2.7.0 (#154)
dependabot[bot] Sep 5, 2023
30647e3
Bump @babel/traverse from 7.22.11 to 7.23.2 (#155)
dependabot[bot] Oct 23, 2023
93d1874
Bump axios from 1.5.0 to 1.6.0 (#156)
dependabot[bot] Nov 21, 2023
0de3835
Bump follow-redirects from 1.15.2 to 1.15.4 (#157)
dependabot[bot] Jan 29, 2024
e42dbb6
Update GitHub pages workflow to include explicit permissions (#158)
virgofx Jan 29, 2024
4fdedea
Update GitHub pages workflow to include `contents: write` (#159)
virgofx Jan 29, 2024
e3eef70
Bump follow-redirects from 1.15.4 to 1.15.6 (#160)
dependabot[bot] Mar 29, 2024
2b14d71
Bump braces from 3.0.2 to 3.0.3 (#161)
dependabot[bot] Jul 22, 2024
d2c9dd7
Update Swagger schema and regenerate the API (#162)
charpeni Sep 9, 2024
91140ff
Bump micromatch from 4.0.5 to 4.0.8 (#163)
dependabot[bot] Sep 9, 2024
837e7af
Bump axios from 1.6.0 to 1.7.4 (#164)
dependabot[bot] Sep 16, 2024
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
67 changes: 52 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
version: 2.1

aliases:
- &defaults
resource_class: small
docker:
- image: cimg/node:lts
- &save-cache-yarn
key: yarn-packages-{{ checksum "yarn.lock" }}
paths:
Expand All @@ -7,16 +13,20 @@ aliases:
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ checksum "yarn.lock" }}
- &attach_workspace
attach_workspace:
at: ~/clubhouse-lib

defaults: &defaults
working_directory: ~/clubhouse-lib
docker:
- image: circleci/node:14
commands:
persist-workspace:
steps:
- persist_to_workspace:
root: ~/
paths:
- project
attach-workspace:
steps:
- attach_workspace:
at: ~/
- run: yarn install

version: 2
jobs:
checkout:
<<: *defaults
Expand All @@ -31,42 +41,69 @@ jobs:
command: |
yarn install --frozen-lockfile --no-progress --non-interactive --cache-folder ~/.cache/yarn
- save_cache: *save-cache-yarn
- persist_to_workspace:
root: .
paths: .
- persist-workspace
lint:
<<: *defaults
steps:
- *attach_workspace
- attach-workspace
- run:
name: Lint
command: yarn lint
validate-schema:
<<: *defaults
steps:
- attach-workspace
- run:
name: Validate Schema
command: yarn validate:schema
test:
<<: *defaults
steps:
- *attach_workspace
- attach-workspace
- run:
name: Run Jest
command: yarn test
format-check:
<<: *defaults
steps:
- attach-workspace
- run:
name: Format Check
command: yarn format:check
validate-examples:
<<: *defaults
steps:
- attach-workspace
- run:
name: Run TSC
command: yarn validate:examples
build:
<<: *defaults
steps:
- *attach_workspace
- attach-workspace
- run:
name: Build
command: yarn build

workflows:
version: 2
tests:
jobs:
- checkout
- lint:
requires:
- checkout
- validate-schema:
requires:
- checkout
- test:
requires:
- checkout
- validate-examples:
requires:
- checkout
- format-check:
requires:
- checkout
- build:
requires:
- checkout
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/src/generated
30 changes: 20 additions & 10 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"airbnb",
"airbnb-base",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended"
Expand All @@ -10,13 +10,21 @@
"sourceType": "module"
},
"settings": {
"import/extensions": [".js", ".ts"],
"import/extensions": [
".js",
".ts"
],
"import/parsers": {
"@typescript-eslint/parser": [".ts"]
"@typescript-eslint/parser": [
".ts"
]
},
"import/resolver": {
"node": {
"extensions": [".js", ".ts"]
"extensions": [
".js",
".ts"
]
}
}
},
Expand All @@ -29,10 +37,12 @@
"jest": true,
"es6": true
},
"rules": {
"no-undef": 0,
"import/extensions": 0,
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/no-explicit-any": 0
}
"rules": {
"no-undef": 0,
"import/extensions": 0,
"import/prefer-default-export": 0,
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/no-explicit-any": 0,
"no-restricted-exports": 0
}
}
31 changes: 31 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "GitHub Pages"

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # Required for deploying pages
pages: write # Required for deploying pages
steps:
- uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
cache: 'yarn'

- run: yarn install
- run: yarn build:client
- run: yarn build:docs

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ lib/
node_modules/
npm-debug.log
package-lock.json
/docs
*.log
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.DS_Store
/src
**/__tests__/**
/docs
/schema
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/src/generated
/schema
13 changes: 11 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"parser": "typescript",
"singleQuote": true,
"semi": true,
"trailingComma": "all",
"singleQuote": true
"arrowParens": "always",
"overrides": [
{
"files": "*.ts",
"options": {
"parser": "typescript"
}
}
]
}
61 changes: 32 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<p align="center">
<img height="60" src="https://user-images.githubusercontent.com/7189823/67512945-deb55180-f667-11e9-823f-023d1629f868.png" alt="Clubhouse logo">
<img height="60" src="https://github.com/useshortcut/shortcut-client-js/assets/739719/b1a2efa0-6de1-4bc4-8525-563c53a9b2ba" alt="Shortcut" />
</p>

<h3 align="center">
Clubhouse-lib
@shortcut/client
</h3>

<p align="center">
A library for interacting with the Clubhouse REST API
A library for interacting with the Shortcut REST API.
</p>

<p align="center">
<a href="https://www.npmjs.org/package/clubhouse-lib">
<img src="https://badge.fury.io/js/clubhouse-lib.svg" alt="Current npm package version." />
<a href="https://www.npmjs.org/package/@shortcut/client">
<img src="https://badge.fury.io/js/@shortcut%2Fclient.svg" alt="Current npm package version." />
</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/shortcut-client-js">
<img src="https://circleci.com/gh/useshortcut/shortcut-client-js.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/shortcut-client-js">
<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@shortcut" alt="Follow @shortcut" />
</a>
</p>

Expand All @@ -31,54 +31,57 @@

### Installation

You can install clubhouse-lib with [NPM](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com).
You can install `@shortcut/client` with [NPM](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com).

```shell
npm install --save clubhouse-lib
npm install --save @shortcut/client
```

or

```shell
yarn add clubhouse-lib
yarn add @shortcut/client
```

### How To Get an API Token
> Our legacy organization name is `@useshortcut`. While this will still contain copies of all future released package versions, we **strongly** recommended switching to our primary `@shortcut` organization namespace.

The Clubhouse API uses token-based authentication, you will need one to use this library.
### How to Get an API Token

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:
The Shortcut API uses token-based authentication, you will need one to use this library.

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"
```

This will allow you to copy and paste many examples in the documentation to try them out.

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.

## Usage

```javascript
import Clubhouse from 'clubhouse-lib';
To see all available exports, take a look at the [API documentation](https://useshortcut.github.io/shortcut-client-js/) or check out the `.d.ts` files in this repository.

const client = Clubhouse.create('your token value'); // See https://github.com/clubhouse/clubhouse-lib#how-to-get-an-api-token
```javascript
import { ShortcutClient } from '@shortcut/client';
// const { ShortcutClient } = require('@shortcut/client');

client.listMembers().then(console.log);
const shortcut = new ShortcutClient('YOUR_API_TOKEN'); // See https://github.com/useshortcut/shortcut-client-js#how-to-get-an-api-token

client.getMember('')
.catch(x => console.error(x.body))
.then(console.log);
shortcut.getCurrentMemberInfo().then((response) => console.log(response?.data));

client.listProjects().then(console.log);
shortcut.listProjects().then((response) => console.log(response?.data));
```

## Play with It

You can play with it in your web browser with this live playground:
You can play with it in your web browser with this live playground:

- [CodeSandbox](https://codesandbox.io/s/clubhouse-lib-playground-r447i)
- [CodeSandbox](https://codesandbox.io/s/useshortcut-client-playground-48kq1)

## Documentation

[Documentation for the REST API](https://clubhouse.io/api/rest).
[Documentation for this client](https://useshortcut.github.io/shortcut-client-js/).

[Documentation for the REST API](https://developer.shortcut.com/api/rest/v3).
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.8'

services:
shortcut-client-js:
container_name: shortcut-client-js
image: node:20
stdin_open: true
tty: true
volumes:
- .:/shortcut-client-js
working_dir: /shortcut-client-js
6 changes: 6 additions & 0 deletions examples/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rules": {
"no-console": 0,
"import/no-extraneous-dependencies": 0
}
}
13 changes: 13 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Examples

This folder contains ready-to-use examples.

## Usage

You will need to set an environment variable with your API Token. See [How to Get an API Token](../README.md#how-to-get-an-api-token).

Then, you can run the file you want with:

```bash
SHORTCUT_API_TOKEN=YOUR_API_TOKEN npx ts-node FILE_EXAMPLE
```
5 changes: 5 additions & 0 deletions examples/getCurrentMemberInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ShortcutClient } from '../src';

const shortcut = new ShortcutClient(process.env.SHORTCUT_API_TOKEN); // See https://github.com/useshortcut/shortcut-client-js#how-to-get-an-api-token

shortcut.getCurrentMemberInfo().then((response) => console.log(response?.data));
5 changes: 5 additions & 0 deletions examples/listProjects.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ShortcutClient } from '../src';

const shortcut = new ShortcutClient(process.env.SHORTCUT_API_TOKEN); // See https://github.com/useshortcut/shortcut-client-js#how-to-get-an-api-token

shortcut.listProjects().then((response) => console.log(response?.data));
Binary file added examples/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading