unplugin-dingtalk 1005.0.0 → 1006.0.0

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,115 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/__chrome_devtools.ts
21
+ var chrome_devtools_exports = {};
22
+ __export(chrome_devtools_exports, {
23
+ getChromeDevtoolsHtml: () => getChromeDevtoolsHtml
24
+ });
25
+ module.exports = __toCommonJS(chrome_devtools_exports);
26
+ function getChromeDevtoolsHtml(targetPort) {
27
+ return `<!DOCTYPE html>
28
+ <html>
29
+
30
+ <head>
31
+ <meta charset="utf-8">
32
+ <title>DevTools Targets</title>
33
+ <style>
34
+ body {
35
+ font-family: sans-serif;
36
+ padding: 2em;
37
+ }
38
+
39
+ ul {
40
+ padding: 0;
41
+ }
42
+
43
+ li {
44
+ margin-bottom: 1.2em;
45
+ list-style: none;
46
+ line-height: 1.5;
47
+ }
48
+
49
+ a.button {
50
+ display: inline-block;
51
+ background: #409eff;
52
+ color: #fff;
53
+ padding: 0.2em 0.5em;
54
+ text-decoration: none;
55
+ border-radius: 4px;
56
+ margin-top: 0.5em;
57
+ font-size: 14px;
58
+ }
59
+
60
+ a.button:hover {
61
+ background: #66b1ff;
62
+ }
63
+
64
+ #refresh {
65
+ margin-bottom: 1.5em;
66
+ }
67
+ </style>
68
+ </head>
69
+
70
+ <body>
71
+ <h2>\u53EF\u7528 DevTools Targets</h2><button id="refresh">\u5237\u65B0</button>
72
+ <ul id="target-list">
73
+ <li>\u52A0\u8F7D\u4E2D...</li>
74
+ </ul>
75
+ <script>
76
+ async function fetchTargets() {
77
+ const list = document.getElementById("target-list");
78
+ list.innerHTML = "<li>\u52A0\u8F7D\u4E2D...</li>";
79
+ try {
80
+ const resp = await fetch("/__chii_proxy/targets");
81
+ const data = await resp.json();
82
+ const targets = data.targets || [];
83
+ if (targets.length === 0) {
84
+ list.innerHTML = "<li>\u6682\u65E0\u53EF\u7528\u7684\u8C03\u8BD5\u76EE\u6807\u3002</li>";
85
+ } else {
86
+ list.innerHTML = "";
87
+ for (const target of targets) {
88
+ console.log(target)
89
+ const devToolsUrl = "http://localhost:${targetPort}/front_end/chii_app.html?ws=localhost:${targetPort}/client/" + Math.random().toString(20).substring(2, 8) + "?target=" + encodeURIComponent(target.id) + "&rtc=false";
90
+ const item = document.createElement("li");
91
+ item.innerHTML =
92
+ "<div><strong>" + (target.title) + "</strong></div>" +
93
+ "<div>URL: " + (target.url || "") + "</div>" +
94
+ "<div>UA: <code>" + (target.userAgent || "unknown") + "</code></div>" +
95
+ "<a href='" + devToolsUrl + "' target='_blank' class='button'>\u6253\u5F00\u8C03\u8BD5</a>";
96
+ list.appendChild(item);
97
+ }
98
+ }
99
+ } catch (e) {
100
+ list.innerHTML = "<li>\u83B7\u53D6\u8C03\u8BD5\u76EE\u6807\u5931\u8D25</li>";
101
+ }
102
+ }
103
+ document.getElementById("refresh").onclick = () => window.location.reload();
104
+ window.onload = fetchTargets;
105
+ document.addEventListener('visibilitychange', window.location.reload);
106
+ </script>
107
+ </body>
108
+
109
+ </html>`;
110
+ }
111
+ // Annotate the CommonJS export names for ESM import in node:
112
+ 0 && (module.exports = {
113
+ getChromeDevtoolsHtml
114
+ });
115
+ exports.default = module.exports;
@@ -0,0 +1,3 @@
1
+ declare function getChromeDevtoolsHtml(targetPort: number): string;
2
+
3
+ export { getChromeDevtoolsHtml };