@onhand-bi/sdk 0.1.3 → 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.
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * mime-db
3
+ * Copyright(c) 2014 Jonathan Ong
4
+ * Copyright(c) 2015-2022 Douglas Christopher Wilson
5
+ * MIT Licensed
6
+ */
7
+
8
+ /*!
9
+ * mime-types
10
+ * Copyright(c) 2014 Jonathan Ong
11
+ * Copyright(c) 2015 Douglas Christopher Wilson
12
+ * MIT Licensed
13
+ */
14
+
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
+ */
@@ -0,0 +1,15 @@
1
+ export type CClientCredential = {
2
+ clientId: string;
3
+ clientToken: string;
4
+ };
5
+ export type WithMessage<T> = {
6
+ message: string;
7
+ data: T;
8
+ };
9
+ export type CClientGetTokenResponse = {
10
+ accessToken: string;
11
+ };
12
+ export type Token = {
13
+ user_id: string;
14
+ time: number;
15
+ };
@@ -9,6 +9,18 @@ export interface Report extends PaginationModel {
9
9
  message: string;
10
10
  data: ReportModel[];
11
11
  }
12
+ export interface ReportResponse {
13
+ message: string;
14
+ data: ReportModel;
15
+ }
16
+ export interface App extends PaginationModel {
17
+ message: string;
18
+ data: AppModel[];
19
+ }
20
+ export interface AppResponse extends PaginationModel {
21
+ message: string;
22
+ data: AppModel;
23
+ }
12
24
  export interface ReportModel {
13
25
  active: number;
14
26
  company: string;
@@ -19,6 +31,7 @@ export interface ReportModel {
19
31
  id: string;
20
32
  isActived: boolean;
21
33
  isOwner: boolean;
34
+ pbi: string;
22
35
  pdf: string;
23
36
  plan: number;
24
37
  reportMethod: number;
@@ -31,4 +44,47 @@ export interface ReportModel {
31
44
  userName: string;
32
45
  workspaceId: number;
33
46
  workspaceName: string;
47
+ sharingUsers: any[];
48
+ advanceOptions?: {
49
+ navbar?: boolean;
50
+ filterPane?: boolean;
51
+ bookmark?: boolean;
52
+ print?: boolean;
53
+ };
54
+ filters: any;
55
+ }
56
+ export interface AppModel {
57
+ id: number;
58
+ name: string;
59
+ description: string;
60
+ emails: string[];
61
+ reportIds: number[];
62
+ reports: ReportModel[];
63
+ groups: GroupModel[];
64
+ updatedAt: string;
65
+ createdAt: string;
66
+ logo?: string;
67
+ reportConfigs: EmbedReportConfig[];
68
+ }
69
+ interface GroupModel {
70
+ id: number;
71
+ name: string;
72
+ emails: string[];
73
+ reportIds: number[];
74
+ updatedAt: string;
75
+ createdAt: string;
76
+ }
77
+ export interface EmbedReportConfig {
78
+ tokenId?: string;
79
+ accessToken?: string;
80
+ tokenExpiry?: string;
81
+ reportConfig?: ReportConfig[];
82
+ errorMsg?: string;
83
+ }
84
+ interface ReportConfig {
85
+ reportId: string;
86
+ reportName: string;
87
+ embedUrl: string;
88
+ datasetId: any;
34
89
  }
90
+ export {};
package/models/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from "./client";
2
+ export * from "./cclient";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onhand-bi/sdk",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "OnhandBI SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -0,0 +1,6 @@
1
+ import { CClientCredential, WithMessage, ReportModel, CClientGetTokenResponse } from '../models';
2
+ export declare class CClientService {
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>>;
6
+ }
@@ -1,6 +1,9 @@
1
- import { Report, ReportModel } from '../models';
1
+ import { AppResponse, Report, ReportResponse } from '../models';
2
2
  export declare class ClientService {
3
3
  static validateToken(token: string): Promise<import("axios").AxiosResponse<any, any>>;
4
4
  static getReports(token: string, requestParams?: any): Promise<Report>;
5
- static getOne(token: string, reportId: number, isOwner?: boolean): Promise<ReportModel>;
5
+ static getAppsOwner(token: string, requestParams?: any): Promise<Report>;
6
+ static getAppsSubscribes(token: string, requestParams?: any): Promise<Report>;
7
+ static getReport(token: string, reportId: number, isOwner?: boolean): Promise<ReportResponse>;
8
+ static getApp(token: string, appId: number, isOwner?: boolean): Promise<AppResponse>;
6
9
  }
@@ -1,3 +1,2 @@
1
1
  export * from "./client";
2
- export * from "./public-client";
3
- export * from "./confidential-client";
2
+ export * from "./cclient";
@@ -1,7 +0,0 @@
1
- import { ConfidentialClientCredentials, ConfidentialTokenConfigRequest, ConfidentialTokenConfigResponse } from "../type";
2
- export declare class ConfidentialClientService {
3
- static getToken({ realm, clientId, clientSecret, scope }: ConfidentialTokenConfigRequest): Promise<ConfidentialTokenConfigResponse>;
4
- static validateToken(data: ConfidentialClientCredentials & {
5
- token: string;
6
- }): Promise<any>;
7
- }
@@ -1,4 +0,0 @@
1
- import { PublicTokenConfigRequest, PublicTokenConfigResponse } from "../type";
2
- export declare class PublicClientService {
3
- static getToken({ realm, username, password, clientId, scope }: PublicTokenConfigRequest): Promise<PublicTokenConfigResponse>;
4
- }
@@ -1,29 +0,0 @@
1
- export type PublicClientCredentials = {
2
- username: string;
3
- password: string;
4
- clientId: string;
5
- realm: string;
6
- };
7
- export type ConfidentialClientCredentials = {
8
- clientId: string;
9
- clientSecret: string;
10
- realm: string;
11
- };
12
- export type PublicTokenConfigRequest = PublicClientCredentials & {
13
- scope?: string;
14
- };
15
- export type TokenConfigResponse = {
16
- access_token: string;
17
- expires_in: number;
18
- token_type: string;
19
- not_before_policy: number;
20
- scope: string;
21
- };
22
- export type PublicTokenConfigResponse = TokenConfigResponse & {
23
- refresh_expires_in: number;
24
- refresh_token: string;
25
- };
26
- export type ConfidentialTokenConfigRequest = ConfidentialClientCredentials & {
27
- scope?: string;
28
- };
29
- export type ConfidentialTokenConfigResponse = TokenConfigResponse;
package/type/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./client.type";