@oauth2-cli/sky-api 0.5.0 → 0.5.2
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 +14 -0
- package/dist/SkyAPIPlugin.d.ts +6 -7
- package/dist/SkyAPIPlugin.js +22 -13
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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.5.2](https://github.com/groton-school/myschoolapp-reporting/compare/oauth2-cli/sky-api/0.5.1...oauth2-cli/sky-api/0.5.2) (2026-02-19)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* use human-readable API client name ([25a4859](https://github.com/groton-school/myschoolapp-reporting/commit/25a485921d90ad98212a027879205446c4365779))
|
|
11
|
+
|
|
12
|
+
## [0.5.1](https://github.com/groton-school/myschoolapp-reporting/compare/oauth2-cli/sky-api/0.5.0...oauth2-cli/sky-api/0.5.1) (2026-02-18)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* use @oauth2-cli/qui-cli's `Unregistered` namespace ([20a2bae](https://github.com/groton-school/myschoolapp-reporting/commit/20a2bae1a34ae91d20efaaef96f727678cafbda1))
|
|
18
|
+
|
|
5
19
|
## [0.5.0](https://github.com/groton-school/myschoolapp-reporting/compare/oauth2-cli/sky-api/0.4.2...oauth2-cli/sky-api/0.5.0) (2026-02-17)
|
|
6
20
|
|
|
7
21
|
|
package/dist/SkyAPIPlugin.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as OAuth2 from '@oauth2-cli/qui-cli/dist/Export.js';
|
|
1
|
+
import * as OAuth2CLI from '@oauth2-cli/qui-cli/dist/Unregistered.js';
|
|
3
2
|
import * as Plugin from '@qui-cli/plugin';
|
|
4
|
-
type Credentials =
|
|
3
|
+
type Credentials = OAuth2CLI.Credentials & {
|
|
5
4
|
subscription_key: string;
|
|
6
5
|
};
|
|
7
|
-
export type
|
|
6
|
+
export type Configuration = OAuth2CLI.Configuration & {
|
|
8
7
|
credentials?: Partial<Credentials>;
|
|
9
8
|
};
|
|
10
|
-
export declare class SkyAPIPlugin extends OAuth2Plugin {
|
|
9
|
+
export declare class SkyAPIPlugin extends OAuth2CLI.OAuth2Plugin<Credentials, OAuth2CLI.Client<Credentials>> {
|
|
11
10
|
private subscription_key?;
|
|
12
11
|
constructor();
|
|
13
|
-
configure({ credentials, ...options }?:
|
|
12
|
+
configure({ credentials, ...options }?: Configuration): void;
|
|
14
13
|
init(args: Plugin.ExpectedArguments<typeof this.options>): Promise<void>;
|
|
15
|
-
protected instantiateClient(options:
|
|
14
|
+
protected instantiateClient(options: OAuth2CLI.ClientOptions<Credentials>): OAuth2CLI.Client<Credentials>;
|
|
16
15
|
}
|
|
17
16
|
export {};
|
package/dist/SkyAPIPlugin.js
CHANGED
|
@@ -1,41 +1,46 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as OAuth2CLI from '@oauth2-cli/qui-cli/dist/Unregistered.js';
|
|
2
2
|
import { Colors } from '@qui-cli/colors';
|
|
3
3
|
import { Env } from '@qui-cli/env';
|
|
4
4
|
import * as Plugin from '@qui-cli/plugin';
|
|
5
5
|
import * as requestish from 'requestish';
|
|
6
|
-
export class SkyAPIPlugin extends OAuth2Plugin {
|
|
6
|
+
export class SkyAPIPlugin extends OAuth2CLI.OAuth2Plugin {
|
|
7
7
|
subscription_key = undefined;
|
|
8
8
|
constructor() {
|
|
9
|
-
super('
|
|
9
|
+
super('Sky API');
|
|
10
10
|
super.configure({
|
|
11
11
|
credentials: {
|
|
12
12
|
issuer: 'https://oauth2.sky.blackbaud.com'
|
|
13
13
|
},
|
|
14
14
|
base_url: 'https://api.sky.blackbaud.com',
|
|
15
|
-
man: {
|
|
15
|
+
man: {
|
|
16
|
+
heading: 'Sky API options',
|
|
16
17
|
text: [
|
|
17
|
-
`The
|
|
18
|
-
`${Colors.varName('SKY_REFRESH_TOKEN')} environment variable, if ` +
|
|
19
|
-
`present.`,
|
|
20
|
-
`The Sky API subscription access key is read from the ` +
|
|
18
|
+
`The Sky API ${Colors.keyword('subscription_key')} is read from the ` +
|
|
21
19
|
`${Colors.varName('SKY_SUBSCRIPTION_KEY')} environment variable, if ` +
|
|
22
20
|
`present. See ` +
|
|
23
21
|
`${Colors.url('https://developer.blackbaud.com/subscriptions/')} ` +
|
|
24
|
-
`for more information
|
|
22
|
+
`for more information.`,
|
|
23
|
+
`The OAuth 2.0 ${Colors.keyword('refresh_token')} is read from the ` +
|
|
24
|
+
`${Colors.varName('SKY_REFRESH_TOKEN')} environment variable, if ` +
|
|
25
|
+
`present.`
|
|
25
26
|
]
|
|
26
27
|
},
|
|
28
|
+
url: {
|
|
29
|
+
client_id: 'https://developer.blackbaud.com/apps/'
|
|
30
|
+
},
|
|
27
31
|
env: {
|
|
28
32
|
client_id: 'SKY_CLIENT_ID',
|
|
29
33
|
client_secret: 'SKY_CLIENT_SECRET',
|
|
30
34
|
scope: 'SKY_SCOPE',
|
|
31
|
-
redirect_uri: 'SKY_REDIRECT_URI'
|
|
35
|
+
redirect_uri: 'SKY_REDIRECT_URI'
|
|
32
36
|
},
|
|
33
37
|
suppress: {
|
|
34
38
|
issuer: true,
|
|
35
39
|
authorization_endpoint: true,
|
|
36
40
|
token_endpoint: true,
|
|
41
|
+
base_url: true
|
|
37
42
|
},
|
|
38
|
-
storage: new Token.EnvironmentStorage('SKY_REFRESH_TOKEN')
|
|
43
|
+
storage: new OAuth2CLI.Token.EnvironmentStorage('SKY_REFRESH_TOKEN')
|
|
39
44
|
});
|
|
40
45
|
}
|
|
41
46
|
configure({ credentials, ...options } = {}) {
|
|
@@ -45,7 +50,11 @@ export class SkyAPIPlugin extends OAuth2Plugin {
|
|
|
45
50
|
}
|
|
46
51
|
async init(args) {
|
|
47
52
|
await super.init(args);
|
|
48
|
-
this.configure({
|
|
53
|
+
this.configure({
|
|
54
|
+
credentials: {
|
|
55
|
+
subscription_key: await Env.get({ key: 'SKY_SUBSCRIPTION_KEY' })
|
|
56
|
+
}
|
|
57
|
+
});
|
|
49
58
|
}
|
|
50
59
|
instantiateClient(options) {
|
|
51
60
|
if (!this.subscription_key) {
|
|
@@ -55,7 +64,7 @@ export class SkyAPIPlugin extends OAuth2Plugin {
|
|
|
55
64
|
headers = requestish.Headers.merge(headers, {
|
|
56
65
|
'Bb-Api-Subscription-Key': this.subscription_key
|
|
57
66
|
});
|
|
58
|
-
return new Client({
|
|
67
|
+
return new OAuth2CLI.Client({
|
|
59
68
|
...options,
|
|
60
69
|
inject: {
|
|
61
70
|
headers
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { register } from '@qui-cli/plugin';
|
|
2
2
|
import { client } from './SkyAPI.js';
|
|
3
3
|
export * as SkyAPI from './SkyAPI.js';
|
|
4
|
-
export * from './SkyAPIPlugin.js';
|
|
5
|
-
export * from '@oauth2-cli/qui-cli/dist/Export.js';
|
|
6
|
-
export { Token, Client } from '@oauth2-cli/qui-cli/dist/Extend.js';
|
|
7
4
|
await register(client);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oauth2-cli/sky-api",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"blackbaud",
|
|
6
6
|
"sky",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"main": "./dist/index.js",
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@oauth2-cli/qui-cli": "^0.7.
|
|
25
|
+
"@oauth2-cli/qui-cli": "^0.7.7",
|
|
26
26
|
"node-fetch": "^3.3.2",
|
|
27
27
|
"requestish": "^0.1.1"
|
|
28
28
|
},
|