@onhand-bi/sdk 0.1.3 → 0.1.4
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/README.md +175 -3
- package/config/index.d.ts +1 -0
- package/constants/api/url.d.ts +3 -0
- package/controllers/cclient.d.ts +3 -0
- package/controllers/index.d.ts +1 -0
- package/core/cclient.d.ts +17 -0
- package/core/client.d.ts +6 -3
- package/core/index.d.ts +1 -0
- package/environment.d.ts +2 -0
- package/index.js +1 -1
- package/index.js.LICENSE.txt +1 -0
- package/index.node.js +2 -0
- package/index.node.js.LICENSE.txt +15 -0
- package/models/cclient.d.ts +19 -0
- package/models/client.d.ts +57 -0
- package/models/index.d.ts +1 -0
- package/package.json +1 -1
- package/services/cclient.d.ts +8 -0
- package/services/client.d.ts +5 -2
- package/services/index.d.ts +1 -2
- package/services/confidential-client.d.ts +0 -7
- package/services/public-client.d.ts +0 -4
- package/type/client.type.d.ts +0 -29
- package/type/index.d.ts +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
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 */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type CClientCredential = {
|
|
2
|
+
email: string;
|
|
3
|
+
clientId: string;
|
|
4
|
+
clientSecret: string;
|
|
5
|
+
};
|
|
6
|
+
export type CClientGetTokenRequest = CClientCredential & {
|
|
7
|
+
scope?: string;
|
|
8
|
+
};
|
|
9
|
+
export type CClientGetTokenResponse = {
|
|
10
|
+
access_token: string;
|
|
11
|
+
expires_in: number;
|
|
12
|
+
token_type: string;
|
|
13
|
+
scope: string;
|
|
14
|
+
not_before_policy: number;
|
|
15
|
+
};
|
|
16
|
+
export type Token = {
|
|
17
|
+
user_id: string;
|
|
18
|
+
time: number;
|
|
19
|
+
};
|
package/models/client.d.ts
CHANGED
|
@@ -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,48 @@ 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
|
+
embedUrl?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface AppModel {
|
|
58
|
+
id: number;
|
|
59
|
+
name: string;
|
|
60
|
+
description: string;
|
|
61
|
+
emails: string[];
|
|
62
|
+
reportIds: number[];
|
|
63
|
+
reports: ReportModel[];
|
|
64
|
+
groups: GroupModel[];
|
|
65
|
+
updatedAt: string;
|
|
66
|
+
createdAt: string;
|
|
67
|
+
logo?: string;
|
|
68
|
+
reportConfigs: EmbedReportConfig[];
|
|
69
|
+
}
|
|
70
|
+
interface GroupModel {
|
|
71
|
+
id: number;
|
|
72
|
+
name: string;
|
|
73
|
+
emails: string[];
|
|
74
|
+
reportIds: number[];
|
|
75
|
+
updatedAt: string;
|
|
76
|
+
createdAt: string;
|
|
77
|
+
}
|
|
78
|
+
export interface EmbedReportConfig {
|
|
79
|
+
tokenId?: string;
|
|
80
|
+
accessToken?: string;
|
|
81
|
+
tokenExpiry?: string;
|
|
82
|
+
reportConfig?: ReportConfig[];
|
|
83
|
+
errorMsg?: string;
|
|
84
|
+
}
|
|
85
|
+
interface ReportConfig {
|
|
86
|
+
reportId: string;
|
|
87
|
+
reportName: string;
|
|
88
|
+
embedUrl: string;
|
|
89
|
+
datasetId: any;
|
|
34
90
|
}
|
|
91
|
+
export {};
|
package/models/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CClientCredential, CClientGetTokenRequest, CClientGetTokenResponse } from "../models";
|
|
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>;
|
|
8
|
+
}
|
package/services/client.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { Report,
|
|
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
|
|
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
|
}
|
package/services/index.d.ts
CHANGED
|
@@ -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
|
-
}
|
package/type/client.type.d.ts
DELETED
|
@@ -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";
|