@onhand-bi/sdk 0.1.4 → 0.1.5

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.
@@ -13,3 +13,12 @@
13
13
  */
14
14
 
15
15
  /*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */
16
+
17
+ /**
18
+ * [js-sha256]{@link https://github.com/emn178/js-sha256}
19
+ *
20
+ * @version 0.11.0
21
+ * @author Chen, Yi-Cyuan [emn178@gmail.com]
22
+ * @copyright Chen, Yi-Cyuan 2014-2024
23
+ * @license MIT
24
+ */
@@ -1,17 +1,13 @@
1
1
  export type CClientCredential = {
2
- email: string;
3
2
  clientId: string;
4
- clientSecret: string;
3
+ clientToken: string;
5
4
  };
6
- export type CClientGetTokenRequest = CClientCredential & {
7
- scope?: string;
5
+ export type WithMessage<T> = {
6
+ message: string;
7
+ data: T;
8
8
  };
9
9
  export type CClientGetTokenResponse = {
10
- access_token: string;
11
- expires_in: number;
12
- token_type: string;
13
- scope: string;
14
- not_before_policy: number;
10
+ accessToken: string;
15
11
  };
16
12
  export type Token = {
17
13
  user_id: string;
@@ -52,7 +52,6 @@ export interface ReportModel {
52
52
  print?: boolean;
53
53
  };
54
54
  filters: any;
55
- embedUrl?: string;
56
55
  }
57
56
  export interface AppModel {
58
57
  id: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onhand-bi/sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "OnhandBI SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -1,8 +1,6 @@
1
- import { CClientCredential, CClientGetTokenRequest, CClientGetTokenResponse } from "../models";
1
+ import { CClientCredential, WithMessage, ReportModel, CClientGetTokenResponse } from '../models';
2
2
  export declare class CClientService {
3
- static getAuthToken({ clientId, clientSecret, scope }: CClientGetTokenRequest): Promise<CClientGetTokenResponse>;
4
- static validateAuthToken(data: CClientCredential & {
5
- token: string;
6
- }): Promise<any>;
7
- static getReportToken(credential: CClientCredential): Promise<string>;
3
+ static getAccessToken(credential: CClientCredential): Promise<string>;
4
+ static getReports(token: string): Promise<WithMessage<ReportModel[]>>;
5
+ static getReportAccessToken(token: string, email: string): Promise<WithMessage<CClientGetTokenResponse>>;
8
6
  }