@luzmo/embed 5.0.11 → 5.0.13-alpha.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 +6 -0
- package/index.cjs +18 -13
- package/index.js +18 -13
- package/index.libs.cjs +1099 -0
- package/index.libs.js +1079 -0
- package/lib/dashboard-component/dashboard-base.d.ts +2 -0
- package/luzmo-embed.libs.js +112 -127
- package/luzmo-embed.min.js +112 -127
- package/package.json +2 -2
|
@@ -54,6 +54,8 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.ES6L
|
|
|
54
54
|
VERSION: string;
|
|
55
55
|
protected isLibraryLoaded: boolean;
|
|
56
56
|
protected dashboardReference: SharedLib.LuzmoElement;
|
|
57
|
+
currentAuthKey: string;
|
|
58
|
+
currentAuthToken: string;
|
|
57
59
|
private attributesMap;
|
|
58
60
|
_loadTimeoutHandle?: number;
|
|
59
61
|
_onResize: () => void;
|
package/luzmo-embed.libs.js
CHANGED
|
@@ -912,128 +912,108 @@ var exportDashboard = (dashboardComponent, iframe, format) => {
|
|
|
912
912
|
};
|
|
913
913
|
|
|
914
914
|
// libs/embed-libs/shared-embed/src/lib/methods/get-accessible-dashboards.ts
|
|
915
|
-
var getAccessibleDashboards = (dashboardComponent
|
|
916
|
-
if ((dashboardComponent.
|
|
917
|
-
const
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
915
|
+
var getAccessibleDashboards = (dashboardComponent) => {
|
|
916
|
+
if ((dashboardComponent.currentAuthKey ?? dashboardComponent.authKey) && (dashboardComponent.currentAuthToken ?? dashboardComponent.authToken)) {
|
|
917
|
+
const fetchUser = new Promise((resolve, reject) => {
|
|
918
|
+
void (() => {
|
|
919
|
+
try {
|
|
920
|
+
const responsePromise = window.fetch(
|
|
921
|
+
`${String(dashboardComponent.params.apiHost)}0.1.0/authorization`,
|
|
922
|
+
{
|
|
923
|
+
method: "POST",
|
|
924
|
+
mode: "cors",
|
|
925
|
+
cache: "no-cache",
|
|
926
|
+
headers: { "Content-Type": "application/json" },
|
|
927
|
+
redirect: "follow",
|
|
928
|
+
body: JSON.stringify({
|
|
929
|
+
action: "get",
|
|
930
|
+
version: "0.1.0",
|
|
931
|
+
key: dashboardComponent.currentAuthKey ?? dashboardComponent.authKey,
|
|
932
|
+
token: dashboardComponent.currentAuthToken ?? dashboardComponent.authToken,
|
|
933
|
+
find: {
|
|
934
|
+
where: { id: dashboardComponent.authKey },
|
|
935
|
+
attributes: ["id", "integration_id"],
|
|
936
|
+
include: [
|
|
937
|
+
{
|
|
938
|
+
model: "User",
|
|
939
|
+
attributes: ["id", "name", "locale_id"],
|
|
940
|
+
include: [{ model: "Group" }]
|
|
941
|
+
}
|
|
942
|
+
]
|
|
943
|
+
}
|
|
944
|
+
})
|
|
945
|
+
}
|
|
933
946
|
);
|
|
934
|
-
|
|
947
|
+
responsePromise.then((response) => response.json()).then((data) => {
|
|
948
|
+
if (!data || !data.rows || data.rows.length === 0 || !data.rows[0].user) {
|
|
949
|
+
reject("Authorization failed, please check authKey and authToken. If the problem persists, please contact support@luzmo.com.");
|
|
950
|
+
} else {
|
|
951
|
+
data.rows[0].user.userGroups = data.rows[0].user.groups.map(
|
|
952
|
+
(group) => group.id
|
|
953
|
+
);
|
|
954
|
+
delete data.rows[0].user.groups;
|
|
955
|
+
resolve({
|
|
956
|
+
integrationId: data.rows[0].integration_id,
|
|
957
|
+
user: data.rows[0].user
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
});
|
|
961
|
+
} catch (error) {
|
|
962
|
+
reject(error);
|
|
935
963
|
}
|
|
936
|
-
}
|
|
964
|
+
})();
|
|
937
965
|
});
|
|
938
|
-
|
|
939
|
-
const fetchUser = new Promise((resolve, reject) => {
|
|
940
|
-
void (() => {
|
|
966
|
+
return new Promise((resolve, reject) => void (() => {
|
|
941
967
|
try {
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
}
|
|
968
|
+
fetchUser.then((authorizationData) => {
|
|
969
|
+
const responsePromise = window.fetch(
|
|
970
|
+
`${String(dashboardComponent.params.apiHost)}0.1.0/securable`,
|
|
971
|
+
{
|
|
972
|
+
method: "POST",
|
|
973
|
+
mode: "cors",
|
|
974
|
+
cache: "no-cache",
|
|
975
|
+
headers: { "Content-Type": "application/json" },
|
|
976
|
+
redirect: "follow",
|
|
977
|
+
body: JSON.stringify({
|
|
978
|
+
action: "get",
|
|
979
|
+
version: "0.1.0",
|
|
980
|
+
key: dashboardComponent.currentAuthKey ?? dashboardComponent.authKey,
|
|
981
|
+
token: dashboardComponent.currentAuthToken ?? dashboardComponent.authToken,
|
|
982
|
+
find: {
|
|
983
|
+
where: { type: "dashboard", is_variant: false },
|
|
984
|
+
attributes: ["id", "name", "modified_at"],
|
|
985
|
+
order: [["modified_at", "desc"]],
|
|
986
|
+
include: [
|
|
987
|
+
{ model: "Tag", attributes: ["tag"] },
|
|
988
|
+
{ model: "User", attributes: ["id", "name"] },
|
|
989
|
+
{
|
|
990
|
+
model: "Group",
|
|
991
|
+
attributes: ["id", "name", "public"]
|
|
992
|
+
},
|
|
993
|
+
{ model: "Integration", attributes: ["id", "name"] }
|
|
994
|
+
]
|
|
995
|
+
}
|
|
996
|
+
})
|
|
997
|
+
}
|
|
998
|
+
);
|
|
999
|
+
responsePromise.then((response) => response.json()).then((data) => {
|
|
1000
|
+
const dashboardList = data.rows.length > 0 ? formatDashboardList(
|
|
1001
|
+
data.rows,
|
|
1002
|
+
authorizationData.integrationId,
|
|
1003
|
+
authorizationData.user,
|
|
1004
|
+
dashboardComponent
|
|
1005
|
+
) : [];
|
|
1006
|
+
resolve(dashboardList);
|
|
1007
|
+
});
|
|
1008
|
+
}).catch((error) => {
|
|
1009
|
+
reject(error);
|
|
982
1010
|
});
|
|
983
1011
|
} catch (error) {
|
|
984
1012
|
reject(error);
|
|
985
1013
|
}
|
|
986
|
-
})();
|
|
987
|
-
}
|
|
988
|
-
|
|
989
|
-
try {
|
|
990
|
-
fetchUser.then((authorizationData) => {
|
|
991
|
-
const responsePromise = window.fetch(
|
|
992
|
-
`${String(dashboardComponent.params.apiHost)}0.1.0/securable`,
|
|
993
|
-
{
|
|
994
|
-
method: "POST",
|
|
995
|
-
mode: "cors",
|
|
996
|
-
cache: "no-cache",
|
|
997
|
-
headers: { "Content-Type": "application/json" },
|
|
998
|
-
redirect: "follow",
|
|
999
|
-
body: JSON.stringify({
|
|
1000
|
-
action: "get",
|
|
1001
|
-
version: "0.1.0",
|
|
1002
|
-
key: dashboardComponent.authKey,
|
|
1003
|
-
token: dashboardComponent.authToken,
|
|
1004
|
-
find: {
|
|
1005
|
-
where: { type: "dashboard", is_variant: false },
|
|
1006
|
-
attributes: ["id", "name", "modified_at"],
|
|
1007
|
-
order: [["modified_at", "desc"]],
|
|
1008
|
-
include: [
|
|
1009
|
-
{ model: "Tag", attributes: ["tag"] },
|
|
1010
|
-
{ model: "User", attributes: ["id", "name"] },
|
|
1011
|
-
{
|
|
1012
|
-
model: "Group",
|
|
1013
|
-
attributes: ["id", "name", "public"]
|
|
1014
|
-
},
|
|
1015
|
-
{ model: "Integration", attributes: ["id", "name"] }
|
|
1016
|
-
]
|
|
1017
|
-
}
|
|
1018
|
-
})
|
|
1019
|
-
}
|
|
1020
|
-
);
|
|
1021
|
-
responsePromise.then((response) => response.json()).then((data) => {
|
|
1022
|
-
const dashboardList = data.rows.length > 0 ? formatDashboardList(
|
|
1023
|
-
data.rows,
|
|
1024
|
-
authorizationData.integrationId,
|
|
1025
|
-
authorizationData.user,
|
|
1026
|
-
dashboardComponent
|
|
1027
|
-
) : [];
|
|
1028
|
-
resolve(dashboardList);
|
|
1029
|
-
});
|
|
1030
|
-
}).catch((error) => {
|
|
1031
|
-
reject(error);
|
|
1032
|
-
});
|
|
1033
|
-
} catch (error) {
|
|
1034
|
-
reject(error);
|
|
1035
|
-
}
|
|
1036
|
-
})());
|
|
1014
|
+
})());
|
|
1015
|
+
}
|
|
1016
|
+
throw new Error("No authKey or authToken found in the luzmo-dashboard component.");
|
|
1037
1017
|
};
|
|
1038
1018
|
|
|
1039
1019
|
// libs/embed-libs/shared-embed/src/lib/methods/get-data.ts
|
|
@@ -1922,7 +1902,7 @@ var o5 = e6(class extends i4 {
|
|
|
1922
1902
|
});
|
|
1923
1903
|
|
|
1924
1904
|
// libs/embed-libs/embed/package.json
|
|
1925
|
-
var version = "5.0.
|
|
1905
|
+
var version = "5.0.13-alpha.0";
|
|
1926
1906
|
|
|
1927
1907
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
1928
1908
|
var LuzmoService = class {
|
|
@@ -2222,6 +2202,8 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2222
2202
|
this.browserNotSupported = [];
|
|
2223
2203
|
this.VERSION = version + "-wc-luzmo";
|
|
2224
2204
|
this.isLibraryLoaded = false;
|
|
2205
|
+
this.currentAuthKey = null;
|
|
2206
|
+
this.currentAuthToken = null;
|
|
2225
2207
|
this.attributesMap = {
|
|
2226
2208
|
dashboardId: "dashboard-id",
|
|
2227
2209
|
dashboardSlug: "dashboard-slug",
|
|
@@ -2369,11 +2351,10 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2369
2351
|
this.dashboardReference = oldReference.cloneNode(true);
|
|
2370
2352
|
oldReference.replaceWith(this.dashboardReference);
|
|
2371
2353
|
this.dashboardReference.addEventListener("load", (payload) => {
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
});
|
|
2354
|
+
this.containerWidth = this.dashboardReference.offsetWidth;
|
|
2355
|
+
this.dimensions = payload.detail.dimensions;
|
|
2356
|
+
_setCalculatedDimensions(this);
|
|
2357
|
+
window.dispatchEvent(new Event("resize"));
|
|
2377
2358
|
this.dispatchEvent(new CustomEvent("load", payload));
|
|
2378
2359
|
});
|
|
2379
2360
|
this.dashboardReference.addEventListener("itemsRendered", (payload) => this.dispatchEvent(new CustomEvent("itemsRendered", payload)));
|
|
@@ -2553,6 +2534,8 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2553
2534
|
this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
|
|
2554
2535
|
defaultParameters.apiHost = this.apiHost;
|
|
2555
2536
|
}
|
|
2537
|
+
this.currentAuthKey = this.authKey;
|
|
2538
|
+
this.currentAuthToken = this.authToken;
|
|
2556
2539
|
return defaultParameters;
|
|
2557
2540
|
}
|
|
2558
2541
|
_updateIframeUrl() {
|
|
@@ -2709,6 +2692,8 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2709
2692
|
return Promise.reject();
|
|
2710
2693
|
}
|
|
2711
2694
|
setAuthorization(key, token) {
|
|
2695
|
+
this.currentAuthKey = key;
|
|
2696
|
+
this.currentAuthToken = token;
|
|
2712
2697
|
if (this.getIsViewMode() && this.dashboardReference) {
|
|
2713
2698
|
return this.dashboardReference.setAuthorization(key, token);
|
|
2714
2699
|
}
|
|
@@ -2745,13 +2730,7 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2745
2730
|
return Promise.reject();
|
|
2746
2731
|
}
|
|
2747
2732
|
getAccessibleDashboards() {
|
|
2748
|
-
|
|
2749
|
-
return getAccessibleDashboards(this, this.iframe);
|
|
2750
|
-
}
|
|
2751
|
-
if (this.getIsViewMode() && this.dashboardReference) {
|
|
2752
|
-
return this.dashboardReference.getAccessibleDashboards();
|
|
2753
|
-
}
|
|
2754
|
-
return Promise.reject();
|
|
2733
|
+
return getAccessibleDashboards(this);
|
|
2755
2734
|
}
|
|
2756
2735
|
addFilters(itemId, filters) {
|
|
2757
2736
|
return this.dashboardReference.addFilters(itemId, filters);
|
|
@@ -2947,6 +2926,12 @@ __decorateClass([
|
|
|
2947
2926
|
__decorateClass([
|
|
2948
2927
|
r4()
|
|
2949
2928
|
], LuzmoDashboard.prototype, "dashboardReference", 2);
|
|
2929
|
+
__decorateClass([
|
|
2930
|
+
r4()
|
|
2931
|
+
], LuzmoDashboard.prototype, "currentAuthKey", 2);
|
|
2932
|
+
__decorateClass([
|
|
2933
|
+
r4()
|
|
2934
|
+
], LuzmoDashboard.prototype, "currentAuthToken", 2);
|
|
2950
2935
|
|
|
2951
2936
|
// libs/embed-libs/embed/src/lib/dashboard-component/dashboard-web-component.ts
|
|
2952
2937
|
var LuzmoDashboardWebComponent = class extends LuzmoDashboard {
|
package/luzmo-embed.min.js
CHANGED
|
@@ -912,128 +912,108 @@ var exportDashboard = (dashboardComponent, iframe, format) => {
|
|
|
912
912
|
};
|
|
913
913
|
|
|
914
914
|
// libs/embed-libs/shared-embed/src/lib/methods/get-accessible-dashboards.ts
|
|
915
|
-
var getAccessibleDashboards = (dashboardComponent
|
|
916
|
-
if ((dashboardComponent.
|
|
917
|
-
const
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
915
|
+
var getAccessibleDashboards = (dashboardComponent) => {
|
|
916
|
+
if ((dashboardComponent.currentAuthKey ?? dashboardComponent.authKey) && (dashboardComponent.currentAuthToken ?? dashboardComponent.authToken)) {
|
|
917
|
+
const fetchUser = new Promise((resolve, reject) => {
|
|
918
|
+
void (() => {
|
|
919
|
+
try {
|
|
920
|
+
const responsePromise = window.fetch(
|
|
921
|
+
`${String(dashboardComponent.params.apiHost)}0.1.0/authorization`,
|
|
922
|
+
{
|
|
923
|
+
method: "POST",
|
|
924
|
+
mode: "cors",
|
|
925
|
+
cache: "no-cache",
|
|
926
|
+
headers: { "Content-Type": "application/json" },
|
|
927
|
+
redirect: "follow",
|
|
928
|
+
body: JSON.stringify({
|
|
929
|
+
action: "get",
|
|
930
|
+
version: "0.1.0",
|
|
931
|
+
key: dashboardComponent.currentAuthKey ?? dashboardComponent.authKey,
|
|
932
|
+
token: dashboardComponent.currentAuthToken ?? dashboardComponent.authToken,
|
|
933
|
+
find: {
|
|
934
|
+
where: { id: dashboardComponent.authKey },
|
|
935
|
+
attributes: ["id", "integration_id"],
|
|
936
|
+
include: [
|
|
937
|
+
{
|
|
938
|
+
model: "User",
|
|
939
|
+
attributes: ["id", "name", "locale_id"],
|
|
940
|
+
include: [{ model: "Group" }]
|
|
941
|
+
}
|
|
942
|
+
]
|
|
943
|
+
}
|
|
944
|
+
})
|
|
945
|
+
}
|
|
933
946
|
);
|
|
934
|
-
|
|
947
|
+
responsePromise.then((response) => response.json()).then((data) => {
|
|
948
|
+
if (!data || !data.rows || data.rows.length === 0 || !data.rows[0].user) {
|
|
949
|
+
reject("Authorization failed, please check authKey and authToken. If the problem persists, please contact support@luzmo.com.");
|
|
950
|
+
} else {
|
|
951
|
+
data.rows[0].user.userGroups = data.rows[0].user.groups.map(
|
|
952
|
+
(group) => group.id
|
|
953
|
+
);
|
|
954
|
+
delete data.rows[0].user.groups;
|
|
955
|
+
resolve({
|
|
956
|
+
integrationId: data.rows[0].integration_id,
|
|
957
|
+
user: data.rows[0].user
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
});
|
|
961
|
+
} catch (error) {
|
|
962
|
+
reject(error);
|
|
935
963
|
}
|
|
936
|
-
}
|
|
964
|
+
})();
|
|
937
965
|
});
|
|
938
|
-
|
|
939
|
-
const fetchUser = new Promise((resolve, reject) => {
|
|
940
|
-
void (() => {
|
|
966
|
+
return new Promise((resolve, reject) => void (() => {
|
|
941
967
|
try {
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
}
|
|
968
|
+
fetchUser.then((authorizationData) => {
|
|
969
|
+
const responsePromise = window.fetch(
|
|
970
|
+
`${String(dashboardComponent.params.apiHost)}0.1.0/securable`,
|
|
971
|
+
{
|
|
972
|
+
method: "POST",
|
|
973
|
+
mode: "cors",
|
|
974
|
+
cache: "no-cache",
|
|
975
|
+
headers: { "Content-Type": "application/json" },
|
|
976
|
+
redirect: "follow",
|
|
977
|
+
body: JSON.stringify({
|
|
978
|
+
action: "get",
|
|
979
|
+
version: "0.1.0",
|
|
980
|
+
key: dashboardComponent.currentAuthKey ?? dashboardComponent.authKey,
|
|
981
|
+
token: dashboardComponent.currentAuthToken ?? dashboardComponent.authToken,
|
|
982
|
+
find: {
|
|
983
|
+
where: { type: "dashboard", is_variant: false },
|
|
984
|
+
attributes: ["id", "name", "modified_at"],
|
|
985
|
+
order: [["modified_at", "desc"]],
|
|
986
|
+
include: [
|
|
987
|
+
{ model: "Tag", attributes: ["tag"] },
|
|
988
|
+
{ model: "User", attributes: ["id", "name"] },
|
|
989
|
+
{
|
|
990
|
+
model: "Group",
|
|
991
|
+
attributes: ["id", "name", "public"]
|
|
992
|
+
},
|
|
993
|
+
{ model: "Integration", attributes: ["id", "name"] }
|
|
994
|
+
]
|
|
995
|
+
}
|
|
996
|
+
})
|
|
997
|
+
}
|
|
998
|
+
);
|
|
999
|
+
responsePromise.then((response) => response.json()).then((data) => {
|
|
1000
|
+
const dashboardList = data.rows.length > 0 ? formatDashboardList(
|
|
1001
|
+
data.rows,
|
|
1002
|
+
authorizationData.integrationId,
|
|
1003
|
+
authorizationData.user,
|
|
1004
|
+
dashboardComponent
|
|
1005
|
+
) : [];
|
|
1006
|
+
resolve(dashboardList);
|
|
1007
|
+
});
|
|
1008
|
+
}).catch((error) => {
|
|
1009
|
+
reject(error);
|
|
982
1010
|
});
|
|
983
1011
|
} catch (error) {
|
|
984
1012
|
reject(error);
|
|
985
1013
|
}
|
|
986
|
-
})();
|
|
987
|
-
}
|
|
988
|
-
|
|
989
|
-
try {
|
|
990
|
-
fetchUser.then((authorizationData) => {
|
|
991
|
-
const responsePromise = window.fetch(
|
|
992
|
-
`${String(dashboardComponent.params.apiHost)}0.1.0/securable`,
|
|
993
|
-
{
|
|
994
|
-
method: "POST",
|
|
995
|
-
mode: "cors",
|
|
996
|
-
cache: "no-cache",
|
|
997
|
-
headers: { "Content-Type": "application/json" },
|
|
998
|
-
redirect: "follow",
|
|
999
|
-
body: JSON.stringify({
|
|
1000
|
-
action: "get",
|
|
1001
|
-
version: "0.1.0",
|
|
1002
|
-
key: dashboardComponent.authKey,
|
|
1003
|
-
token: dashboardComponent.authToken,
|
|
1004
|
-
find: {
|
|
1005
|
-
where: { type: "dashboard", is_variant: false },
|
|
1006
|
-
attributes: ["id", "name", "modified_at"],
|
|
1007
|
-
order: [["modified_at", "desc"]],
|
|
1008
|
-
include: [
|
|
1009
|
-
{ model: "Tag", attributes: ["tag"] },
|
|
1010
|
-
{ model: "User", attributes: ["id", "name"] },
|
|
1011
|
-
{
|
|
1012
|
-
model: "Group",
|
|
1013
|
-
attributes: ["id", "name", "public"]
|
|
1014
|
-
},
|
|
1015
|
-
{ model: "Integration", attributes: ["id", "name"] }
|
|
1016
|
-
]
|
|
1017
|
-
}
|
|
1018
|
-
})
|
|
1019
|
-
}
|
|
1020
|
-
);
|
|
1021
|
-
responsePromise.then((response) => response.json()).then((data) => {
|
|
1022
|
-
const dashboardList = data.rows.length > 0 ? formatDashboardList(
|
|
1023
|
-
data.rows,
|
|
1024
|
-
authorizationData.integrationId,
|
|
1025
|
-
authorizationData.user,
|
|
1026
|
-
dashboardComponent
|
|
1027
|
-
) : [];
|
|
1028
|
-
resolve(dashboardList);
|
|
1029
|
-
});
|
|
1030
|
-
}).catch((error) => {
|
|
1031
|
-
reject(error);
|
|
1032
|
-
});
|
|
1033
|
-
} catch (error) {
|
|
1034
|
-
reject(error);
|
|
1035
|
-
}
|
|
1036
|
-
})());
|
|
1014
|
+
})());
|
|
1015
|
+
}
|
|
1016
|
+
throw new Error("No authKey or authToken found in the luzmo-dashboard component.");
|
|
1037
1017
|
};
|
|
1038
1018
|
|
|
1039
1019
|
// libs/embed-libs/shared-embed/src/lib/methods/get-data.ts
|
|
@@ -1922,7 +1902,7 @@ var o5 = e6(class extends i4 {
|
|
|
1922
1902
|
});
|
|
1923
1903
|
|
|
1924
1904
|
// libs/embed-libs/embed/package.json
|
|
1925
|
-
var version = "5.0.
|
|
1905
|
+
var version = "5.0.13-alpha.0";
|
|
1926
1906
|
|
|
1927
1907
|
// libs/embed-libs/embed/src/lib/luzmo-service.ts
|
|
1928
1908
|
var LuzmoService = class {
|
|
@@ -2222,6 +2202,8 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2222
2202
|
this.browserNotSupported = [];
|
|
2223
2203
|
this.VERSION = version + "-wc-luzmo";
|
|
2224
2204
|
this.isLibraryLoaded = false;
|
|
2205
|
+
this.currentAuthKey = null;
|
|
2206
|
+
this.currentAuthToken = null;
|
|
2225
2207
|
this.attributesMap = {
|
|
2226
2208
|
dashboardId: "dashboard-id",
|
|
2227
2209
|
dashboardSlug: "dashboard-slug",
|
|
@@ -2369,11 +2351,10 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2369
2351
|
this.dashboardReference = oldReference.cloneNode(true);
|
|
2370
2352
|
oldReference.replaceWith(this.dashboardReference);
|
|
2371
2353
|
this.dashboardReference.addEventListener("load", (payload) => {
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
});
|
|
2354
|
+
this.containerWidth = this.dashboardReference.offsetWidth;
|
|
2355
|
+
this.dimensions = payload.detail.dimensions;
|
|
2356
|
+
_setCalculatedDimensions(this);
|
|
2357
|
+
window.dispatchEvent(new Event("resize"));
|
|
2377
2358
|
this.dispatchEvent(new CustomEvent("load", payload));
|
|
2378
2359
|
});
|
|
2379
2360
|
this.dashboardReference.addEventListener("itemsRendered", (payload) => this.dispatchEvent(new CustomEvent("itemsRendered", payload)));
|
|
@@ -2553,6 +2534,8 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2553
2534
|
this.apiHost = this.appServer.includes("luzmo.com") ? this.appServer.replace("app", "api") : this.appServer;
|
|
2554
2535
|
defaultParameters.apiHost = this.apiHost;
|
|
2555
2536
|
}
|
|
2537
|
+
this.currentAuthKey = this.authKey;
|
|
2538
|
+
this.currentAuthToken = this.authToken;
|
|
2556
2539
|
return defaultParameters;
|
|
2557
2540
|
}
|
|
2558
2541
|
_updateIframeUrl() {
|
|
@@ -2709,6 +2692,8 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2709
2692
|
return Promise.reject();
|
|
2710
2693
|
}
|
|
2711
2694
|
setAuthorization(key, token) {
|
|
2695
|
+
this.currentAuthKey = key;
|
|
2696
|
+
this.currentAuthToken = token;
|
|
2712
2697
|
if (this.getIsViewMode() && this.dashboardReference) {
|
|
2713
2698
|
return this.dashboardReference.setAuthorization(key, token);
|
|
2714
2699
|
}
|
|
@@ -2745,13 +2730,7 @@ var LuzmoDashboard = class extends s3 {
|
|
|
2745
2730
|
return Promise.reject();
|
|
2746
2731
|
}
|
|
2747
2732
|
getAccessibleDashboards() {
|
|
2748
|
-
|
|
2749
|
-
return getAccessibleDashboards(this, this.iframe);
|
|
2750
|
-
}
|
|
2751
|
-
if (this.getIsViewMode() && this.dashboardReference) {
|
|
2752
|
-
return this.dashboardReference.getAccessibleDashboards();
|
|
2753
|
-
}
|
|
2754
|
-
return Promise.reject();
|
|
2733
|
+
return getAccessibleDashboards(this);
|
|
2755
2734
|
}
|
|
2756
2735
|
addFilters(itemId, filters) {
|
|
2757
2736
|
return this.dashboardReference.addFilters(itemId, filters);
|
|
@@ -2947,6 +2926,12 @@ __decorateClass([
|
|
|
2947
2926
|
__decorateClass([
|
|
2948
2927
|
r4()
|
|
2949
2928
|
], LuzmoDashboard.prototype, "dashboardReference", 2);
|
|
2929
|
+
__decorateClass([
|
|
2930
|
+
r4()
|
|
2931
|
+
], LuzmoDashboard.prototype, "currentAuthKey", 2);
|
|
2932
|
+
__decorateClass([
|
|
2933
|
+
r4()
|
|
2934
|
+
], LuzmoDashboard.prototype, "currentAuthToken", 2);
|
|
2950
2935
|
|
|
2951
2936
|
// libs/embed-libs/embed/src/lib/dashboard-component/dashboard-component.ts
|
|
2952
2937
|
var LuzmoDashboard2 = class extends LuzmoDashboard {
|