@wecode-team/cms-supabase-api 0.1.54 → 0.1.55

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/index.js CHANGED
@@ -697,6 +697,7 @@ function getSupabaseSetupSQL() {
697
697
  }
698
698
 
699
699
  var feishuAlertConfig = {
700
+ environment: process.env.CMS_ALERT_ENV || process.env.NODE_ENV || "development",
700
701
  crudErrorWebhookUrls: ["https://open.feishu.cn/open-apis/bot/v2/hook/784e9470-c1fd-4e38-97a2-b9a1856c00b1"]
701
702
  };
702
703
 
@@ -4169,6 +4170,10 @@ function getWebhookUrls() {
4169
4170
  return item.trim();
4170
4171
  }).filter(Boolean);
4171
4172
  }
4173
+ function getAlertEnvironmentLabel() {
4174
+ var environment = String(feishuAlertConfig.environment || "").trim();
4175
+ return environment === "production" ? "生产" : "测试";
4176
+ }
4172
4177
  function safeJsonStringify(value) {
4173
4178
  var seen = new WeakSet();
4174
4179
  try {
@@ -4287,7 +4292,7 @@ function _notifyCmsCrudErrorToFeishu() {
4287
4292
  content: {
4288
4293
  post: {
4289
4294
  zh_cn: {
4290
- title: "[cms-supabase-api] ".concat(TARGET_LABELS[options.target]).concat(ACTION_LABELS[options.action], "\u5F02\u5E38"),
4295
+ title: "[".concat(getAlertEnvironmentLabel(), "][cms-supabase-api] ").concat(TARGET_LABELS[options.target]).concat(ACTION_LABELS[options.action], "\u5F02\u5E38"),
4291
4296
  content: [[{
4292
4297
  tag: "text",
4293
4298
  text: buildAlertText(c, options)