stream-chat 9.17.0 → 9.18.1

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.
@@ -2754,16 +2754,16 @@ function formatMessage(message) {
2754
2754
  if (!msg) return null;
2755
2755
  return {
2756
2756
  ...msg,
2757
- created_at: message.created_at ? new Date(message.created_at) : /* @__PURE__ */ new Date(),
2758
- deleted_at: message.deleted_at ? new Date(message.deleted_at) : null,
2759
- pinned_at: message.pinned_at ? new Date(message.pinned_at) : null,
2757
+ created_at: msg.created_at ? new Date(msg.created_at) : /* @__PURE__ */ new Date(),
2758
+ deleted_at: msg.deleted_at ? new Date(msg.deleted_at) : null,
2759
+ pinned_at: msg.pinned_at ? new Date(msg.pinned_at) : null,
2760
2760
  reaction_groups: maybeGetReactionGroupsFallback(
2761
- message.reaction_groups,
2762
- message.reaction_counts,
2763
- message.reaction_scores
2761
+ msg.reaction_groups,
2762
+ msg.reaction_counts,
2763
+ msg.reaction_scores
2764
2764
  ),
2765
- status: message.status || "received",
2766
- updated_at: message.updated_at ? new Date(message.updated_at) : /* @__PURE__ */ new Date()
2765
+ status: msg.status || "received",
2766
+ updated_at: msg.updated_at ? new Date(msg.updated_at) : /* @__PURE__ */ new Date()
2767
2767
  };
2768
2768
  };
2769
2769
  return {
@@ -12393,6 +12393,54 @@ var Moderation = class {
12393
12393
  flags
12394
12394
  );
12395
12395
  }
12396
+ /**
12397
+ * Create or update a moderation rule
12398
+ * @param {ModerationRuleRequest} rule Rule configuration to be upserted
12399
+ * @returns
12400
+ */
12401
+ async upsertModerationRule(rule) {
12402
+ return await this.client.post(
12403
+ this.client.baseURL + "/api/v2/moderation/moderation_rule",
12404
+ rule
12405
+ );
12406
+ }
12407
+ /**
12408
+ * Query moderation rules
12409
+ * @param {QueryModerationRulesFilters} filterConditions Filter conditions for querying moderation rules
12410
+ * @param {QueryModerationRulesSort} sort Sort conditions for querying moderation rules
12411
+ * @param {Pager} options Pagination options for querying moderation rules
12412
+ * @returns
12413
+ */
12414
+ async queryModerationRules(filterConditions = {}, sort = [], options = {}) {
12415
+ return await this.client.post(
12416
+ this.client.baseURL + "/api/v2/moderation/moderation_rules",
12417
+ {
12418
+ filter: filterConditions,
12419
+ sort,
12420
+ ...options
12421
+ }
12422
+ );
12423
+ }
12424
+ /**
12425
+ * Get a specific moderation rule by ID
12426
+ * @param {string} id ID of the moderation rule to fetch
12427
+ * @returns
12428
+ */
12429
+ async getModerationRule(id) {
12430
+ return await this.client.get(
12431
+ this.client.baseURL + "/api/v2/moderation/moderation_rule/" + id
12432
+ );
12433
+ }
12434
+ /**
12435
+ * Delete a moderation rule by ID
12436
+ * @param {string} id ID of the moderation rule to delete
12437
+ * @returns
12438
+ */
12439
+ async deleteModerationRule(id) {
12440
+ return await this.client.delete(
12441
+ this.client.baseURL + "/api/v2/moderation/moderation_rule/" + id
12442
+ );
12443
+ }
12396
12444
  };
12397
12445
 
12398
12446
  // src/thread_manager.ts
@@ -16164,7 +16212,7 @@ var StreamChat = class _StreamChat {
16164
16212
  if (this.userAgent) {
16165
16213
  return this.userAgent;
16166
16214
  }
16167
- const version = "9.17.0";
16215
+ const version = "9.18.1";
16168
16216
  const clientBundle = "browser-cjs";
16169
16217
  let userAgentString = "";
16170
16218
  if (this.sdkIdentifier) {