@useshortcut/client 1.1.0 → 2.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Shortcut
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,55 +1,37 @@
1
- <p align="center">
2
- <img height="60" src="https://github.com/useshortcut/shortcut-client-js/assets/739719/b1a2efa0-6de1-4bc4-8525-563c53a9b2ba" alt="Shortcut" />
3
- </p>
4
-
5
- <h3 align="center">
6
- @shortcut/client
7
- </h3>
8
-
9
- <p align="center">
10
- A library for interacting with the Shortcut REST API.
11
- </p>
12
-
13
- <p align="center">
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
- </a>
17
- <a href="https://circleci.com/gh/useshortcut/shortcut-client-js">
18
- <img src="https://circleci.com/gh/useshortcut/shortcut-client-js.svg?style=shield" alt="Current CircleCI build status." />
19
- </a>
20
- <a href="https://circleci.com/gh/useshortcut/shortcut-client-js">
21
- <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" />
22
- </a>
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@shortcut" alt="Follow @shortcut" />
25
- </a>
26
- </p>
27
-
28
- <br>
1
+ # @shortcut/client
29
2
 
30
- ## Getting Started
3
+ <img height="125" src="https://github.com/user-attachments/assets/7c3d3b8e-6252-4790-81cd-6640cd46a2d6" alt="Shortcut's logo" align="right">
31
4
 
32
- ### Installation
5
+ [![Version](https://badge.fury.io/js/@shortcut%2Fclient.svg)](https://badge.fury.io/js/@shortcut%2Fclient)
6
+ [![Monthly Downloads](https://img.shields.io/npm/dm/@shortcut%2Fclient)](https://www.npmjs.org/package/@shortcut%2Fclient)
7
+ [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/useshortcut/shortcut-client-js/blob/main/LICENSE)
8
+ [![PRs welcome!](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)]()
9
+ [![X](https://img.shields.io/twitter/follow/shortcut.svg?label=Follow%20@shortcut)](https://twitter.com/intent/follow?screen_name=shortcut)
33
10
 
34
- You can install `@shortcut/client` with [NPM](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com).
11
+ A library for interacting with the Shortcut REST API.
35
12
 
36
- ```shell
37
- npm install --save @shortcut/client
38
- ```
13
+ <br />
14
+
15
+ ## Getting Started
39
16
 
40
- or
17
+ ### Installation
41
18
 
42
19
  ```shell
43
- yarn add @shortcut/client
20
+ npm install @shortcut/client
44
21
  ```
45
22
 
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.
23
+ > [!IMPORTANT]
24
+ > Our legacy npm organization namespace is `@useshortcut`.
25
+ >
26
+ > While it will still contain copies of all future released package versions, we **strongly** recommend switching to our primary `@shortcut` organization namespace.
47
27
 
48
28
  ### How to Get an API Token
49
29
 
50
30
  The Shortcut API uses token-based authentication, you will need one to use this library.
51
31
 
52
- 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:
32
+ To generate an API token, go to https://app.shortcut.com/settings/account/api-tokens.
33
+
34
+ To make it easier to explore our API, we recommend saving this token as an environment variable in your local dev environment:
53
35
 
54
36
  ```bash
55
37
  export SHORTCUT_API_TOKEN="YOUR API TOKEN HERE"
@@ -57,7 +39,18 @@ export SHORTCUT_API_TOKEN="YOUR API TOKEN HERE"
57
39
 
58
40
  This will allow you to copy and paste many examples in the documentation to try them out.
59
41
 
60
- 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.
42
+ > [!NOTE]
43
+ > Requests made with a missing or invalid token will get a `401 Unauthorized` response.
44
+
45
+ > [!NOTE]
46
+ > All requests must be made over HTTPS.
47
+
48
+ > [!CAUTION]
49
+ > Tokens provide complete access to your Shortcut account, **so keep them secure**.
50
+ >
51
+ > Don’t paste them into your source code, use an environment variable instead.
52
+ >
53
+ > For security reasons, we will immediately invalidate any tokens we find have been made public.
61
54
 
62
55
  ## Usage
63
56
 
@@ -0,0 +1,10 @@
1
+ import { Api } from './generated/Api.mjs';
2
+ import { ApiConfig } from './generated/http-client.mjs';
3
+ import './generated/data-contracts.mjs';
4
+ import 'axios';
5
+
6
+ declare class ShortcutClient<SecurityDataType = unknown> extends Api<SecurityDataType> {
7
+ constructor(apiToken: string, config?: ApiConfig<SecurityDataType>);
8
+ }
9
+
10
+ export { ShortcutClient };
@@ -1,5 +1,10 @@
1
- import { Api } from './generated/Api';
2
- import type { ApiConfig } from './generated/http-client';
3
- export declare class ShortcutClient<SecurityDataType = unknown> extends Api<SecurityDataType> {
1
+ import { Api } from './generated/Api.js';
2
+ import { ApiConfig } from './generated/http-client.js';
3
+ import './generated/data-contracts.js';
4
+ import 'axios';
5
+
6
+ declare class ShortcutClient<SecurityDataType = unknown> extends Api<SecurityDataType> {
4
7
  constructor(apiToken: string, config?: ApiConfig<SecurityDataType>);
5
8
  }
9
+
10
+ export { ShortcutClient };