@lark-apaas/fullstack-cli 1.1.40-alpha.6 → 1.1.40-alpha.8

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3242,10 +3242,10 @@ function isInPercentage(tenantId, percentage) {
3242
3242
  function matchRule(rule, identity) {
3243
3243
  switch (rule.type) {
3244
3244
  case "tenant_id": {
3245
- return !!identity.tenantId && rule.values.includes(identity.tenantId);
3245
+ return !!identity.tenantId && !!rule.values && rule.values.includes(identity.tenantId);
3246
3246
  }
3247
3247
  case "app_id": {
3248
- return !!identity.appId && rule.values.includes(identity.appId);
3248
+ return !!identity.appId && !!rule.values && rule.values.includes(identity.appId);
3249
3249
  }
3250
3250
  case "canary": {
3251
3251
  return identity.xTtEnv === rule.value;
@@ -3261,13 +3261,8 @@ function matchRule(rule, identity) {
3261
3261
  }
3262
3262
  }
3263
3263
  function isBlocked(channel, identity) {
3264
- if (identity.tenantId && channel.blocklist?.tenant_ids?.includes(identity.tenantId)) {
3265
- return true;
3266
- }
3267
- if (identity.appId && channel.blocklist?.app_ids?.includes(identity.appId)) {
3268
- return true;
3269
- }
3270
- return false;
3264
+ if (!channel.block_rules || channel.block_rules.length === 0) return false;
3265
+ return channel.block_rules.some((rule) => matchRule(rule, identity));
3271
3266
  }
3272
3267
  function matchChannel(channel, identity) {
3273
3268
  if (isBlocked(channel, identity)) return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-cli",
3
- "version": "1.1.40-alpha.6",
3
+ "version": "1.1.40-alpha.8",
4
4
  "description": "CLI tool for fullstack template management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",