@oauth2-cli/sky-api 0.4.0 → 0.4.1
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 +7 -0
- package/dist/Client.d.ts +9 -0
- package/dist/Client.js +13 -0
- package/dist/Module.d.ts +3 -3
- package/dist/Module.js +3 -3
- package/dist/SkyAPI.d.ts +6 -5
- package/dist/SkyAPI.js +15 -3
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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.4.1](https://github.com/groton-school/myschoolapp-reporting/compare/oauth2-cli/sky-api/0.4.0...oauth2-cli/sky-api/0.4.1) (2026-01-15)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* further reorg of internals ([adc4330](https://github.com/groton-school/myschoolapp-reporting/commit/adc4330a346c7547be2e702730e2bcb510873b4c))
|
|
11
|
+
|
|
5
12
|
## [0.4.0](https://github.com/groton-school/myschoolapp-reporting/compare/oauth2-cli/sky-api/0.3.2...oauth2-cli/sky-api/0.4.0) (2026-01-15)
|
|
6
13
|
|
|
7
14
|
|
package/dist/Client.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as OAuth2 from '@oauth2-cli/qui-cli/dist/OAuth2.js';
|
|
2
|
+
export type Credentials = OAuth2.Credentials & {
|
|
3
|
+
subscription_key: string;
|
|
4
|
+
};
|
|
5
|
+
export declare class Client extends OAuth2.Client {
|
|
6
|
+
private subscription_key;
|
|
7
|
+
constructor({ subscription_key, ...credentials }: Credentials);
|
|
8
|
+
request(...args: Parameters<OAuth2.Client['request']>): Promise<Response>;
|
|
9
|
+
}
|
package/dist/Client.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as OAuth2 from '@oauth2-cli/qui-cli/dist/OAuth2.js';
|
|
2
|
+
export class Client extends OAuth2.Client {
|
|
3
|
+
subscription_key;
|
|
4
|
+
constructor({ subscription_key, ...credentials }) {
|
|
5
|
+
super(credentials);
|
|
6
|
+
this.subscription_key = subscription_key;
|
|
7
|
+
}
|
|
8
|
+
request(...args) {
|
|
9
|
+
const [url, method, body, headers = new Headers(), dPoPOptions] = args;
|
|
10
|
+
headers.set('Bb-Api-Subscription-Key', this.subscription_key);
|
|
11
|
+
return super.request(url, method, body, headers, dPoPOptions);
|
|
12
|
+
}
|
|
13
|
+
}
|
package/dist/Module.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SkyAPIPlugin } from './SkyAPI.js';
|
|
2
|
+
export * from './SkyAPI.js';
|
|
3
|
+
declare const sky: SkyAPIPlugin;
|
|
3
4
|
export declare const name: string;
|
|
4
5
|
export declare const configure: ({ subscription_key, subscriptionKeyEnvVar, ...proposal }?: import("./SkyAPI.js").ConfigurationProposal) => void;
|
|
5
6
|
export declare const options: () => import("@qui-cli/plugin").Options;
|
|
6
7
|
export declare const init: ({ values }: import("@qui-cli/plugin").ExpectedArguments<typeof this.options>) => Promise<void>;
|
|
7
|
-
export * as school from './school/index.js';
|
|
8
8
|
export declare const getToken: typeof sky.getToken;
|
|
9
9
|
export declare const getClient: typeof sky.getClient;
|
|
10
10
|
export declare const request: typeof sky.request;
|
package/dist/Module.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SkyAPIPlugin } from './SkyAPI.js';
|
|
2
|
+
export * from './SkyAPI.js';
|
|
3
|
+
const sky = new SkyAPIPlugin();
|
|
3
4
|
export const name = sky.name;
|
|
4
5
|
export const configure = sky.configure.bind(sky);
|
|
5
6
|
export const options = sky.options.bind(sky);
|
|
6
7
|
export const init = sky.init.bind(sky);
|
|
7
|
-
export * as school from './school/index.js';
|
|
8
8
|
export const getToken = sky.getToken.bind(sky);
|
|
9
9
|
export const getClient = sky.getClient.bind(sky);
|
|
10
10
|
export const request = sky.request.bind(sky);
|
package/dist/SkyAPI.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import * as OAuth2 from '@oauth2-cli/qui-cli/dist/OAuth2.js';
|
|
2
2
|
import * as Plugin from '@qui-cli/plugin';
|
|
3
|
+
import { Client } from './Client.js';
|
|
4
|
+
export { EnvironmentStorage, FileStorage, TokenStorage } from '@oauth2-cli/qui-cli/dist/OAuth2.js';
|
|
5
|
+
export * from './Client.js';
|
|
6
|
+
export * as school from './school/index.js';
|
|
3
7
|
type SkyConfiguration = {
|
|
4
8
|
subscription_key?: string;
|
|
5
9
|
subscriptionKeyEnvVar: string;
|
|
6
10
|
};
|
|
7
|
-
export type Credentials = OAuth2.Credentials & {
|
|
8
|
-
subscription_key: string;
|
|
9
|
-
};
|
|
10
11
|
export type Configuration = OAuth2.Configuration & SkyConfiguration;
|
|
11
12
|
export type ConfigurationProposal = OAuth2.ConfigurationProposal & Partial<SkyConfiguration>;
|
|
12
|
-
export declare class
|
|
13
|
+
export declare class SkyAPIPlugin extends OAuth2.OAuth2Plugin<Client> {
|
|
13
14
|
private skyConfig;
|
|
14
15
|
constructor(name?: string);
|
|
15
16
|
configure({ subscription_key, subscriptionKeyEnvVar, ...proposal }?: ConfigurationProposal): void;
|
|
16
17
|
options(): Plugin.Options;
|
|
17
18
|
init({ values }: Plugin.ExpectedArguments<typeof this.options>): Promise<void>;
|
|
19
|
+
protected instantiateClient(credentials: OAuth2.Credentials): Client;
|
|
18
20
|
}
|
|
19
|
-
export {};
|
package/dist/SkyAPI.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as OAuth2 from '@oauth2-cli/qui-cli/dist/OAuth2.js';
|
|
2
2
|
import { Colors } from '@qui-cli/colors';
|
|
3
3
|
import { Env } from '@qui-cli/env-1password';
|
|
4
|
-
|
|
4
|
+
import { Client } from './Client.js';
|
|
5
|
+
export { EnvironmentStorage, FileStorage } from '@oauth2-cli/qui-cli/dist/OAuth2.js';
|
|
6
|
+
export * from './Client.js';
|
|
7
|
+
export * as school from './school/index.js';
|
|
8
|
+
export class SkyAPIPlugin extends OAuth2.OAuth2Plugin {
|
|
5
9
|
skyConfig = {
|
|
6
10
|
subscriptionKeyEnvVar: 'SKY_SUBSCRIPTION_KEY'
|
|
7
11
|
};
|
|
@@ -58,8 +62,16 @@ export class SkyAPI extends OAuth2.OAuth2 {
|
|
|
58
62
|
}) } = values;
|
|
59
63
|
this.configure({
|
|
60
64
|
subscription_key,
|
|
61
|
-
...values
|
|
62
|
-
|
|
65
|
+
...values
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
instantiateClient(credentials) {
|
|
69
|
+
if (!this.skyConfig.subscription_key) {
|
|
70
|
+
throw new Error('No subscription access key is defined.');
|
|
71
|
+
}
|
|
72
|
+
return new Client({
|
|
73
|
+
subscription_key: this.skyConfig.subscription_key,
|
|
74
|
+
...credentials
|
|
63
75
|
});
|
|
64
76
|
}
|
|
65
77
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oauth2-cli/sky-api",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"blackbaud",
|
|
6
6
|
"sky",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"main": "./dist/index.js",
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@oauth2-cli/qui-cli": "^0.5.6",
|
|
25
26
|
"node-fetch": "^3.3.2",
|
|
26
27
|
"oauth2-cli": "^0.2.3"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@battis/descriptive-types": "^0.2.6",
|
|
30
31
|
"@battis/typescript-tricks": "^0.7.6",
|
|
31
|
-
"@
|
|
32
|
-
"@qui-cli/colors": "^3.2.1",
|
|
32
|
+
"@qui-cli/colors": "^3.2.2",
|
|
33
33
|
"@qui-cli/env-1password": "^1.2.6",
|
|
34
34
|
"@qui-cli/plugin": "^4.0.0",
|
|
35
35
|
"@tsconfig/node24": "^24.0.3",
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
"typescript": "^5.9.3"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@oauth2-cli/qui-cli": ">=0.5",
|
|
43
42
|
"@qui-cli/plugin": ">=3"
|
|
44
43
|
},
|
|
45
44
|
"scripts": {
|
|
@@ -47,6 +46,6 @@
|
|
|
47
46
|
"build": "run-s build:*",
|
|
48
47
|
"build:clean": "run-s clean",
|
|
49
48
|
"build:compile": "tsc",
|
|
50
|
-
"
|
|
49
|
+
"version": "commit-and-tag-version"
|
|
51
50
|
}
|
|
52
51
|
}
|