@oauth2-cli/sky-api 0.4.1 → 0.5.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,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.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
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * update to @oauth2-cli/qui-cli
11
+
12
+ ### Features
13
+
14
+ * update to @oauth2-cli/qui-cli ([2240c56](https://github.com/groton-school/myschoolapp-reporting/commit/2240c5653e9e4af08e71036264735c47b68936d3))
15
+
16
+ ## [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)
17
+
18
+
19
+ ### Features
20
+
21
+ * add scope support ([dae9f5a](https://github.com/groton-school/myschoolapp-reporting/commit/dae9f5aa7c2527f8fbf84184f19bc07c40001502))
22
+
5
23
  ## [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
24
 
7
25
 
package/README.md CHANGED
@@ -5,7 +5,7 @@ Acquire SKY API access tokens via OAuth 2.0 within CLI tools
5
5
  ## Install
6
6
 
7
7
  ```sh
8
- npm i @oauth2-cli/sky-api
8
+ npm i @oauth2-cli/sky-api @qui-cli/core
9
9
  ```
10
10
 
11
11
  ## Usage
@@ -13,17 +13,11 @@ npm i @oauth2-cli/sky-api
13
13
  Configure your SKY API app credentials somewhere relatively secure (e.g. your environment) and then...
14
14
 
15
15
  ```ts
16
- import dotenv from 'dotenv';
17
16
  import { SkyAPI } from '@oauth2-cli/sky-api';
17
+ import { Core } from '@qui-cli/core';
18
18
 
19
- (async () => {
20
- dotenv.config();
21
- const sky = new SkyAPI({
22
- client_id: process.env.CLIENT_ID,
23
- client_secret: process.env.CLIENT_SECRET,
24
- subscription_key: process.env.SUBSCRIPTION_KEY,
25
- redirect_uri: process.env.REDIRECT_URI
26
- });
27
- const calendar = await sky.fetch('school/v1/events/calendar');
28
- })();
19
+ await Core.run();
20
+ console.log(
21
+ await sky.fetchJSON('https://api.sky.blackbaud.com/school/v1/users/me')
22
+ );
29
23
  ```
package/dist/Paginated.js CHANGED
@@ -1,4 +1,4 @@
1
- import * as Client from './Module.js';
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 Client.requestJSON(data.next_link);
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 * as OAuth2 from '@oauth2-cli/qui-cli/dist/OAuth2.js';
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
- type SkyConfiguration = {
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,77 +1,3 @@
1
- import * as OAuth2 from '@oauth2-cli/qui-cli/dist/OAuth2.js';
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 class SkyAPIPlugin extends OAuth2.OAuth2Plugin {
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
- redirectUri: 'skyRedirectUri'
21
- },
22
- env: {
23
- clientId: 'SKY_CLIENT_ID',
24
- clientSecret: 'SKY_CLIENT_SECRET',
25
- redirectUri: 'SKY_REDIRECT_URI',
26
- tokenPath: 'SKY_TOKEN_PATH',
27
- accessToken: 'SKY_ACCESS_TOKEN'
28
- },
29
- man: { heading: 'Sky API options' },
30
- suppress: {
31
- authorizationEndpoint: true,
32
- tokenEndpoint: true,
33
- tokenPath: true,
34
- accessToken: true
35
- }
36
- });
37
- }
38
- configure({ subscription_key, subscriptionKeyEnvVar, ...proposal } = {}) {
39
- super.configure(proposal);
40
- this.skyConfig.subscription_key =
41
- subscription_key || this.skyConfig.subscription_key;
42
- this.skyConfig.subscriptionKeyEnvVar =
43
- subscriptionKeyEnvVar || this.skyConfig.subscriptionKeyEnvVar;
44
- }
45
- options() {
46
- const options = super.options();
47
- options.opt = {
48
- ...options.opt,
49
- subscriptionKey: {
50
- description: `Blackbaud subscription access key; will use environment ` +
51
- `variable ${Colors.varName(this.skyConfig.subscriptionKeyEnvVar)} ` +
52
- `if present`,
53
- secret: true,
54
- default: this.skyConfig.subscription_key
55
- }
56
- };
57
- return options;
58
- }
59
- async init({ values }) {
60
- const { subscriptionKey: subscription_key = await Env.get({
61
- key: this.skyConfig.subscriptionKeyEnvVar
62
- }) } = values;
63
- this.configure({
64
- subscription_key,
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
75
- });
76
- }
77
- }
3
+ export const client = new SkyAPIPlugin();
@@ -0,0 +1,17 @@
1
+ import { OAuth2Plugin, Configuration, Client } from '@oauth2-cli/qui-cli/dist/Extend.js';
2
+ import * as OAuth2 from '@oauth2-cli/qui-cli/dist/Export.js';
3
+ import * as Plugin from '@qui-cli/plugin';
4
+ type Credentials = OAuth2.Credentials & {
5
+ subscription_key: string;
6
+ };
7
+ export type SkyConfiguration = Configuration & {
8
+ credentials?: Partial<Credentials>;
9
+ };
10
+ export declare class SkyAPIPlugin extends OAuth2Plugin {
11
+ private subscription_key?;
12
+ constructor();
13
+ configure({ credentials, ...options }?: SkyConfiguration): void;
14
+ init(args: Plugin.ExpectedArguments<typeof this.options>): Promise<void>;
15
+ protected instantiateClient(options: OAuth2.ClientOptions): Client;
16
+ }
17
+ export {};
@@ -0,0 +1,65 @@
1
+ import { OAuth2Plugin, Token, Client } from '@oauth2-cli/qui-cli/dist/Extend.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 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: { heading: 'Sky API options',
16
+ text: [
17
+ `The OAuth 2.0 ${Colors.keyword('refresh_token')} is read from the ` +
18
+ `${Colors.varName('SKY_REFRESH_TOKEN')} environment variable, if ` +
19
+ `present.`,
20
+ `The Sky API subscription access key is read from the ` +
21
+ `${Colors.varName('SKY_SUBSCRIPTION_KEY')} environment variable, if ` +
22
+ `present. See ` +
23
+ `${Colors.url('https://developer.blackbaud.com/subscriptions/')} ` +
24
+ `for more information.`
25
+ ]
26
+ },
27
+ env: {
28
+ client_id: 'SKY_CLIENT_ID',
29
+ client_secret: 'SKY_CLIENT_SECRET',
30
+ scope: 'SKY_SCOPE',
31
+ redirect_uri: 'SKY_REDIRECT_URI',
32
+ },
33
+ suppress: {
34
+ issuer: true,
35
+ authorization_endpoint: true,
36
+ token_endpoint: true,
37
+ },
38
+ storage: new Token.EnvironmentStorage('SKY_REFRESH_TOKEN')
39
+ });
40
+ }
41
+ configure({ credentials, ...options } = {}) {
42
+ const { subscription_key, ...rest } = credentials || {};
43
+ super.configure({ credentials: rest, ...options });
44
+ this.subscription_key = Plugin.hydrate(subscription_key, this.subscription_key);
45
+ }
46
+ async init(args) {
47
+ await super.init(args);
48
+ this.configure({ credentials: { subscription_key: await Env.get({ key: 'SKY_SUBSCRIPTION_KEY' }) } });
49
+ }
50
+ instantiateClient(options) {
51
+ if (!this.subscription_key) {
52
+ throw new Error('No subscription access key is defined.');
53
+ }
54
+ let { headers } = options.inject || {};
55
+ headers = requestish.Headers.merge(headers, {
56
+ 'Bb-Api-Subscription-Key': this.subscription_key
57
+ });
58
+ return new Client({
59
+ ...options,
60
+ inject: {
61
+ headers
62
+ }
63
+ });
64
+ }
65
+ }
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
- import * as SkyAPI from './Module.js';
2
- export { SkyAPI };
1
+ export * as SkyAPI from './SkyAPI.js';
2
+ export * from './SkyAPIPlugin.js';
3
+ export * from '@oauth2-cli/qui-cli/dist/Export.js';
4
+ export { Token, Client } from '@oauth2-cli/qui-cli/dist/Extend.js';
package/dist/index.js CHANGED
@@ -1,4 +1,7 @@
1
1
  import { register } from '@qui-cli/plugin';
