@oauth2-cli/sky-api 0.1.2 → 0.2.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/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [0.2.0](https://github.com/battis/oauth2-cli/compare/sky-api/0.1.2...sky-api/0.2.0) (2025-03-09)
6
+
7
+ ### Features
8
+
9
+ - **oauth2-cli:** detect and warn about reused localhost ports ([3431d84](https://github.com/battis/oauth2-cli/commit/3431d84d47251dd9fba47b23bbfd3dcf653fc7d3))
10
+
11
+ ### Bug Fixes
12
+
13
+ - **sky-api:** limit excess subscription key copying ([e8a76c8](https://github.com/battis/oauth2-cli/commit/e8a76c814fe9bcbfb7de0ce3b40f7373b3e9787d))
14
+ - **oauth2-configure:** remove redundant caching ([7294e6a](https://github.com/battis/oauth2-cli/commit/7294e6a7aec373f72abc7c9e7c2ce4c659e3cba5))
15
+
5
16
  ## [0.1.2](https://github.com/battis/oauth2-cli/compare/sky-api/0.1.1...sky-api/0.1.2) (2025-03-08)
6
17
 
7
18
  ### Features
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # sky-oauth2-cli
1
+ # @oauth2-cli/sky-api
2
2
 
3
3
  Acquire SKY API access tokens via OAuth 2.0 within CLI tools
4
4
 
5
5
  ## Install
6
6
 
7
7
  ```sh
8
- npm i sky-oauth2-cli
8
+ npm i @oauth2-cli/sky-api
9
9
  ```
10
10
 
11
11
  ## Usage
@@ -14,7 +14,7 @@ Configure your SKY API app credentials somewhere relatively secure (e.g. your en
14
14
 
15
15
  ```ts
16
16
  import dotenv from 'dotenv';
17
- import { SkyAPI } from 'sky-oauth2-cli';
17
+ import { SkyAPI } from '@oauth2-cli/sky-api';
18
18
 
19
19
  (async () => {
20
20
  dotenv.config();
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export declare class SkyAPI {
7
7
  private client;
8
8
  private token?;
9
9
  private subscription_key;
10
- constructor(credentials: Credentials);
10
+ constructor({ subscription_key, ...credentials }: Credentials);
11
11
  getToken(): Promise<OAuth2.Token | undefined>;
12
12
  fetch(endpoint: URL | RequestInfo, init?: RequestInit): Promise<unknown>;
13
13
  }
package/dist/index.js CHANGED
@@ -6,14 +6,14 @@ export class SkyAPI {
6
6
  client;
7
7
  token;
8
8
  subscription_key;
9
- constructor(credentials) {
9
+ constructor({ subscription_key, ...credentials }) {
10
+ this.subscription_key = subscription_key;
10
11
  this.client = new OAuth2.Client({
11
12
  ...credentials,
12
13
  authorization_endpoint: 'https://app.blackbaud.com/oauth/authorize',
13
14
  token_endpoint: 'https://oauth2.sky.blackbaud.com/token',
14
- headers: { [SUBSCRIPTION_HEADER]: credentials.subscription_key }
15
+ headers: { [SUBSCRIPTION_HEADER]: this.subscription_key }
15
16
  });
16
- this.subscription_key = credentials.subscription_key;
17
17
  }
18
18
  async getToken() {
19
19
  this.token = await this.client.getToken();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oauth2-cli/sky-api",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "keywords": [
5
5
  "blackbaud",
6
6
  "sky",
@@ -23,7 +23,7 @@
23
23
  "types": "./dist/index.d.ts",
24
24
  "dependencies": {
25
25
  "node-fetch": "^3.3.2",
26
- "oauth2-cli": "0.1.6"
26
+ "oauth2-cli": "0.2.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@tsconfig/node20": "^20.1.4",
package/src/index.ts CHANGED
@@ -16,14 +16,14 @@ export class SkyAPI {
16
16
  private token?: OAuth2.Token;
17
17
  private subscription_key: string;
18
18
 
19
- public constructor(credentials: Credentials) {
19
+ public constructor({ subscription_key, ...credentials }: Credentials) {
20
+ this.subscription_key = subscription_key;
20
21
  this.client = new OAuth2.Client({
21
22
  ...credentials,
22
23
  authorization_endpoint: 'https://app.blackbaud.com/oauth/authorize',
23
24
  token_endpoint: 'https://oauth2.sky.blackbaud.com/token',
24
- headers: { [SUBSCRIPTION_HEADER]: credentials.subscription_key }
25
+ headers: { [SUBSCRIPTION_HEADER]: this.subscription_key }
25
26
  });
26
- this.subscription_key = credentials.subscription_key;
27
27
  }
28
28
 
29
29
  public async getToken() {