@lark-apaas/devtool-kits 1.0.8 → 1.0.9

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.
package/dist/error.html CHANGED
@@ -277,23 +277,23 @@
277
277
  // 发送 postMessage
278
278
  function sendPostMessage(message, targetOrigin) {
279
279
  const origin = targetOrigin || getPreviewParentOrigin();
280
+ console.log('sendPostMessage', message, origin);
280
281
  window.parent.postMessage(message, origin);
281
282
  }
282
283
 
283
284
  // 获取父窗口 origin
284
285
  function getPreviewParentOrigin() {
285
- // 优先使用 document.referrer
286
- if (document.referrer) {
287
- try {
288
- const url = new URL(document.referrer);
289
- return url.origin;
290
- } catch (e) {
291
- console.error('解析 referrer 失败:', e);
292
- }
286
+ const { origin } = window.location;
287
+ // 线上环境
288
+ if (origin.includes('feishuapp.cn') || origin.includes('miaoda.feishuapp.net')) {
289
+ return 'https://miaoda.feishu.cn';
293
290
  }
294
-
295
- // 降级方案:使用通配符(不安全,仅用于开发环境)
296
- return '*';
291
+ // PRE 环境
292
+ if (origin.includes('fsapp.kundou.cn') || origin.includes('miaoda-pre.feishuapp.net')) {
293
+ return 'https://miaoda.feishu-pre.cn';
294
+ }
295
+ // BOE 环境
296
+ return 'https://miaoda.feishu-boe.cn';
297
297
  }
298
298
 
299
299
  // 复制到剪贴板
package/dist/index.cjs CHANGED
@@ -19110,6 +19110,45 @@ var require_get_proto = __commonJS({
19110
19110
  }
19111
19111
  });
19112
19112
 
19113
+ // ../../../node_modules/async-function/index.js
19114
+ var require_async_function = __commonJS({
19115
+ "../../../node_modules/async-function/index.js"(exports2, module2) {
19116
+ "use strict";
19117
+ var cached = (
19118
+ /** @type {import('.').AsyncFunctionConstructor} */
19119
+ (async function() {
19120
+ }).constructor
19121
+ );
19122
+ module2.exports = () => cached;
19123
+ }
19124
+ });
19125
+
19126
+ // ../../../node_modules/generator-function/index.js
19127
+ var require_generator_function = __commonJS({
19128
+ "../../../node_modules/generator-function/index.js"(exports2, module2) {
19129
+ "use strict";
19130
+ var cached = (
19131
+ /** @type {GeneratorFunctionConstructor} */
19132
+ (function* () {
19133
+ }).constructor
19134
+ );
19135
+ module2.exports = () => cached;
19136
+ }
19137
+ });
19138
+
19139
+ // ../../../node_modules/async-generator-function/index.js
19140
+ var require_async_generator_function = __commonJS({
19141
+ "../../../node_modules/async-generator-function/index.js"(exports2, module2) {
19142
+ "use strict";
19143
+ var cached = (
19144
+ /** @type {import('.').AsyncGeneratorFunctionConstructor} */
19145
+ (async function* () {
19146
+ }).constructor
19147
+ );
19148
+ module2.exports = () => cached;
19149
+ }
19150
+ });
19151
+
19113
19152
  // ../../../node_modules/hasown/index.js
19114
19153
  var require_hasown = __commonJS({
19115
19154
  "../../../node_modules/hasown/index.js"(exports2, module2) {
@@ -19141,13 +19180,6 @@ var require_get_intrinsic = __commonJS({
19141
19180
  var pow = require_pow();
19142
19181
  var round = require_round();
19143
19182
  var sign = require_sign();
19144
- var $Function = Function;
19145
- var getEvalledConstructor = /* @__PURE__ */ __name(function(expressionSyntax) {
19146
- try {
19147
- return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
19148
- } catch (e) {
19149
- }
19150
- }, "getEvalledConstructor");
19151
19183
  var $gOPD = require_gopd();
19152
19184
  var $defineProperty = require_es_define_property();
19153
19185
  var throwTypeError = /* @__PURE__ */ __name(function() {
@@ -19202,7 +19234,7 @@ var require_get_intrinsic = __commonJS({
19202
19234
  "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array,
19203
19235
  "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array,
19204
19236
  "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry,
19205
- "%Function%": $Function,
19237
+ "%Function%": Function,
19206
19238
  "%GeneratorFunction%": needsEval,
19207
19239
  "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array,
19208
19240
  "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array,
@@ -19265,14 +19297,17 @@ var require_get_intrinsic = __commonJS({
19265
19297
  }
19266
19298
  }
19267
19299
  var errorProto;
19300
+ var getAsyncFunction = require_async_function();
19301
+ var getGeneratorFunction = require_generator_function();
19302
+ var getAsyncGeneratorFunction = require_async_generator_function();
19268
19303
  var doEval = /* @__PURE__ */ __name(function doEval2(name) {
19269
19304
  var value;
19270
19305
  if (name === "%AsyncFunction%") {
19271
- value = getEvalledConstructor("async function () {}");
19306
+ value = getAsyncFunction() || void undefined2;
19272
19307
  } else if (name === "%GeneratorFunction%") {
19273
- value = getEvalledConstructor("function* () {}");
19308
+ value = getGeneratorFunction() || void undefined2;
19274
19309
  } else if (name === "%AsyncGeneratorFunction%") {
19275
- value = getEvalledConstructor("async function* () {}");
19310
+ value = getAsyncGeneratorFunction() || void undefined2;
19276
19311
  } else if (name === "%AsyncGenerator%") {
19277
19312
  var fn = doEval2("%AsyncGeneratorFunction%");
19278
19313
  if (fn) {
@@ -28624,7 +28659,7 @@ function handleDevProxyError(err, req, res, options) {
28624
28659
  }
28625
28660
  const template = getErrorHtmlTemplate();
28626
28661
  const html = injectErrorData(template, errorLogs, clientBasePathWithoutSlash);
28627
- res.writeHead(200, {
28662
+ res.writeHead(502, {
28628
28663
  "Content-Type": "text/html; charset=utf-8",
28629
28664
  "Cache-Control": "no-cache, no-store, must-revalidate",
28630
28665
  "X-Proxy-Error-Page": "true"