hotstaq 0.8.21 → 0.8.22

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.
@@ -90,7 +90,7 @@ void 0,void 0,function*(){for(;!1===y.isReadyForTesting;)yield y.wait(10);null!=
90
90
  (h+='<script type = "text/javascript">\nfunction hotstaq_isDocumentReady ()\n{\nif (window["Hot"] != null)\n{\nif (Hot.Mode === HotStaqWeb.DeveloperMode.Development)\n{\nlet func = function ()\n\t{\n\t\tif (Hot.TesterAPI != null)\n\t\t{\n\t\t\tlet testPaths = {};\n\t\t\tlet testElements = JSON.stringify (Hot.CurrentPage.testElements);\n\t\t\tlet testMaps = JSON.stringify (Hot.CurrentPage.testMaps);\n\n\t\t\tfor (let key in Hot.CurrentPage.testPaths)\n\t\t\t{\n\t\t\t\tlet testPath = Hot.CurrentPage.testPaths[key];\n\n\t\t\t\ttestPaths[key] = testPath.toString ();\n\t\t\t}\n\n\t\t\tlet testPathsStr = JSON.stringify (testPaths);\n\n\t\t\tHot.TesterAPI.tester.pageLoaded ({\n\t\t\t\t\ttesterName: Hot.CurrentPage.testerName,\n\t\t\t\t\ttesterMap: Hot.CurrentPage.testerMap,\n\t\t\t\t\tpageName: Hot.CurrentPage.name,\n\t\t\t\t\ttestElements: testElements,\n\t\t\t\t\ttestPaths: testPathsStr\n\t\t\t\t}).then (function (resp)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (resp.error != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (resp.error !== "")\n\t\t\t\t\t\t\t\tthrow new Error (resp.error);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tHotStaqWeb.HotStaq.isReadyForTesting = true;\n\t\t\t\t\t});\n\t\t}\n\t};\n\nif ((document.readyState === "complete") || (document.readyState === "interactive"))\n\tfunc ();\nelse\n\tdocument.addEventListener ("DOMContentLoaded", func);\n}\n}\n}\n\nhotstaq_isDocumentReady ();\n\x3c/script>'),
91
91
  h}static displayUrl(b,h=null,t=null,x=null){return A(this,void 0,void 0,function*(){return new Promise((H,I)=>{y.onReady(()=>A(this,void 0,void 0,function*(){var C={url:""};C.name=null==h?"string"==typeof b?b:b.name:h;""===C.name&&(C.name="string"==typeof b?b:b.name);"string"==typeof b?C.url=b:(C.url=b.url,null==t&&null!=b.processor&&(t=b.processor),null==x&&null!=b.args&&(x=b.args),null!=b.testerMap&&(C.testerMap=b.testerMap),null!=b.testerName&&(C.testerName=b.testerName),null!=b.testerAPIBaseUrl&&
92
92
  (C.testerAPIBaseUrl=b.testerAPIBaseUrl));null==t&&(t=new y);y.setupTesters(t,C);C.processor=t;C.args=x;0>C.url.indexOf("hstqserve")&&(C.url+="?hstqserve=nahfam");C=yield y.processUrl(C);C+=y.setupClientTesters(t);yield y.useOutput(C);H(t)}))})})}static displayContent(b,h=null,t=null,x=null){return A(this,void 0,void 0,function*(){return new Promise((H,I)=>{y.onReady(()=>A(this,void 0,void 0,function*(){var C={content:""};C.name=null==h?"string"==typeof b?"":b.name:h;""===C.name&&(C.name="string"==
93
- typeof b?"":b.name);"string"==typeof b?C.content=b:(C.content=b.content,null==t&&null!=b.processor&&(t=b.processor),null==x&&null!=b.args&&(x=b.args),null!=b.testerMap&&(C.testerMap=b.testerMap),null!=b.testerName&&(C.testerName=b.testerName),null!=b.testerAPIBaseUrl&&(C.testerAPIBaseUrl=b.testerAPIBaseUrl));null==t&&(t=new y);y.setupTesters(t,C);C.processor=t;C.args=x;C=yield y.processContent(C);yield y.useOutput(C);H(t)}))})})}}u.HotStaq=y;y.version="0.8.21";y.isWeb=!1;y.isReadyForTesting=!1;y.onReadyForTesting=
93
+ typeof b?"":b.name);"string"==typeof b?C.content=b:(C.content=b.content,null==t&&null!=b.processor&&(t=b.processor),null==x&&null!=b.args&&(x=b.args),null!=b.testerMap&&(C.testerMap=b.testerMap),null!=b.testerName&&(C.testerName=b.testerName),null!=b.testerAPIBaseUrl&&(C.testerAPIBaseUrl=b.testerAPIBaseUrl));null==t&&(t=new y);y.setupTesters(t,C);C.processor=t;C.args=x;C=yield y.processContent(C);yield y.useOutput(C);H(t)}))})})}}u.HotStaq=y;y.version="0.8.22";y.isWeb=!1;y.isReadyForTesting=!1;y.onReadyForTesting=
94
94
  null;y.errors={};"undefined"!=typeof document&&window.addEventListener("load",p.hotStaqWebStart)},638:(G,u,p)=>{Object.defineProperty(u,"__esModule",{value:!0});u.registerComponent=void 0;const m=p(732),v=p(260),A=p(243),g=p(507);u.registerComponent=function(e,n){if(null==e||""===e)throw Error("All components must have a tag!");if(void 0===customElements.get(e)){var l=this.components;customElements.define(e,class extends HTMLElement{constructor(){super();var c=l[e];if(this.component=new c.componentType(c.processor,
95
95
  c.api),this.hotComponent=this.component,this.component.htmlElements=[this],this.component.inner=this.innerHTML,null!=this.component.handleAttributes)this.component.handleAttributes(this.attributes);else for(c=0;c<this.attributes.length;c++){var a=this.attributes[c],f=a.name.toLowerCase();a=a.value;if("id"===f&&(this.component.name=a),"name"===f&&(this.component.name=a),"value"===f&&(this.component.value=a),-1<f.indexOf("hot-"))f=f.substring(4),this.component[f]=a}if(null==this.component.onPreOutput||
96
96
  !1!==this.component.onPreOutput())for(f=this.component.output(),null!=this.component.onPostOutput&&(f=this.component.onPostOutput(f)),c=[],"string"==typeof f?c.push({html:f}):c=f instanceof Array?f:[f],f=0;f<c.length;f++){a=c[f];var d=a.html,k="";null!=a.addFunctionsTo&&(k=a.addFunctionsTo);d=m.HotFile.parseContent(d,!0,{outputCommands:!1});null!=this.component.onParsed&&(d=this.component.onParsed(d));var r={fixedStr:"",querySelector:""};r=null!=this.component.onFixHTML?this.component.onFixHTML(d):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hotstaq",
3
- "version": "0.8.21",
3
+ "version": "0.8.22",
4
4
  "description": "A friendly web framework that fits nicely into devops and CI/CD pipelines.",
5
5
  "bin": {
6
6
  "hotstaq": "./bin/hotstaq"
@@ -130,6 +130,9 @@ export class HotGenerator
130
130
  res.json ({ "status": "ok" });
131
131
  });
132
132
 
133
+ if (server.api.onPreRegister != null)
134
+ await server.api.onPreRegister ();
135
+
133
136
  //server.serverType = "API Server";
134
137
  //await server.listen ();
135
138
 
@@ -387,6 +390,8 @@ export class HotGenerator
387
390
  if (route.description != null)
388
391
  routeDescription = route.description;
389
392
 
393
+ this.logger.verbose (`Generating Route ${routeName}...`);
394
+
390
395
  for (let iJdx = 0; iJdx < route.methods.length; iJdx++)
391
396
  {
392
397
  let method: HotRouteMethod = route.methods[iJdx];
@@ -398,6 +403,9 @@ export class HotGenerator
398
403
  };
399
404
  let component: any = null;
400
405
  let componentName: string = "";
406
+
407
+ this.logger.verbose (`Generating method ${methodName} at path ${path}`);
408
+
401
409
  let getChildParameters = (param: HotRouteMethodParameter): any =>
402
410
  {
403
411
  let createdObj: any = {
@@ -552,6 +560,7 @@ export class HotGenerator
552
560
  fileContent = yamldoc.toString ();
553
561
  }
554
562
 
563
+ this.logger.verbose (`Writing to file ${outputFile}${outputFileExtension}`);
555
564
  await HotIO.writeTextFile (`${outputFile}${outputFileExtension}`, fileContent);
556
565
 
557
566
  this.logger.info (`Finished generating API Documentation "${key}" from HotSite "${hotsite.name}"...`);
package/src/HotStaq.ts CHANGED
@@ -131,7 +131,7 @@ export class HotStaq implements IHotStaq
131
131
  /**
132
132
  * The current version of HotStaq.
133
133
  */
134
- static version: string = "0.8.21";
134
+ static version: string = "0.8.22";
135
135
  /**
136
136
  * Indicates if this is a web build.
137
137
  */
@@ -15,11 +15,16 @@ export class HotWebSocketClient
15
15
  * The connected socket.
16
16
  */
17
17
  socket: Socket;
18
+ /**
19
+ * Any data that this client socket should contain.
20
+ */
21
+ persistentData: any;
18
22
 
19
23
  constructor (webSocketServer: HotWebSocketServer, socket: Socket)
20
24
  {
21
25
  this.webSocketServer = webSocketServer;
22
26
  this.socket = socket;
27
+ this.persistentData = {};
23
28
  }
24
29
 
25
30
  /**