@bigtest/agent
Advanced tools
Comparing version 0.0.0-test3 to 0.1.0-034e719
@@ -1,2 +0,2 @@ | ||
import*as t from"express";import{join as e}from"path";class r{constructor(t,e,r){this.agentAppURL=t,this.connectBackURL=e,this.http=r}get connectURL(){return this.agentAppURL+"/?connectTo="+this.connectBackURL}get harnessScriptURL(){return this.agentAppURL+"/harness.js"}static*create(s,c,o){void 0===o&&(o=e(__dirname,"app"));var a=t,i=a().use((t,e,r)=>{t.query.connectTo?r():e.redirect(t.url+"?connectTo="+s)}).use(a.static(o)),p=yield function(t,e){return r=>{var{resume:n,fail:s}=r,c=t.listen(e,t=>{t?s(t):n(c)})}}(i,c),h=p.address();return(yield n).ensure(()=>p.close()),new r("http://localhost:"+h.port,s,p)}static*external(t,e){return new URL(t),new r(t,e)}join(){return t=>{var{resume:e,ensure:r}=t;this.http&&(this.http.on("close",e),r(()=>this.http.off("close",e)))}}}var n=t=>{var{resume:e,context:{parent:r}}=t;return e(r.parent)};export{r as AgentServer}; | ||
import*as t from"express";import{join as r}from"path";class e{constructor(t,r){this.url=t,this.appDir=r}static create(t,s){if(void 0===s&&(s=r(__dirname,"app")),t.externalURL)return new e(t.externalURL,s);if(!t.port)throw new Error("An agent server must be created with either an external url or a port number");return new n(t.port,s)}connectURL(t){return this.url+"/?connectTo="+encodeURIComponent(t)}get harnessScriptURL(){return this.url+"/harness.js"}*listen(){}*join(){yield}}class n extends e{constructor(t,r){super("http://localhost:"+t,r),this.port=t}*listen(){var r=t,e=r().use(r.static(this.appDir)),n=yield function(t,r){return e=>{var{resume:n,fail:s}=e,o=t.listen(r,t=>{t?s(t):n(o)})}}(e,this.port);this.http=n,(yield s).ensure(()=>n.close())}join(){return t=>{var{resume:r,ensure:e}=t;if(!this.http)throw new Error("cannot join a server that is not already listening");this.http.on("close",r),e(()=>this.http.off("close",r))}}}var s=t=>{var{resume:r,context:{parent:e}}=t;return r(e.parent)};export{e as AgentServer}; | ||
//# sourceMappingURL=agent.esm.js.map |
@@ -1,2 +0,2 @@ | ||
import*as t from"express";import{join as e}from"path";class r{constructor(t,e,r){this.agentAppURL=t,this.connectBackURL=e,this.http=r}get connectURL(){return this.agentAppURL+"/?connectTo="+this.connectBackURL}get harnessScriptURL(){return this.agentAppURL+"/harness.js"}static*create(s,c,o){void 0===o&&(o=e(__dirname,"app"));var a=t,i=a().use((t,e,r)=>{t.query.connectTo?r():e.redirect(t.url+"?connectTo="+s)}).use(a.static(o)),p=yield function(t,e){return r=>{var{resume:n,fail:s}=r,c=t.listen(e,t=>{t?s(t):n(c)})}}(i,c),h=p.address();return(yield n).ensure(()=>p.close()),new r("http://localhost:"+h.port,s,p)}static*external(t,e){return new URL(t),new r(t,e)}join(){return t=>{var{resume:e,ensure:r}=t;this.http&&(this.http.on("close",e),r(()=>this.http.off("close",e)))}}}var n=t=>{var{resume:e,context:{parent:r}}=t;return e(r.parent)};export{r as AgentServer}; | ||
import*as t from"express";import{join as r}from"path";class e{constructor(t,r){this.url=t,this.appDir=r}static create(t,s){if(void 0===s&&(s=r(__dirname,"app")),t.externalURL)return new e(t.externalURL,s);if(!t.port)throw new Error("An agent server must be created with either an external url or a port number");return new n(t.port,s)}connectURL(t){return this.url+"/?connectTo="+encodeURIComponent(t)}get harnessScriptURL(){return this.url+"/harness.js"}*listen(){}*join(){yield}}class n extends e{constructor(t,r){super("http://localhost:"+t,r),this.port=t}*listen(){var r=t,e=r().use(r.static(this.appDir)),n=yield function(t,r){return e=>{var{resume:n,fail:s}=e,o=t.listen(r,t=>{t?s(t):n(o)})}}(e,this.port);this.http=n,(yield s).ensure(()=>n.close())}join(){return t=>{var{resume:r,ensure:e}=t;if(!this.http)throw new Error("cannot join a server that is not already listening");this.http.on("close",r),e(()=>this.http.off("close",r))}}}var s=t=>{var{resume:r,context:{parent:e}}=t;return r(e.parent)};export{e as AgentServer}; | ||
//# sourceMappingURL=agent.modern.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("express"),require("path")):"function"==typeof define&&define.amd?define(["exports","express","path"],t):t((e=e||self).agent={},e.express,e.path)}(this,function(e,t,n){class r{constructor(e,t,n){this.agentAppURL=e,this.connectBackURL=t,this.http=n}get connectURL(){return this.agentAppURL+"/?connectTo="+this.connectBackURL}get harnessScriptURL(){return this.agentAppURL+"/harness.js"}static*create(e,o,c){void 0===c&&(c=n.join(__dirname,"app"));var i=t,a=i().use((t,n,r)=>{t.query.connectTo?r():n.redirect(t.url+"?connectTo="+e)}).use(i.static(c)),p=yield function(e,t){return n=>{var{resume:r,fail:s}=n,o=e.listen(t,e=>{e?s(e):r(o)})}}(a,o),u=p.address();return(yield s).ensure(()=>p.close()),new r("http://localhost:"+u.port,e,p)}static*external(e,t){return new URL(e),new r(e,t)}join(){return e=>{var{resume:t,ensure:n}=e;this.http&&(this.http.on("close",t),n(()=>this.http.off("close",t)))}}}var s=e=>{var{resume:t,context:{parent:n}}=e;return t(n.parent)};e.AgentServer=r}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("express"),require("path")):"function"==typeof define&&define.amd?define(["exports","express","path"],t):t((e=e||self).agent={},e.express,e.path)}(this,function(e,t,r){class n{constructor(e,t){this.url=e,this.appDir=t}static create(e,t){if(void 0===t&&(t=r.join(__dirname,"app")),e.externalURL)return new n(e.externalURL,t);if(!e.port)throw new Error("An agent server must be created with either an external url or a port number");return new s(e.port,t)}connectURL(e){return this.url+"/?connectTo="+encodeURIComponent(e)}get harnessScriptURL(){return this.url+"/harness.js"}*listen(){}*join(){yield}}class s extends n{constructor(e,t){super("http://localhost:"+e,t),this.port=e}*listen(){var e=t,r=e().use(e.static(this.appDir)),n=yield function(e,t){return r=>{var{resume:n,fail:s}=r,i=e.listen(t,e=>{e?s(e):n(i)})}}(r,this.port);this.http=n,(yield i).ensure(()=>n.close())}join(){return e=>{var{resume:t,ensure:r}=e;if(!this.http)throw new Error("cannot join a server that is not already listening");this.http.on("close",t),r(()=>this.http.off("close",t))}}}var i=e=>{var{resume:t,context:{parent:r}}=e;return t(r.parent)};e.AgentServer=n}); | ||
//# sourceMappingURL=agent.umd.js.map |
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"AyCt":[function(require,module,exports) { | ||
console.log("[harness] hello from harness"),window.parent.postMessage("message from harness","*"),window.addEventListener("message",function(e){console.log("[harness] received message:",e.data)}); | ||
var e=regeneratorRuntime.mark(n);function n(n){var s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:(s=document.createElement("script")).src=n,s.addEventListener("load",function(){console.log("[agent] loaded test manifest",__bigtestManifest)}),document.body.appendChild(s);case 4:case"end":return e.stop()}},e)}console.log("[harness] hello from harness"),window.parent.postMessage("message from harness","*"),window.addEventListener("message",function(e){console.log("[harness] received message:",e.data)}); | ||
},{}]},{},["AyCt"], null) | ||
//# sourceMappingURL=/harness.js.map |
import { Operation } from 'effection'; | ||
interface Options { | ||
port: number; | ||
externalURL?: string; | ||
} | ||
export declare class AgentServer { | ||
agentAppURL: string; | ||
private connectBackURL?; | ||
private http?; | ||
private constructor(); | ||
get connectURL(): string; | ||
url: string; | ||
protected appDir: string; | ||
protected constructor(url: string, appDir: string); | ||
static create(options: Options, appDir?: string): AgentServer; | ||
connectURL(connectBackURL: string): string; | ||
get harnessScriptURL(): string; | ||
static create(connectBackURL: string, port?: number, appDir?: string): Operation; | ||
static external(agentServerURL: string, connectBackURL: string): Operation; | ||
listen(): Operation; | ||
join(): Operation; | ||
} | ||
export {}; |
{ | ||
"name": "@bigtest/agent", | ||
"version": "0.0.0-test3", | ||
"version": "0.1.0-034e719", | ||
"description": "Agent for connecting test environments (browsers) to BigTest", | ||
@@ -16,6 +16,5 @@ "main": "dist/agent.umd.js", | ||
"scripts": { | ||
"lint": "eslint 'src/**/*.ts' 'bin/**/*.ts'", | ||
"lint": "eslint '**/*.ts'", | ||
"test": "mocha -r ts-node/register test/**/*.test.ts", | ||
"start": "ts-node bin/start.ts", | ||
"build": "echo 'build'", | ||
"bundle": "parcel watch --out-dir dist/app app/index.html", | ||
@@ -38,2 +37,3 @@ "prepack": "microbundle --entry index.ts --output dist --format modern,es,umd && parcel build --out-dir dist/app app/index.html app/harness.ts" | ||
"parcel-bundler": "^1.12.4", | ||
"regenerator-runtime": "^0.13.3", | ||
"ts-node": "*", | ||
@@ -46,3 +46,3 @@ "typescript": "^3.7.0" | ||
"bowser": "^2.9.0", | ||
"effection": "^0.5.0", | ||
"effection": "^0.5.1", | ||
"express": "^4.17.1" | ||
@@ -52,4 +52,4 @@ }, | ||
"node": "12.16.0", | ||
"yarn": "1.2.0" | ||
"yarn": "1.19.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
209987
15
261
16
2
Updatedeffection@^0.5.1