2
- import * as SkyAPI from './Module.js';
3
- export { SkyAPI };
4
- await register(SkyAPI);
2
+ import { client } from './SkyAPI.js';
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
+ 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<SkyAPI.school.v1.academics.sections.assignments.Assignment>>;
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 SkyAPI.requestJSON(`https://api.sky.blackbaud.com/school/v1/academics/sections/${section_id}/assignments?${buildQuery(params)}`));
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<SkyAPI.school.v1.contentmanagement.announcements.ContentAnnouncementCategory>>;
8
- export declare function list(request: ContentManagementRequest): Promise<SkyAPI.school.v1.contentmanagement.announcements.ContentAnnouncement[]>;
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 SkyAPI.requestJSON('https://api.sky.blackbaud.com/school/v1/contentmanagement/announcements/categories'));
7
+ return new Paginated(await client.requestJSON('school/v1/contentmanagement/announcements/categories'));
8
8
  }
9
9
  export async function list(request) {
10
- return SkyAPI.requestJSON('https://api.sky.blackbaud.com/school/v1/contentmanagement/announcements/list', 'POST', JSON.stringify(request), new Headers({ 'Content-Type': 'application/json' }));
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<SkyAPI.school.v1.contentmanagement.news.NewsCategory>>;
8
- export declare function list(request: ContentManagementRequest): Promise<SkyAPI.school.v1.contentmanagement.news.NewsItem[]>;
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 SkyAPI.requestJSON('https://api.sky.blackbaud.com/school/v1/contentmanagement/news/categories'));
7
+ return new Paginated(await client.requestJSON('school/v1/contentmanagement/news/categories'));
8
8
  }
