global.webapis.getPackageId = () => {
return this.packageId;
}
+ this.initEdgeWebapis();
this.initProductWebapis();
}
+ initEdgeWebapis() {
+ if (wrt['edge'] && !global.webapis.edge) {
+ let edge = wrt.edge as NativeWRTjs.EdgeExtension;
+ global.webapis.edge = {
+ orchestrationGetDevicelist: (service_name: string, exec_type: string) => {
+ return edge.orchestrationGetDevicelist(service_name, exec_type);
+ },
+ orchestrationReadCapability: (ip: string) => {
+ return edge.orchestrationReadCapability(ip);
+ },
+ orchestrationRequestService: (app_name: string, self_select: boolean, exec_type: string, exec_parameter: string) => {
+ return edge.orchestrationRequestService(app_name, self_select, exec_type, exec_parameter);
+ },
+ orchestrationRequestServiceOnDevice: (app_name: string, self_select: boolean, exec_type: string, exec_parameter: string, ip: string) => {
+ return edge.orchestrationRequestServiceOnDevice(app_name, self_select, exec_type, exec_parameter, ip);
+ },
+ orchestrationWriteCapability: (json: string) => {
+ return edge.orchestrationWriteCapability(json);
+ },
+ }
+ Object.defineProperty(global.webapis, 'edge', { writable: false, enumerable: true });
+ }
+ }
+
initProductWebapis() {
// for TV profile
if (wrt.tv && !global.webapis.productinfo) {