@useshortcut/client 1.0.0-beta.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,18 +1,18 @@
1
1
  <p align="center">
2
- <img height="60" src="https://user-images.githubusercontent.com/7189823/133838642-9a05e1ec-9a79-46ae-b22e-a8b931caf233.png" alt="Shortcut logo">
2
+ <img height="60" src="https://github.com/useshortcut/shortcut-client-js/assets/739719/b1a2efa0-6de1-4bc4-8525-563c53a9b2ba" alt="Shortcut" />
3
3
  </p>
4
4
 
5
5
  <h3 align="center">
6
- @useshortcut/client
6
+ @shortcut/client
7
7
  </h3>
8
8
 
9
9
  <p align="center">
10
- A library for interacting with the Shortcut (formerly Clubhouse) REST API
10
+ A library for interacting with the Shortcut REST API.
11
11
  </p>
12
12
 
13
13
  <p align="center">
14
- <a href="https://www.npmjs.org/package/@useshortcut/client">
15
- <img src="https://badge.fury.io/js/@useshortcut/client.svg" alt="Current npm package version." />
14
+ <a href="https://www.npmjs.org/package/@shortcut/client">
15
+ <img src="https://badge.fury.io/js/@shortcut%2Fclient.svg" alt="Current npm package version." />
16
16
  </a>
17
17
  <a href="https://circleci.com/gh/useshortcut/shortcut-client-js">
18
18
  <img src="https://circleci.com/gh/useshortcut/shortcut-client-js.svg?style=shield" alt="Current CircleCI build status." />
@@ -21,7 +21,7 @@
21
21
  <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" />
22
22
  </a>
23
23
  <a href="https://twitter.com/intent/follow?screen_name=useshortcut">
24
- <img src="https://img.shields.io/twitter/follow/useshortcut.svg?label=Follow%20@useshortcut" alt="Follow @useshortcut" />
24
+ <img src="https://img.shields.io/twitter/follow/useshortcut.svg?label=Follow%20@shortcut" alt="Follow @shortcut" />
25
25
  </a>
26
26
  </p>
27
27
 
@@ -31,18 +31,20 @@
31
31
 
32
32
  ### Installation
33
33
 
34
- You can install `@useshortcut/client` with [NPM](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com).
34
+ You can install `@shortcut/client` with [NPM](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com).
35
35
 
36
36
  ```shell
37
- npm install --save @useshortcut/client
37
+ npm install --save @shortcut/client
38
38
  ```
39
39
 
40
40
  or
41
41
 
42
42
  ```shell
43
- yarn add @useshortcut/client
43
+ yarn add @shortcut/client
44
44
  ```
45
45
 
46
+ > 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.
47
+
46
48
  ### How to Get an API Token
47
49
 
48
50
  The Shortcut API uses token-based authentication, you will need one to use this library.
@@ -59,9 +61,11 @@ Requests made with a missing or invalid token will get a `401 Unauthorized` resp
59
61
 
60
62
  ## Usage
61
63
 
64
+ 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.
65
+
62
66
  ```javascript
63
- import { ShortcutClient } from '@useshortcut/client';
64
- // const { ShortcutClient } = require('@useshortcut/client');
67
+ import { ShortcutClient } from '@shortcut/client';
68
+ // const { ShortcutClient } = require('@shortcut/client');
65
69
 
66
70
  const shortcut = new ShortcutClient('YOUR_API_TOKEN'); // See https://github.com/useshortcut/shortcut-client-js#how-to-get-an-api-token
67
71
 
@@ -72,10 +76,12 @@ shortcut.listProjects().then((response) => console.log(response?.data));
72
76
 
73
77
  ## Play with It
74
78
 
75
- You can play with it in your web browser with this live playground:
79
+ You can play with it in your web browser with this live playground:
76
80
 
77
81
  - [CodeSandbox](https://codesandbox.io/s/useshortcut-client-playground-48kq1)
78
82
 
79
83
  ## Documentation
80
84
 
81
- [Documentation for the REST API](https://shortcut.com/api/rest).
85
+ [Documentation for this client](https://useshortcut.github.io/shortcut-client-js/).
86
+
87
+ [Documentation for the REST API](https://developer.shortcut.com/api/rest/v3).
@@ -1,45 +1,14 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
2
  Object.defineProperty(exports, "__esModule", { value: true });
29
3
  exports.ShortcutClient = void 0;
30
- var Api_1 = require("./generated/Api");
31
- var ShortcutClient = /** @class */ (function (_super) {
32
- __extends(ShortcutClient, _super);
33
- function ShortcutClient(apiToken, config) {
34
- if (config === void 0) { config = {}; }
35
- var _this = this;
4
+ const Api_1 = require("./generated/Api");
5
+ class ShortcutClient extends Api_1.Api {
6
+ constructor(apiToken, config = {}) {
36
7
  if (apiToken == null || typeof apiToken !== 'string') {
37
8
  // eslint-disable-next-line no-console
38
9
  console.error('You need to supply an API Token.');
39
10
  }
40
- _this = _super.call(this, __assign({ headers: __assign({ 'Shortcut-Token': apiToken }, config.headers) }, config)) || this;
41
- return _this;
11
+ super(Object.assign({ headers: Object.assign({ 'Shortcut-Token': apiToken }, config.headers) }, config));
42
12
  }
43
- return ShortcutClient;
44
- }(Api_1.Api));
13
+ }
45
14
  exports.ShortcutClient = ShortcutClient;