9
9
  export async function list(request) {
10
- return await SkyAPI.requestJSON('https://api.sky.blackbaud.com/school/v1/contentmanagement/news/list', 'POST', JSON.stringify(request), new Headers({ 'Content-Type': 'application/json' }));
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<SkyAPI.school.v1.contentmanagement.photoalbums.PhotoCategory>>;
12
- export declare function list(request: ContentManagementRequest): Promise<Paginated<SkyAPI.school.v1.contentmanagement.photoalbums.PhotoAlbum>>;
13
- export declare function photosById(album_id: number): Promise<Paginated<SkyAPI.school.v1.contentmanagement.photoalbums.MediaItem>>;
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 SkyAPI.requestJSON('https://api.sky.blackbaud.com/school/v1/contentmanagement/photoalbums/categories'));
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 SkyAPI.requestJSON('https://api.sky.blackbaud.com/school/v1/contentmanagement/photoalbums/list', 'POST', JSON.stringify(request), new Headers({ 'Content-Type': 'application/json' })));
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 SkyAPI.requestJSON(`https://api.sky.blackbaud.com/school/v1/contentmanagement/photoalbums/${album_id}`));
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.4.1",
3
+ "version": "0.5.0",
4
4
  "keywords": [
5
5
  "blackbaud",
6
6
  "sky",
@@ -22,23 +22,24 @@
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
+ "@oauth2-cli/qui-cli": "^0.7.0",
26
26
  "node-fetch": "^3.3.2",
27
- "oauth2-cli": "^0.2.3"
27
+ "requestish": "^0.1.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@battis/descriptive-types": "^0.2.6",
31
- "@battis/typescript-tricks": "^0.7.6",
32
- "@qui-cli/colors": "^3.2.2",
33
- "@qui-cli/env-1password": "^1.2.6",
34
- "@qui-cli/plugin": "^4.0.0",
35
- "@tsconfig/node24": "^24.0.3",
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
+ "@tsconfig/node24": "^24.0.4",
36
36
  "commit-and-tag-version": "^12.6.1",
37
37
  "del-cli": "^6.0.0",
38
38
  "npm-run-all": "^4.1.5",
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
- }
@@ -1,4 +0,0 @@
1
- import * as OAuth2 from 'oauth2-cli';
2
- export type Credentials = Omit<OAuth2.Credentials, 'authorization_endpoint' | 'token_endpoint'> & {
3
- subscription_key: string;
4
- };
@@ -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);