@nextcloud/files

    Function getRecentSearch

    • Get the SEARCH body to search for recently modified files

      Parameters

      • lastModified: number

        Oldest timestamp to include (Unix timestamp)

      Returns string

      // SEARCH for recent files need a different DAV endpoint
      const client = davGetClient(generateRemoteUrl('dav'))
      // Timestamp of last week
      const lastWeek = Math.round(Date.now() / 1000) - (60 * 60 * 24 * 7)
      const contentsResponse = await client.getDirectoryContents(path, {
      details: true,
      data: davGetRecentSearch(lastWeek),
      headers: {
      method: 'SEARCH',
      'Content-Type': 'application/xml; charset=utf-8',
      },
      deep: true,
      }) as ResponseDataDetailed<FileStat[]>
    MMNEPVFCICPMFPCPTTAAATR