@ms-cloudpack/link-proxy 0.2.0 → 0.2.2

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UIManager.js","sourceRoot":"","sources":["../src/UIManager.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAE5C;;GAEG;AACH,MAAM,OAAO,SAAS;IACZ,OAAO,CAAqB;IAEpC,YAAY,YAAoB,MAAM;QACpC,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,KAA2E;QACtF,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,GAAG,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;QAEtD,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC/D,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC/D,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO;QAE1B,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG;kBACX,MAAM,CAAC,eAAe,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;mBACpE,MAAM,CAAC,KAAK;kBACb,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO;QAC/D,GAAG,CAAC,CAAC,CAAC,aAAa,MAAM,CAAC,OAAO,2BAA2B,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE;kBAChE,MAAM,CAAC,OAAO;;GAE7B,CAAC;IACF,CAAC;CACF","sourcesContent":["import styles from './UIManager.module.css';\n\n/**\n * UI Manager for handling status display\n */\nexport class UIManager {\n private element: HTMLElement | null;\n\n constructor(elementId: string = 'root') {\n this.element = document.getElementById(elementId);\n }\n\n /**\n * Display a status message to the user\n */\n updateStatus(input: { message: string; tip?: string; isError?: boolean; data?: unknown }): void {\n const { message, tip, isError = false, data } = input;\n\n if (isError) {\n data ? console.error(message, data) : console.error(message);\n } else {\n data ? console.debug(message, data) : console.debug(message);\n }\n\n if (!this.element) return;\n\n this.element.innerHTML = `\n <div class=\"${styles.statusContainer + (isError ? ` ${styles.errorContainer}` : '')}\">\n <h2 class=\"${styles.title}\">Cloudpack Link Proxy</h2>\n <p class=\"${styles.message}\">${isError ? 'Error: ' : ''}${message}</p>\n ${tip ? `<p class=\"${styles.message}\"><strong>Tip:</strong> ${tip}</p>` : ''}\n <p class=\"${styles.warning}\">Do not close this page while Cloudpack link is running.</p>\n </div>\n `;\n }\n}\n"]}
package/lib/index.js CHANGED
@@ -1,11 +1,5 @@
1
- import { linkUpdateSource } from '@ms-cloudpack/api-server/browser';
2
- function start() {
3
- const element = window.document.getElementById('root');
4
- if (!element) {
5
- throw new Error('No root element found');
6
- }
7
- console.debug(linkUpdateSource);
8
- element.innerHTML = '<p>Cloudpack Link Proxy is in development. Please check back later.</p>';
9
- }
10
- start();
1
+ import { LinkProxyApp } from './LinkProxyApp.js';
2
+ // Start the application
3
+ const app = new LinkProxyApp();
4
+ void app.initialize();
11
5
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,SAAS,KAAK;IACZ,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAEvD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAEhC,OAAO,CAAC,SAAS,GAAG,yEAAyE,CAAC;AAChG,CAAC;AAED,KAAK,EAAE,CAAC","sourcesContent":["import { linkUpdateSource } from '@ms-cloudpack/api-server/browser';\n\nfunction start(): void {\n const element = window.document.getElementById('root');\n\n if (!element) {\n throw new Error('No root element found');\n }\n\n console.debug(linkUpdateSource);\n\n element.innerHTML = '<p>Cloudpack Link Proxy is in development. Please check back later.</p>';\n}\n\nstart();\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,wBAAwB;AACxB,MAAM,GAAG,GAAG,IAAI,YAAY,EAAE,CAAC;AAC/B,KAAK,GAAG,CAAC,UAAU,EAAE,CAAC","sourcesContent":["import { LinkProxyApp } from './LinkProxyApp.js';\n\n// Start the application\nconst app = new LinkProxyApp();\nvoid app.initialize();\n"]}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Check if an API server is active at the given URL
3
+ */
4
+ export declare function isApiServerActive(url: string): Promise<boolean>;
5
+ //# sourceMappingURL=isApiServerActive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isApiServerActive.d.ts","sourceRoot":"","sources":["../src/isApiServerActive.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAcrE"}
@@ -0,0 +1,20 @@
1
+ import { createCloudpackClient } from '@ms-cloudpack/api-server/browser';
2
+ /**
3
+ * Check if an API server is active at the given URL
4
+ */
5
+ export async function isApiServerActive(url) {
6
+ console.debug(`[Cloudpack] Checking session at ${url}`);
7
+ const client = await createCloudpackClient({ url });
8
+ let isActive = false;
9
+ try {
10
+ isActive = !!(await client.getSessionId.query());
11
+ }
12
+ catch (e) {
13
+ /* no-op */
14
+ }
15
+ finally {
16
+ await client.close();
17
+ }
18
+ return isActive;
19
+ }
20
+ //# sourceMappingURL=isApiServerActive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isApiServerActive.js","sourceRoot":"","sources":["../src/isApiServerActive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,GAAW;IACjD,OAAO,CAAC,KAAK,CAAC,mCAAmC,GAAG,EAAE,CAAC,CAAC;IAExD,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IACpD,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,IAAI,CAAC;QACH,QAAQ,GAAG,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC;IACnD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,WAAW;IACb,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { createCloudpackClient } from '@ms-cloudpack/api-server/browser';\n\n/**\n * Check if an API server is active at the given URL\n */\nexport async function isApiServerActive(url: string): Promise<boolean> {\n console.debug(`[Cloudpack] Checking session at ${url}`);\n\n const client = await createCloudpackClient({ url });\n let isActive = false;\n try {\n isActive = !!(await client.getSessionId.query());\n } catch (e) {\n /* no-op */\n } finally {\n await client.close();\n }\n\n return isActive;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/link-proxy",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "A proxy to connect link clients.",
5
5
  "license": "MIT",
6
6
  "types": "./lib/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "prepack": "cp .npmignore dist/.npmignore"
24
24
  },
25
25
  "devDependencies": {
26
- "@ms-cloudpack/api-server": "^0.62.0",
26
+ "@ms-cloudpack/api-server": "^0.63.0",
27
27
  "@ms-cloudpack/common-types-browser": "^0.5.6",
28
28
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
29
29
  "@ms-cloudpack/scripts": "^0.0.1"