Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openclaw/extensions/msteams/src/   (KI Agentensystem Version 22©)  Datei vom 26.3.2026 mit Größe 1 kB image not shown  

Quelle  graph-chat.ts

  Sprache: JAVA
 

/**
 * Native Teams file card attachments for Bot Framework.
 *
 * The Bot Framework SDK supports `application/vnd.microsoft.teams.card.file.info`
 * content type which produces native Teams file cards.
 *
 * @see https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bots-filesv4
 */


/**
 * Build a native Teams file card attachment for Bot Framework.
 *
 * This uses the `application/vnd.microsoft.teams.card.file.info` content type
 * which is supported by Bot Framework and produces native Teams file cards
 * (the same display as when a user manually shares a file).
 *
 * @param file - DriveItem properties from getDriveItemProperties()
 * @returns Attachment object for Bot Framework sendActivity()
 */

import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
import type { DriveItemProperties } from "./graph-upload.js";

export function buildTeamsFileInfoCard(file: DriveItemProperties): {
  contentType: string;
  contentUrl: string;
  name: string;
  content: {
    uniqueId: string;
    fileType: string;
  };
} {
  // Extract unique ID from eTag (remove quotes, braces, and version suffix)
  // Example eTag formats: "{GUID},version" or "\"{GUID},version\""
  const rawETag = file.eTag;
  const uniqueId =
    rawETag
      .replace(/^["']|["']$/g, "") // Remove outer quotes
      .replace(/[{}]/g, ""// Remove curly braces
      .split(",")[0] ?? rawETag; // Take the GUID part before comma

  // Extract file extension from filename
  const lastDot = file.name.lastIndexOf(".");
  const fileType =
    lastDot >= 0 ? normalizeLowercaseStringOrEmpty(file.name.slice(lastDot + 1)) : "";

  return {
    contentType: "application/vnd.microsoft.teams.card.file.info",
    contentUrl: file.webDavUrl,
    name: file.name,
    content: {
      uniqueId,
      fileType,
    },
  };
}

Messung V0.5 in Prozent
C=97 H=98 G=97

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-05-26) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.