@ecency/sdk 1.5.17 → 1.5.18

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.
@@ -216,18 +216,24 @@ var ConfigManager;
216
216
  return null;
217
217
  }
218
218
  }
219
- function setDmcaLists(accounts = [], tags = [], patterns = []) {
220
- CONFIG.dmcaAccounts = accounts;
221
- CONFIG.dmcaTags = tags;
222
- CONFIG.dmcaPatterns = patterns;
223
- CONFIG.dmcaTagRegexes = tags.map((pattern) => safeCompileRegex(pattern)).filter((r) => r !== null);
219
+ function setDmcaLists(accounts = {}) {
220
+ const coerceList = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
221
+ const resolved = {
222
+ accounts: coerceList(accounts.accounts),
223
+ tags: coerceList(accounts.tags),
224
+ patterns: coerceList(accounts.posts)
225
+ };
226
+ CONFIG.dmcaAccounts = resolved.accounts;
227
+ CONFIG.dmcaTags = resolved.tags;
228
+ CONFIG.dmcaPatterns = resolved.patterns;
229
+ CONFIG.dmcaTagRegexes = resolved.tags.map((pattern) => safeCompileRegex(pattern)).filter((r) => r !== null);
224
230
  CONFIG.dmcaPatternRegexes = [];
225
- const rejectedTagCount = tags.length - CONFIG.dmcaTagRegexes.length;
231
+ const rejectedTagCount = resolved.tags.length - CONFIG.dmcaTagRegexes.length;
226
232
  if (!CONFIG._dmcaInitialized && isDevelopment) {
227
233
  console.log(`[SDK] DMCA configuration loaded:`);
228
- console.log(` - Accounts: ${accounts.length}`);
229
- console.log(` - Tag patterns: ${CONFIG.dmcaTagRegexes.length}/${tags.length} compiled (${rejectedTagCount} rejected)`);
230
- console.log(` - Post patterns: ${patterns.length} (using exact string matching)`);
234
+ console.log(` - Accounts: ${resolved.accounts.length}`);
235
+ console.log(` - Tag patterns: ${CONFIG.dmcaTagRegexes.length}/${resolved.tags.length} compiled (${rejectedTagCount} rejected)`);
236
+ console.log(` - Post patterns: ${resolved.patterns.length} (using exact string matching)`);
231
237
  if (rejectedTagCount > 0) {
232
238
  console.warn(`[SDK] ${rejectedTagCount} DMCA tag patterns were rejected due to security validation. Check warnings above for details.`);
233
239
  }
@@ -2718,6 +2724,11 @@ function useAccountRelationsUpdate(reference, target, auth, onSuccess, onError)
2718
2724
  ["accounts", "relations", reference, target],
2719
2725
  data
2720
2726
  );
2727
+ if (target) {
2728
+ getQueryClient().invalidateQueries(
2729
+ getAccountFullQueryOptions(target)
2730
+ );
2731
+ }
2721
2732
  }
2722
2733
  });
2723
2734
  }