@xpert-ai/plugin-live-dashboard 0.7.1 → 0.7.3
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/.xpertai-plugin/plugin.json +1 -1
- package/dist/lib/artifact-type.provider.js +38 -1
- package/dist/lib/dashboard-download-policy.d.ts +4 -0
- package/dist/lib/dashboard-download-policy.js +7 -0
- package/dist/lib/document-host.d.ts +1 -1
- package/dist/lib/document-host.js +2 -1
- package/dist/remote/app.js +14 -14
- package/dist/remote/build-manifest.json +8 -7
- package/dist/sandbox-actions/action.json +1 -1
- package/dist/sandbox-actions/bundle/host.js +2 -2
- package/docs/html-mode.md +1 -1
- package/package.json +5 -5
|
@@ -1,10 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
2
18
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
19
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
20
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
21
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
22
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
23
|
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
8
41
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
42
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
43
|
};
|
|
@@ -16,12 +49,16 @@ exports.DashboardArtifactType = void 0;
|
|
|
16
49
|
const dashboard_artifact_1 = require("./dashboard-artifact");
|
|
17
50
|
const dashboard_queries_1 = require("./dashboard-queries");
|
|
18
51
|
const dashboard_service_1 = require("./dashboard.service");
|
|
52
|
+
const hostSdk = __importStar(require("@xpert-ai/plugin-sdk"));
|
|
19
53
|
const common_1 = require("@nestjs/common");
|
|
20
54
|
const plugin_sdk_1 = require("@xpert-ai/plugin-sdk");
|
|
21
55
|
const document_package_1 = require("./document-package");
|
|
22
56
|
const dashboard_sharing_1 = require("./dashboard-sharing");
|
|
23
57
|
const content_type_1 = require("./content-type");
|
|
24
58
|
const dashboard_icon_1 = require("./dashboard-icon");
|
|
59
|
+
const dashboard_download_policy_1 = require("./dashboard-download-policy");
|
|
60
|
+
// The host supplies the SDK. Older hosts reject unknown presentation fields at registration.
|
|
61
|
+
const sdk = hostSdk;
|
|
25
62
|
/** Drafts require Project edit access; explicit authenticated shares may expand formal-version readership. */
|
|
26
63
|
let DashboardArtifactType = class DashboardArtifactType {
|
|
27
64
|
constructor(runtime, dashboards) {
|
|
@@ -37,7 +74,7 @@ let DashboardArtifactType = class DashboardArtifactType {
|
|
|
37
74
|
useGrants: { audience: 'group', permission: 'read', queryOperations: ['query', 'query-binding'] },
|
|
38
75
|
sharing: { projectAccess: 'link-audience', accessModes: ['organization_all'], versionModes: ['latest', 'version'],
|
|
39
76
|
allowDownload: false, mutableLinks: true, descriptor: true, shareKey: dashboard_sharing_1.DASHBOARD_SHARE_KEY },
|
|
40
|
-
presentation: { mode: 'authenticated' }
|
|
77
|
+
presentation: sdk.authenticatedArtifactPresentation?.(dashboard_download_policy_1.DASHBOARD_DOWNLOAD_POLICY) ?? { mode: 'authenticated' }
|
|
41
78
|
};
|
|
42
79
|
this.analytics = {
|
|
43
80
|
resolveBindings: context => (0, dashboard_artifact_1.readDashboardArtifact)(context).manifest.bindings.map(binding => ({ binding })),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DASHBOARD_FRAME_SANDBOX = exports.DASHBOARD_DOWNLOAD_POLICY = void 0;
|
|
4
|
+
exports.DASHBOARD_DOWNLOAD_POLICY = Object.freeze({
|
|
5
|
+
allowDownloads: true
|
|
6
|
+
});
|
|
7
|
+
exports.DASHBOARD_FRAME_SANDBOX = exports.DASHBOARD_DOWNLOAD_POLICY.allowDownloads ? 'allow-scripts allow-downloads' : 'allow-scripts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type ArtifactDocumentHostOptions } from '@xpert-ai/plugin-sdk/artifact-document';
|
|
2
2
|
/** The HTML never supplies or overrides its network permissions. */
|
|
3
|
-
export declare function mountDashboardDocument<T>(frame: HTMLIFrameElement, options: ArtifactDocumentHostOptions<T>): import("@xpert-ai/plugin-sdk/artifact-document").ArtifactDocumentHost;
|
|
3
|
+
export declare function mountDashboardDocument<T>(frame: HTMLIFrameElement, options: Omit<ArtifactDocumentHostOptions<T>, 'allowDownloads'>): import("@xpert-ai/plugin-sdk/artifact-document").ArtifactDocumentHost;
|
|
4
4
|
export declare function isDashboardResourceAllowed(resourceType: string, url: string): boolean;
|
|
@@ -4,9 +4,10 @@ exports.mountDashboardDocument = mountDashboardDocument;
|
|
|
4
4
|
exports.isDashboardResourceAllowed = isDashboardResourceAllowed;
|
|
5
5
|
const artifact_document_1 = require("@xpert-ai/plugin-sdk/artifact-document");
|
|
6
6
|
const document_network_1 = require("./document-network");
|
|
7
|
+
const dashboard_download_policy_1 = require("./dashboard-download-policy");
|
|
7
8
|
/** The HTML never supplies or overrides its network permissions. */
|
|
8
9
|
function mountDashboardDocument(frame, options) {
|
|
9
|
-
return (0, artifact_document_1.mountArtifactDocument)(frame, { ...options, dispatchesPerMinute: 60, networkPolicy: document_network_1.DASHBOARD_NETWORK_POLICY });
|
|
10
|
+
return (0, artifact_document_1.mountArtifactDocument)(frame, { ...options, ...dashboard_download_policy_1.DASHBOARD_DOWNLOAD_POLICY, dispatchesPerMinute: 60, networkPolicy: document_network_1.DASHBOARD_NETWORK_POLICY });
|
|
10
11
|
}
|
|
11
12
|
function isDashboardResourceAllowed(resourceType, url) {
|
|
12
13
|
return (0, artifact_document_1.isArtifactDocumentResourceAllowed)(document_network_1.DASHBOARD_NETWORK_POLICY, resourceType, url);
|