@oauth2-cli/sky-api 0.4.2 → 0.5.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 +18 -0
- package/dist/Paginated.js +2 -2
- package/dist/SkyAPI.d.ts +2 -19
- package/dist/SkyAPI.js +2 -78
- package/dist/SkyAPIPlugin.d.ts +16 -0
- package/dist/SkyAPIPlugin.js +74 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +3 -3
- package/dist/school/v1/academics/sections/assignments/assignmentsBySection.d.ts +2 -2
- package/dist/school/v1/academics/sections/assignments/assignmentsBySection.js +2 -2
- package/dist/school/v1/contentmanagement/announcements/index.d.ts +4 -3
- package/dist/school/v1/contentmanagement/announcements/index.js +3 -3
- package/dist/school/v1/contentmanagement/news/index.d.ts +4 -3
- package/dist/school/v1/contentmanagement/news/index.js +3 -3
- package/dist/school/v1/contentmanagement/photoalbums/index.d.ts +6 -4
- package/dist/school/v1/contentmanagement/photoalbums/index.js +4 -4
- package/package.json +8 -7
- package/dist/Client.d.ts +0 -9
- package/dist/Client.js +0 -13
- package/dist/Credentials.d.ts +0 -4
- package/dist/Credentials.js +0 -1
- package/dist/Module.d.ts +0 -13
- package/dist/Module.js +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
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.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)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* use @oauth2-cli/qui-cli's `Unregistered` namespace ([20a2bae](https://github.com/groton-school/myschoolapp-reporting/commit/20a2bae1a34ae91d20efaaef96f727678cafbda1))
|
|
11
|
+
|
|
12
|
+
## [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)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### ⚠ BREAKING CHANGES
|
|
16
|
+
|
|
17
|
+
* update to @oauth2-cli/qui-cli
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* update to @oauth2-cli/qui-cli ([2240c56](https://github.com/groton-school/myschoolapp-reporting/commit/2240c5653e9e4af08e71036264735c47b68936d3))
|
|
22
|
+
|
|
5
23
|
## [0.4.2](https://github.com/groton-school/myschoolapp-reporting/compare/oauth2-cli/sky-api/0.4.1...oauth2-cli/sky-api/0.4.2) (2026-01-17)
|
|
6
24
|
|
|
7
25
|
|
package/dist/Paginated.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { client } from './SkyAPI.js';
|
|
2
2
|
export class Paginated {
|
|
3
3
|
data;
|
|
4
4
|
constructor(data) {
|
|
@@ -10,7 +10,7 @@ export class Paginated {
|
|
|
10
10
|
return {
|
|
11
11
|
next: async () => {
|
|
12
12
|
if (index === data.value?.length && data.next_link) {
|
|
13
|
-
data = await
|
|
13
|
+
data = await client.requestJSON(data.next_link);
|
|
14
14
|
index = 0;
|
|
15
15
|
}
|
|
16
16
|
if (data.value && index < data.value.length) {
|
package/dist/SkyAPI.d.ts
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
import
|
|
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';
|
|
1
|
+
import { SkyAPIPlugin } from './SkyAPIPlugin.js';
|
|
6
2
|
export * as school from './school/index.js';
|
|
7
|
-
|
|
8
|
-
subscription_key?: string;
|
|
9
|
-
subscriptionKeyEnvVar: string;
|
|
10
|
-
};
|
|
11
|
-
export type Configuration = OAuth2.Configuration & SkyConfiguration;
|
|
12
|
-
export type ConfigurationProposal = OAuth2.ConfigurationProposal & Partial<SkyConfiguration>;
|
|
13
|
-
export declare class SkyAPIPlugin extends OAuth2.OAuth2Plugin<Client> {
|
|
14
|
-
private skyConfig;
|
|
15
|
-
constructor(name?: string);
|
|
16
|
-
configure({ subscription_key, subscriptionKeyEnvVar, ...proposal }?: ConfigurationProposal): void;
|
|
17
|
-
options(): Plugin.Options;
|
|
18
|
-
init({ values }: Plugin.ExpectedArguments<typeof this.options>): Promise<void>;
|
|
19
|
-
protected instantiateClient(credentials: OAuth2.Credentials): Client;
|
|
20
|
-
}
|
|
3
|
+
export declare const client: SkyAPIPlugin;
|
package/dist/SkyAPI.js
CHANGED
|
@@ -1,79 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Colors } from '@qui-cli/colors';
|
|
3
|
-
import { Env } from '@qui-cli/env-1password';
|
|
4
|
-
import { Client } from './Client.js';
|
|
5
|
-
export { EnvironmentStorage, FileStorage } from '@oauth2-cli/qui-cli/dist/OAuth2.js';
|
|
6
|
-
export * from './Client.js';
|
|
1
|
+
import { SkyAPIPlugin } from './SkyAPIPlugin.js';
|
|
7
2
|
export * as school from './school/index.js';
|
|
8
|
-
export
|
|
9
|
-
skyConfig = {
|
|
10
|
-
subscriptionKeyEnvVar: 'SKY_SUBSCRIPTION_KEY'
|
|
11
|
-
};
|
|
12
|
-
constructor(name = '@oauth2-cli/sky-api') {
|
|
13
|
-
super(name);
|
|
14
|
-
super.configure({
|
|
15
|
-
authorization_endpoint: 'https://app.blackbaud.com/oauth/authorize',
|
|
16
|
-
token_endpoint: 'https://oauth2.sky.blackbaud.com/token',
|
|
17
|
-
opt: {
|
|
18
|
-
clientId: 'skyClientId',
|
|
19
|
-
clientSecret: 'skyClientSecret',
|
|
20
|
-
scope: 'skyScope',
|
|
21
|
-
redirectUri: 'skyRedirectUri'
|
|
22
|
-
},
|
|
23
|
-
env: {
|
|
24
|
-
clientId: 'SKY_CLIENT_ID',
|
|
25
|
-
clientSecret: 'SKY_CLIENT_SECRET',
|
|
26
|
-
scope: 'SKY_SCOPE',
|
|
27
|
-
redirectUri: 'SKY_REDIRECT_URI',
|
|
28
|
-
tokenPath: 'SKY_TOKEN_PATH',
|
|
29
|
-
accessToken: 'SKY_ACCESS_TOKEN'
|
|
30
|
-
},
|
|
31
|
-
man: { heading: 'Sky API options' },
|
|
32
|
-
suppress: {
|
|
33
|
-
authorizationEndpoint: true,
|
|
34
|
-
tokenEndpoint: true,
|
|
35
|
-
tokenPath: true,
|
|
36
|
-
accessToken: true
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
configure({ subscription_key, subscriptionKeyEnvVar, ...proposal } = {}) {
|
|
41
|
-
super.configure(proposal);
|
|
42
|
-
this.skyConfig.subscription_key =
|
|
43
|
-
subscription_key || this.skyConfig.subscription_key;
|
|
44
|
-
this.skyConfig.subscriptionKeyEnvVar =
|
|
45
|
-
subscriptionKeyEnvVar || this.skyConfig.subscriptionKeyEnvVar;
|
|
46
|
-
}
|
|
47
|
-
options() {
|
|
48
|
-
const options = super.options();
|
|
49
|
-
options.opt = {
|
|
50
|
-
...options.opt,
|
|
51
|
-
subscriptionKey: {
|
|
52
|
-
description: `Blackbaud subscription access key; will use environment ` +
|
|
53
|
-
`variable ${Colors.varName(this.skyConfig.subscriptionKeyEnvVar)} ` +
|
|
54
|
-
`if present`,
|
|
55
|
-
secret: true,
|
|
56
|
-
default: this.skyConfig.subscription_key
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
return options;
|
|
60
|
-
}
|
|
61
|
-
async init({ values }) {
|
|
62
|
-
const { subscriptionKey: subscription_key = await Env.get({
|
|
63
|
-
key: this.skyConfig.subscriptionKeyEnvVar
|
|
64
|
-
}) } = values;
|
|
65
|
-
this.configure({
|
|
66
|
-
subscription_key,
|
|
67
|
-
...values
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
instantiateClient(credentials) {
|
|
71
|
-
if (!this.skyConfig.subscription_key) {
|
|
72
|
-
throw new Error('No subscription access key is defined.');
|
|
73
|
-
}
|
|
74
|
-
return new Client({
|
|
75
|
-
subscription_key: this.skyConfig.subscription_key,
|
|
76
|
-
...credentials
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
3
|
+
export const client = new SkyAPIPlugin();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as OAuth2CLI from '@oauth2-cli/qui-cli/dist/Unregistered.js';
|
|
2
|
+
import * as Plugin from '@qui-cli/plugin';
|
|
3
|
+
type Credentials = OAuth2CLI.Credentials & {
|
|
4
|
+
subscription_key: string;
|
|
5
|
+
};
|
|
6
|
+
export type Configuration = OAuth2CLI.Configuration & {
|
|
7
|
+
credentials?: Partial<Credentials>;
|
|
8
|
+
};
|
|
9
|
+
export declare class SkyAPIPlugin extends OAuth2CLI.OAuth2Plugin<Credentials, OAuth2CLI.Client<Credentials>> {
|
|
10
|
+
private subscription_key?;
|
|
11
|
+
constructor();
|
|
12
|
+
configure({ credentials, ...options }?: Configuration): void;
|
|
13
|
+
init(args: Plugin.ExpectedArguments<typeof this.options>): Promise<void>;
|
|
14
|
+
protected instantiateClient(options: OAuth2CLI.ClientOptions<Credentials>): OAuth2CLI.Client<Credentials>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as OAuth2CLI from '@oauth2-cli/qui-cli/dist/Unregistered.js';
|
|
2
|
+
import { Colors } from '@qui-cli/colors';
|
|
3
|
+
import { Env } from '@qui-cli/env';
|
|
4
|
+
import * as Plugin from '@qui-cli/plugin';
|
|
5
|
+
import * as requestish from 'requestish';
|
|
6
|
+
export class SkyAPIPlugin extends OAuth2CLI.OAuth2Plugin {
|
|
7
|
+
subscription_key = undefined;
|
|
8
|
+
constructor() {
|
|
9
|
+
super('@oauth2-cli/sky-api');
|
|
10
|
+
super.configure({
|
|
11
|
+
credentials: {
|
|
12
|
+
issuer: 'https://oauth2.sky.blackbaud.com'
|
|
13
|
+
},
|
|
14
|
+
base_url: 'https://api.sky.blackbaud.com',
|
|
15
|
+
man: {
|
|
16
|
+
heading: 'Sky API options',
|
|
17
|
+
text: [
|
|
18
|
+
`The Sky API ${Colors.keyword('subscription_key')} is read from the ` +
|
|
19
|
+
`${Colors.varName('SKY_SUBSCRIPTION_KEY')} environment variable, if ` +
|
|
20
|
+
`present. See ` +
|
|
21
|
+
`${Colors.url('https://developer.blackbaud.com/subscriptions/')} ` +
|
|
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.`
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
url: {
|
|
29
|
+
client_id: 'https://developer.blackbaud.com/apps/'
|
|
30
|
+
},
|
|
31
|
+
env: {
|
|
32
|
+
client_id: 'SKY_CLIENT_ID',
|
|
33
|
+
client_secret: 'SKY_CLIENT_SECRET',
|
|
34
|
+
scope: 'SKY_SCOPE',
|
|
35
|
+
redirect_uri: 'SKY_REDIRECT_URI'
|
|
36
|
+
},
|
|
37
|
+
suppress: {
|
|
38
|
+
issuer: true,
|
|
39
|
+
authorization_endpoint: true,
|
|
40
|
+
token_endpoint: true,
|
|
41
|
+
base_url: true
|
|
42
|
+
},
|
|
43
|
+
storage: new OAuth2CLI.Token.EnvironmentStorage('SKY_REFRESH_TOKEN')
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
configure({ credentials, ...options } = {}) {
|
|
47
|
+
const { subscription_key, ...rest } = credentials || {};
|
|
48
|
+
super.configure({ credentials: rest, ...options });
|
|
49
|
+
this.subscription_key = Plugin.hydrate(subscription_key, this.subscription_key);
|
|
50
|
+
}
|
|
51
|
+
async init(args) {
|
|
52
|
+
await super.init(args);
|
|
53
|
+
this.configure({
|
|
54
|
+
credentials: {
|
|
55
|
+
subscription_key: await Env.get({ key: 'SKY_SUBSCRIPTION_KEY' })
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
instantiateClient(options) {
|
|
60
|
+
if (!this.subscription_key) {
|
|
61
|
+
throw new Error('No subscription access key is defined.');
|
|
62
|
+
}
|
|
63
|
+
let { headers } = options.inject || {};
|
|
64
|
+
headers = requestish.Headers.merge(headers, {
|
|
65
|
+
'Bb-Api-Subscription-Key': this.subscription_key
|
|
66
|
+
});
|
|
67
|
+
return new OAuth2CLI.Client({
|
|
68
|
+
...options,
|
|
69
|
+
inject: {
|
|
70
|
+
headers
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { SkyAPI };
|
|
1
|
+
export * as SkyAPI from './SkyAPI.js';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { register } from '@qui-cli/plugin';
|
|
2
|
-
import
|
|
3
|
-
export
|
|
4
|
-
await register(
|
|
2
|
+
import { client } from './SkyAPI.js';
|
|
3
|
+
export * as SkyAPI from './SkyAPI.js';
|
|
4
|
+
await register(client);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as SkyAPI from '../../../../../Module.js';
|
|
2
1
|
import { Paginated } from '../../../../../Paginated.js';
|
|
2
|
+
import { Assignment } from './Assignment.js';
|
|
3
3
|
type Options = {
|
|
4
4
|
types?: string;
|
|
5
5
|
status?: '0' | '1' | '2' | '-1';
|
|
@@ -7,5 +7,5 @@ type Options = {
|
|
|
7
7
|
filter?: 'expired' | 'future' | 'all';
|
|
8
8
|
search?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare function assignmentsBySection(section_id: number, params?: Options): Promise<Paginated<
|
|
10
|
+
export declare function assignmentsBySection(section_id: number, params?: Options): Promise<Paginated<Assignment>>;
|
|
11
11
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { buildQuery } from '../../../../../buildQuery.js';
|
|
2
|
-
import * as SkyAPI from '../../../../../Module.js';
|
|
3
2
|
import { Paginated } from '../../../../../Paginated.js';
|
|
3
|
+
import { client } from '../../../../../SkyAPI.js';
|
|
4
4
|
export async function assignmentsBySection(section_id, params = {}) {
|
|
5
|
-
return new Paginated(await
|
|
5
|
+
return new Paginated(await client.requestJSON(`school/v1/academics/sections/${section_id}/assignments?${buildQuery(params)}`));
|
|
6
6
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import * as SkyAPI from '../../../../Module.js';
|
|
2
1
|
import { Paginated } from '../../../../Paginated.js';
|
|
3
2
|
import { ContentManagementRequest } from '../ContentManagementRequest.js';
|
|
3
|
+
import { ContentAnnouncement } from './ContentAnnouncement.js';
|
|
4
|
+
import { ContentAnnouncementCategory } from './ContentAnnouncementCategory.js';
|
|
4
5
|
export * from './ContentAnnouncement.js';
|
|
5
6
|
export * from './ContentAnnouncementCategory.js';
|
|
6
7
|
export * from './ContentAnnouncementCategoryCollection.js';
|
|
7
|
-
export declare function categories(): Promise<Paginated<
|
|
8
|
-
export declare function list(request: ContentManagementRequest): Promise<
|
|
8
|
+
export declare function categories(): Promise<Paginated<ContentAnnouncementCategory>>;
|
|
9
|
+
export declare function list(request: ContentManagementRequest): Promise<ContentAnnouncement[]>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as SkyAPI from '../../../../Module.js';
|
|
2
1
|
import { Paginated } from '../../../../Paginated.js';
|
|
2
|
+
import { client } from '../../../../SkyAPI.js';
|
|
3
3
|
export * from './ContentAnnouncement.js';
|
|
4
4
|
export * from './ContentAnnouncementCategory.js';
|
|
5
5
|
export * from './ContentAnnouncementCategoryCollection.js';
|
|
6
6
|
export async function categories() {
|
|
7
|
-
return new Paginated(await
|
|
7
|
+
return new Paginated(await client.requestJSON('school/v1/contentmanagement/announcements/categories'));
|
|
8
8
|
}
|
|
9
9
|
export async function list(request) {
|
|
10
|
-
return
|
|
10
|
+
return client.requestJSON('school/v1/contentmanagement/announcements/list', 'POST', JSON.stringify(request), new Headers({ 'Content-Type': 'application/json' }));
|
|
11
11
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import * as SkyAPI from '../../../../Module.js';
|
|
2
1
|
import { Paginated } from '../../../../Paginated.js';
|
|
3
2
|
import { ContentManagementRequest } from '../ContentManagementRequest.js';
|
|
3
|
+
import { NewsCategory } from './NewsCategory.js';
|
|
4
|
+
import { NewsItem } from './NewsItem.js';
|
|
4
5
|
export * from './NewsCategory.js';
|
|
5
6
|
export * from './NewsCategoryCollection.js';
|
|
6
7
|
export * from './NewsItem.js';
|
|
7
|
-
export declare function categories(): Promise<Paginated<
|
|
8
|
-
export declare function list(request: ContentManagementRequest): Promise<
|
|
8
|
+
export declare function categories(): Promise<Paginated<NewsCategory>>;
|
|
9
|
+
export declare function list(request: ContentManagementRequest): Promise<NewsItem[]>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as SkyAPI from '../../../../Module.js';
|
|
2
1
|
import { Paginated } from '../../../../Paginated.js';
|
|
2
|
+
import { client } from '../../../../SkyAPI.js';
|
|
3
3
|
export * from './NewsCategory.js';
|
|
4
4
|
export * from './NewsCategoryCollection.js';
|
|
5
5
|
export * from './NewsItem.js';
|
|
6
6
|
export async function categories() {
|
|
7
|
-
return new Paginated(await
|
|
7
|
+
return new Paginated(await client.requestJSON('school/v1/contentmanagement/news/categories'));
|
|
8
8
|
}
|
|
9
9
|
export async function list(request) {
|
|
10
|
-
return await
|
|
10
|
+
return await client.requestJSON('school/v1/contentmanagement/news/list', 'POST', JSON.stringify(request), new Headers({ 'Content-Type': 'application/json' }));
|
|
11
11
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import * as SkyAPI from '../../../../Module.js';
|
|
2
1
|
import { Paginated } from '../../../../Paginated.js';
|
|
3
2
|
import { ContentManagementRequest } from '../ContentManagementRequest.js';
|
|
3
|
+
import { MediaItem } from './MediaItem.js';
|
|
4
|
+
import { PhotoAlbum } from './PhotoAlbum.js';
|
|
5
|
+
import { PhotoCategory } from './PhotoCategory.js';
|
|
4
6
|
export * from './ImageDimension.js';
|
|
5
7
|
export * from './ImageSettings.js';
|
|
6
8
|
export * from './MediaItem.js';
|
|
@@ -8,6 +10,6 @@ export * from './MediaItemCollection.js';
|
|
|
8
10
|
export * from './PhotoAlbum.js';
|
|
9
11
|
export * from './PhotoCategory.js';
|
|
10
12
|
export * from './PhotoCategoryCollection.js';
|
|
11
|
-
export declare function categories(): Promise<Paginated<
|
|
12
|
-
export declare function list(request: ContentManagementRequest): Promise<Paginated<
|
|
13
|
-
export declare function photosById(album_id: number): Promise<Paginated<
|
|
13
|
+
export declare function categories(): Promise<Paginated<PhotoCategory>>;
|
|
14
|
+
export declare function list(request: ContentManagementRequest): Promise<Paginated<PhotoAlbum>>;
|
|
15
|
+
export declare function photosById(album_id: number): Promise<Paginated<MediaItem>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as SkyAPI from '../../../../Module.js';
|
|
2
1
|
import { Paginated } from '../../../../Paginated.js';
|
|
2
|
+
import { client } from '../../../../SkyAPI.js';
|
|
3
3
|
export * from './ImageDimension.js';
|
|
4
4
|
export * from './ImageSettings.js';
|
|
5
5
|
export * from './MediaItem.js';
|
|
@@ -8,11 +8,11 @@ export * from './PhotoAlbum.js';
|
|
|
8
8
|
export * from './PhotoCategory.js';
|
|
9
9
|
export * from './PhotoCategoryCollection.js';
|
|
10
10
|
export async function categories() {
|
|
11
|
-
return new Paginated(await
|
|
11
|
+
return new Paginated(await client.requestJSON('school/v1/contentmanagement/photoalbums/categories'));
|
|
12
12
|
}
|
|
13
13
|
export async function list(request) {
|
|
14
|
-
return new Paginated(await
|
|
14
|
+
return new Paginated(await client.requestJSON('school/v1/contentmanagement/photoalbums/list', 'POST', JSON.stringify(request), new Headers({ 'Content-Type': 'application/json' })));
|
|
15
15
|
}
|
|
16
16
|
export async function photosById(album_id) {
|
|
17
|
-
return new Paginated(await
|
|
17
|
+
return new Paginated(await client.requestJSON(`school/v1/contentmanagement/photoalbums/${album_id}`));
|
|
18
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oauth2-cli/sky-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"blackbaud",
|
|
6
6
|
"sky",
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"main": "./dist/index.js",
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@oauth2-cli/qui-cli": "^0.
|
|
25
|
+
"@oauth2-cli/qui-cli": "^0.7.2",
|
|
26
26
|
"node-fetch": "^3.3.2",
|
|
27
|
-
"
|
|
27
|
+
"requestish": "^0.1.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@battis/descriptive-types": "^0.2.6",
|
|
31
|
-
"@battis/typescript-tricks": "^0.7.
|
|
32
|
-
"@qui-cli/colors": "^3.2.
|
|
33
|
-
"@qui-cli/env
|
|
34
|
-
"@qui-cli/plugin": "^4.
|
|
31
|
+
"@battis/typescript-tricks": "^0.7.7",
|
|
32
|
+
"@qui-cli/colors": "^3.2.3",
|
|
33
|
+
"@qui-cli/env": "^5.1.1",
|
|
34
|
+
"@qui-cli/plugin": "^4.1.0",
|
|
35
35
|
"@tsconfig/node24": "^24.0.4",
|
|
36
36
|
"commit-and-tag-version": "^12.6.1",
|
|
37
37
|
"del-cli": "^6.0.0",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"typescript": "^5.9.3"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
+
"@qui-cli/env": ">=5",
|
|
42
43
|
"@qui-cli/plugin": ">=3"
|
|
43
44
|
},
|
|
44
45
|
"scripts": {
|
package/dist/Client.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
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/Credentials.d.ts
DELETED
package/dist/Credentials.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/Module.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SkyAPIPlugin } from './SkyAPI.js';
|
|
2
|
-
export * from './SkyAPI.js';
|
|
3
|
-
declare const sky: SkyAPIPlugin;
|
|
4
|
-
export declare const name: string;
|
|
5
|
-
export declare const configure: ({ subscription_key, subscriptionKeyEnvVar, ...proposal }?: import("./SkyAPI.js").ConfigurationProposal) => void;
|
|
6
|
-
export declare const options: () => import("@qui-cli/plugin").Options;
|
|
7
|
-
export declare const init: ({ values }: import("@qui-cli/plugin").ExpectedArguments<typeof this.options>) => Promise<void>;
|
|
8
|
-
export declare const getToken: typeof sky.getToken;
|
|
9
|
-
export declare const getClient: typeof sky.getClient;
|
|
10
|
-
export declare const request: typeof sky.request;
|
|
11
|
-
export declare const requestJSON: typeof sky.requestJSON;
|
|
12
|
-
export declare const fetch: typeof sky.fetch;
|
|
13
|
-
export declare const fetchJSON: typeof sky.fetchJSON;
|
package/dist/Module.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SkyAPIPlugin } from './SkyAPI.js';
|
|
2
|
-
export * from './SkyAPI.js';
|
|
3
|
-
const sky = new SkyAPIPlugin();
|
|
4
|
-
export const name = sky.name;
|
|
5
|
-
export const configure = sky.configure.bind(sky);
|
|
6
|
-
export const options = sky.options.bind(sky);
|
|
7
|
-
export const init = sky.init.bind(sky);
|
|
8
|
-
export const getToken = sky.getToken.bind(sky);
|
|
9
|
-
export const getClient = sky.getClient.bind(sky);
|
|
10
|
-
export const request = sky.request.bind(sky);
|
|
11
|
-
export const requestJSON = sky.requestJSON.bind(sky);
|
|
12
|
-
export const fetch = sky.fetch.bind(sky);
|
|
13
|
-
export const fetchJSON = sky.fetchJSON.bind(sky);
|