Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • coverage-stable
  • develop
  • feature/ability-to-add-custom-tags
  • feature/add-metrics-exporter-settings
  • feature/dynamic-settings-rendering
  • feature/fetchs-list-of-tabs
  • feature/media-preview-proxy
  • feature/post-pagination
  • feature/render-settings-dynamically
  • feature/settings-rollback
  • feature/update-styles
  • release/2.5.0
  • release/2.6
  • remove-workers
  • renovate/autoprefixer-10.x
  • renovate/babel-eslint-replacement
  • renovate/babel-loader-8.x
  • renovate/babel-monorepo
  • renovate/element-ui-2.x
  • renovate/sass-1.x
  • renovate/vue-monorepo
  • renovate/vue-test-utils-1.x
  • renovate/vue-test-utils-2.x
  • renovate/vuex-3.x
  • revert-fd9f0542
  • stable
  • 1.2.0
  • 2.4.0
  • 2.5.0
  • v2.0.2
  • v2.1.0
  • v2.2.0
32 results

Target

Select target project
No results found
Select Git revision
  • develop
  • display-name-emoji-packs
  • feature/add-new-user-filters
  • feature/edit-tags-manually
  • feature/update-styles
  • master
  • release/2.0.3
  • release/2.1.0
  • remove-ssh-gopher
  • 1.2.0
  • v2.0.2
  • v2.1.0
12 results
Show changes

Commits on Source 1100

1,000 additional commits have been omitted to prevent performance issues.
420 files
+ 23461
19762
Compare changes
  • Side-by-side
  • Inline

Files

.dockerignore

0 → 100644
+32 −0
Original line number Diff line number Diff line
# SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
# SPDX-License-Identifier: AGPL-3.0-only

# block everything
**

# allowed files
!AGPL-3
!CHANGELOG.md
!README.md
!.babelrc
!.eslintignore
!.eslintrc.js
!.postcssrc.js
!favicon.ico
!index.html
!package.json
!yarn.lock

# allowed subdirectories
!/build/**
!/config/**
!/docker/**
!/public/**
!/static/**
!/src/**

# blocked subdirectory files
**/*.log
**/*~
**/.DS_Store
**/Thumbs.db
+3 −0
Original line number Diff line number Diff line
# SPDX-FileCopyrightText: 2017-2019 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
# SPDX-License-Identifier: MIT

# http://editorconfig.org
root = true

+3 −0
Original line number Diff line number Diff line
# SPDX-FileCopyrightText: 2017-2019 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
# SPDX-License-Identifier: MIT

build/*.js
config/*.js
src/assets
+6 −0
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2017-2019 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
// SPDX-License-Identifier: MIT
//
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

module.exports = {
  root: true,
  parserOptions: {
+6 −0
Original line number Diff line number Diff line
# SPDX-FileCopyrightText: 2017-2019 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
# SPDX-License-Identifier: MIT
#
# SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
# SPDX-License-Identifier: AGPL-3.0-only

.DS_Store
node_modules/
dist/
+45 −14
Original line number Diff line number Diff line
image: node:10
# SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
# SPDX-License-Identifier: AGPL-3.0-only

image: node:20-alpine

variables: &global_variables
  DOCKER_DRIVER: overlay2
  DOCKER_HOST: unix:///var/run/docker.sock

cache: &global_cache_policy
  key: '$CI_COMMIT_SHORT_SHA'
  policy: pull-push
  paths:
    - node_modules/
    - build

stages:
  - lint
  - build
  - test

lint:
  stage: lint
build:
  stage: build
  before_script: &before-build
    - apk --no-cache add git python3 build-base
  script:
    - yarn
    - yarn lint
    - yarn build:prod
  artifacts: &release-artifacts
    name: "admin-fe-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
    paths:
      - dist/

test:
lint:
  stage: test
  variables:
    APT_CACHE_DIR: apt-cache
  script:
  before_script: &before-yarn
    - apk --no-cache add git python3 build-base
    - yarn
    - yarn test
  cache:
    key: '$CI_COMMIT_SHORT_SHA'
    policy: pull
  script:
    - yarn lint

build:
  stage: build
test:
  stage: test
  before_script: *before-yarn
  cache:
    key: '$CI_COMMIT_SHORT_SHA'
    policy: pull
  script:
    - yarn
    - npm run build:prod
    - yarn test --coverage
  coverage: '/^Lines *: *([^ ]*%) [^%]*$/'
  artifacts:
    reports:
      coverage_report:
        coverage_format: cobertura
        path: coverage/cobertura-coverage.xml
+6 −0
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2017-2019 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
// SPDX-License-Identifier: MIT
//
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

// https://github.com/michael-ciniawsky/postcss-load-config

module.exports = {

.reuse/dep5

0 → 100644
+9 −0
Original line number Diff line number Diff line
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://git.pleroma.social/pleroma/admin-fe/

# Grabbed from tiptap@1.29.6
# See https://github.com/ueberdosis/tiptap/blob/tiptap%401.29.6/LICENSE.md
# and https://github.com/ueberdosis/tiptap/tree/tiptap%401.29.6/examples/assets/images/icons
Files: src/icons/svg/tiptap-*.svg
Copyright: 2020 überdosis GbR
License: MIT

.tool-versions

0 → 100644
+2 −0
Original line number Diff line number Diff line
yarn 1.22.19
nodejs 20.14.0
+3 −0
Original line number Diff line number Diff line
# SPDX-FileCopyrightText: 2017-2019 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
# SPDX-License-Identifier: MIT

language: node_js
node_js: stable
script: npm run test

AGPL-3

deleted100644 → 0
+0 −661

File deleted.

Preview size limit exceeded, changes collapsed.

+181 −5
Original line number Diff line number Diff line
<!--
SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
SPDX-License-Identifier: AGPL-3.0-only
-->

# Changelog

All notable changes to this project will be documented in this file.
@@ -6,28 +11,199 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

### Added

### Changed

- moves emoji pack configuration from the main menu to settings tab, redesigns it and fixes bugs
- `mailerEnabled` must be set to `true` in order to require password reset (password reset currently only works via email)
- remove fetching initial data for configuring server settings
- Actions in users module (ActivateUsers, AddRight, DeactivateUsers, DeleteRight, DeleteUsers) now accept an array of users instead of one user
- Leave dropdown menu open after clicking an action
### Fixed
- The Service account type has been renamed to Bot so it's consistent with the termoniology used by most fediverse software.

## [2.5.0] - 2022-12-21

### Added
- Support for fine-grained privileges

### Added
- Support for fine-grained privileges

### Fixed
- Crash when parsing tuples in Settings
- Broken parsing of Settings

## [2.4.0] - 2021-08-01

### Added

- Evicting and banning objects from the MediaProxy cache is disabled if MediaProxy is disabled on the Settings tab. Add ability to enable MediaProxy and Invalidation from MediaProxy tab.
- Allow to upload the custom Terms of Service and Instance Panel HTML pages via Admin API
- Add Report show page and link Moderation log references to the respective reports
- Add Unconfimed filter for Users table
- Filter users by actor type: Person, Bot or Application
- Add ability to configure Media Preview Proxy, User Backup, Websocket based federation and Pleroma.Web.Endpoint.MetricsExporter settings
- Mobile and Tablet UI for Single Report show page
- Ability to set rules and conditions for rendering settings (e.g. `:proxy_remote` setting is hidden if `:uploader` setting is set to `Pleroma.Uploaders.Local`)
- Ability to install new frontends from the Frontend tab in the Settings section

### Changed

- **Breaking**: AdminAPI changed User field `confirmation_pending` to `is_confirmed`
- **Breaking**: AdminAPI changed User field `approval_pending` to `is_approved`
- **Breaking**: AdminAPI changed User field `deactivated` to `is_active`
- Hide Tag actions on Users tab if MRF TagPolicy is disabled. Add ability to enable TagPolicy from Moderation menu
- Move `:restrict_unauthenticated` settings from Authentication tab to Instance tab
- Replace regular inputs with textareas for setting welcome messages in the Settings section
- Remove Websocket based federation settings
- Move Settings tab navigation from the tabbed menu to the main sidebar menu. A separate route is created for each tab.
- Move Emoji packs configuration to the Emoji tab in the Settings section
- 401 and 404 error pages updated
- Remove unused components

### Fixed

- Fix depricatied action names in Reports, move actions that manage users from Reports to reports module
- Allow using underscores and hyphens in new account's usernames
- Fix wrapping `:icons` setting and parsing tuples in settings with key `:headers`
- Update keys for Pleroma.Web.Plugs.RemoteIp and PurgeExpiredActivity settings
- Update switching between local and remote emoji packs panels: the panel with the pack's metadata will be closed when another panel is opened
- Fix displaying messages for multiple errors
## [2.2] - 2020-11-18

### Added

- Ability to configure Media Preview Proxy settings on MediaProxy tab

### Fixed

- Update keys for PurgeExpiredActivity and RemoteIp settings
- Fix wrapping `:icons` setting and parsing tuples in settings with key `:headers`

## [2.1] - 2020-08-26

### Added

- Create `/statuses/:id` route that shows single status
- Add link to the user's account in Pleroma on the user's profile page
- On Reports page add links to reported account and the author of the report 
- In Notes add link to the note author's profile page 
- In Moderation log add link to the actor's profile page
- Support pagination of local emoji packs and files
- Add MRF Activity Expiration setting
- Add ability to disable multi-factor authentication for a user
- Add ability to configure Invalidation settings on MediaProxy tab
- Ability to configure `S3` settings on Upload tab, `Pleroma.Web.ApiSpec.CastAndValidate` and `:modules` settings on Other tab, `:pools`, `:connections_pool` and `:hackney_pools` settings on Job Queue tab, `:restrict_unauthenticated` settings on Authentication tab, `:favicons` and `:welcome` settings on Instance tab, `:frontends` and `Pleroma.Web.Preload` settings on Frontend tab
- Show number of open reports in Sidebar Menu
- Add confirmation message when deleting a user
- Add new MediaProxy Cache Tab with ability to manually evict and ban objects from the Pleroma MediaProxy cache
- Allow managing user's actor_type field via Admin API

### Changed

- Statuses count changes when an instance is selected and shows the amount of statuses from an originating instance
- Add a confirmation dialog window when Remove button is clicked on the Settings page
- Disable tab on the Settings page if there are no settings on this tab that can be changed in Admin FE
- Settings that can't be altered in Admin FE are removed: HTTP Signatures settings, Federation publisher modules and Oban Repo
- When rendering user's profile, statuses, reports and notes check if required properties exist
- Remove ability to moderate users that don't have valid nicknames
- Displays both labels and description in the header of group of settiings
- Ability to add custom values in Pleroma.Upload.Filter.Mogrify setting in the following format: '{"implode", "1"}'
- Change types of the following settings: ':groups', ':replace', ':federated_timeline_removal', ':reject', ':match_actor'. Update functions that parses and wraps settings data according to this change.
- Move rendering Crontab setting from a separate component to EditableKeyword component
- Show only those MRF settings that have been enabled in MRF Policies setting
- Move Auto Linker settings to Link Formatter Tab as its configuration was moved to :pleroma, Pleroma.Formatter
- Active and Local filters are applied by default on the Users tab
- Update Emoji Packs API to support special chars in pack names

### Fixed

- Send `true` and `false` as booleans if they are values of single selects on the Settings page
- Fix sorting users on Users page if there is an acount with missing nickname or ID
- Add new type of settings: `['string', 'image']`. Render Image upload Input depending on the type of setting, not its key
- Fix displaying `Pending` tag and filtering by Pending Approval status
- Fix following and unfollowing relays from Admin-FE, update mobile UI
- Support special chars in Emoji packs names

## [2.0.3] - 2020-04-29

### Added

- Link settings that enable registrations and invites
- Ability to upload logo, background, default user avatar, instance thumbnail, and NSFW hiding images

### Changed

- Put Instance Reboot button on all pages of admin-fe
- Make Instance Reboot button's positon fixed on Settings page
- Update jest and babel-jest
- Generate an invite link when an invite token has been generated
- Put labels on top of inputs in mobile version
- Shorten suggestions for a series of select inputs: Rewrite policy, Pleroma Authenticator, Captcha Method, Mailer adapter, Metadata providers, Rich Media parsers, TTL setters, Scrub policy, Uploader, Filters and Federation publisher modules

### Fixed

- Disable Invites tab when invites are disabled on BE

## [2.0.2] - 2020-04-01

### Added

- Ability to see local statuses in Statuses by instance section
- Ability to configure Oban.Cron settings and settings for notifications streamer
- Settings search
- Ability to set user's password and email on user's page
- Display status count by scope on Statuses page

### Changed

- Link to Pleroma docs when a non-admin user tries to log in 

### Fixed

- Fix parsing tuples in Pleroma.Upload.Filter.Mogrify and Pleroma.Emails.Mailer settings
- Fix settings submit button position on wide screens when sidebar menu is open
- Updates links for downloading remote emoji packs
- Fix parsing emails that have symbols in it

## [2.0] - 2020-02-27

### Added

- Optimistic update for actions in users module and fetching users after api function finished its execution
- Relay management
- Ability to fetch all statuses from a given instance
- Ability to confirm users' emails and resend confirmation emails
- Report notes
- Ability to moderate users on the statuses page
- Ability to moderate user on the user's page
- Ability to remove setting's updated value and set it back to initial value
- Ability to restart an application when settings that require instance reboot were changed
- Mobile and Tablet UI for all sections

### Changed

- **breaking** PleromaFE login feature relies on `admin` scope presence in PleromaFE token (older versions of PleromaFE don't support it)
- `mailerEnabled` must be set to `true` in order to require password reset (password reset currently only works via email)
- Render inputs for configuring settings based on description that comes from the BE
- Remove fetching initial data for configuring server settings
- Actions in users module (ActivateUsers, AddRight, DeactivateUsers, DeleteRight, DeleteUsers) now accept an array of users instead of one user
- Leave dropdown menu open after clicking an action
- Display checkboxes in status card and fetch statuses only when status card was rendered from Statuses by instance page
- Move statuses by instance state from local state to store state

### Fixed

- Show checkmarks when tag is applied
- Reports update (also, now it's optimistic)
- Remove duplicated success message
- Fix styles for Statuses by instance page
- Fix styles for Reports section
- Fix listing remote emoji

## [1.2.0] - 2019-09-27

### Added

- Emoji pack configuration
- Statuses page: fetch all statuses from a given instance
- Ability to require user's password reset
– Ability to track admin/moderator actions, a.k.a. "the moderation log"

Dockerfile

0 → 100644
+41 −0
Original line number Diff line number Diff line
# SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
# SPDX-License-Identifier: AGPL-3.0-only

FROM node:16-alpine as build

COPY . .

RUN apk --no-cache add git && \
    npm install && \
    npm run build:prod

FROM nginx:mainline-alpine

LABEL maintainer="ops@pleroma.social" \
    org.opencontainers.image.title="pleroma-adminfe" \
    org.opencontainers.image.description="Pleroma-adminfe for Docker" \
    org.opencontainers.image.authors="ops@pleroma.social" \
    org.opencontainers.image.vendor="pleroma.social" \
    org.opencontainers.image.documentation="https://git.pleroma.social/pleroma/pleroma-adminfe" \
    org.opencontainers.image.licenses="AGPL-3.0" \
    org.opencontainers.image.url="https://pleroma.social" \
    org.opencontainers.image.revision=$VCS_REF \
    org.opencontainers.image.created=$BUILD_DATE


ARG DATA=/usr/share/nginx/html

COPY --from=build /dist/ ${DATA}

COPY ./docker/docker-entrypoint.sh /usr/local/bin/

COPY ./docker/nginx.conf.tpl /etc/nginx/nginx.conf.tpl

RUN apk add --no-cache gettext

EXPOSE 80

ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]

CMD exec nginx -g 'daemon off;'

LICENSE

deleted100644 → 0
+0 −21
Original line number Diff line number Diff line
MIT License

Copyright (c) 2017-present PanJiaChen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

LICENSES/MIT.txt

0 → 100644
+9 −0
Original line number Diff line number Diff line
MIT License

Copyright (c) <year> <copyright holders>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+40 −7
Original line number Diff line number Diff line
@@ -6,6 +6,13 @@

Admin UI for pleroma instance owners.

### Branches

There are two main branches here:

- `develop`: ongoing work and all merge requests go here, *unstable*
- `stable`: after `develop` is stabilized it is merged to `stable`, *stable*, allegedly

### Features

1. User administration: grant roles to users (admin/moderator), deactivate/delete as well as force their statuses to have NSFW tag, strip media and many more
@@ -18,13 +25,37 @@ You can have any combination of these features (i.e. you can disable anything, b

## Usage

### Bundled

AdminFE is bundled with Pleroma, i.e. you can just visit `https://your.instance/pleroma/admin/` to try it out.

### Development

To run AdminFE locally execute `yarn dev`
To run AdminFE locally execute

```
# install dependencies
npm install -g yarn
yarn

# run AdminFE locally
yarn dev
```

### Build

To compile everything for production run `yarn build:prod`.
To compile everything for production run

```
# install dependencies
npm install -g yarn
yarn

# compile everything for production
yarn build:prod
```

This will build admin-fe into `dist` folder, which you will need to upload to your server and/or point your webserver of choice to.

#### Disabling features

@@ -54,8 +85,10 @@ Modern browsers and Internet Explorer 10+.
| --------- | --------- | --------- | --------- |
| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions

## License

Pleroma AdminFE is build on top of the [Vue Element Admin](https://github.com/PanJiaChen/vue-element-admin), which is licensed under [MIT](https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE) license.

AdminFE's own code is licensed under [AGPL](./AGPL-3)
## Copyright
```
Copyright 2017-2019 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
SPDX-License-Identifier: MIT
Copyright 2019-2022 Pleroma Authors <https://pleroma.social>
SPDX-License-Identifier: AGPL-3.0-only
```

README.png

deleted100644 → 0
−566 KiB

566.32 KiB

+9 −10
Original line number Diff line number Diff line
'use strict'
require('./check-versions')()
// SPDX-FileCopyrightText: 2017-2018 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
// SPDX-License-Identifier: MIT
//
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-FileCopyrightText: 2022 Pleroma Authors <https://pleroma.social>

'use strict'
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')
@@ -32,17 +35,15 @@ rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
    )

    if (stats.hasErrors()) {
      console.log(chalk.red(' Build failed with errors.\n'))
      console.log(' Build failed with errors.\n')
      process.exit(1)
    }

    console.log(chalk.cyan(' Build complete.\n'))
    console.log(' Build complete.\n')
    console.log(
      chalk.yellow(
        ' Tip: built files are meant to be served over an HTTP server.\n' +
          " Opening index.html over file:// won't work.\n"
    )
    )

    if (process.env.npm_config_preview) {
      const port = 9526
@@ -58,9 +59,7 @@ rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
      )

      app.listen(port, function() {
        console.log(
          chalk.green(`> Listening at  http://localhost:${port}${basePath}`)
        )
        console.log(`> Listening at  http://localhost:${port}${basePath}`)
      })
    }
  })

build/check-versions.js

deleted100644 → 0
+0 −64
Original line number Diff line number Diff line
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')

function exec(cmd) {
  return require('child_process')
    .execSync(cmd)
    .toString()
    .trim()
}

const versionRequirements = [
  {
    name: 'node',
    currentVersion: semver.clean(process.version),
    versionRequirement: packageConfig.engines.node
  }
]

if (shell.which('npm')) {
  versionRequirements.push({
    name: 'npm',
    currentVersion: exec('npm --version'),
    versionRequirement: packageConfig.engines.npm
  })
}

module.exports = function() {
  const warnings = []

  for (let i = 0; i < versionRequirements.length; i++) {
    const mod = versionRequirements[i]

    if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
      warnings.push(
        mod.name +
          ': ' +
          chalk.red(mod.currentVersion) +
          ' should be ' +
          chalk.green(mod.versionRequirement)
      )
    }
  }

  if (warnings.length) {
    console.log('')
    console.log(
      chalk.yellow(
        'To use this template, you must update following to modules:'
      )
    )
    console.log()

    for (let i = 0; i < warnings.length; i++) {
      const warning = warnings[i]
      console.log('  ' + warning)
    }

    console.log()
    process.exit(1)
  }
}
+6 −18
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2017-2018 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
// SPDX-License-Identifier: MIT
//
// SPDX-FileCopyrightText: 2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

'use strict'
const path = require('path')
const config = require('../config')
@@ -88,21 +94,3 @@ exports.styleLoaders = function(options) {

  return output
}

exports.createNotifierCallback = () => {
  const notifier = require('node-notifier')

  return (severity, errors) => {
    if (severity !== 'error') return

    const error = errors[0]
    const filename = error.file && error.file.split('!').pop()

    notifier.notify({
      title: packageConfig.name,
      message: severity + ': ' + error.name,
      subtitle: filename || '',
      icon: path.join(__dirname, 'logo.png')
    })
  }
}
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2017-2018 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
// SPDX-License-Identifier: MIT

'use strict'

module.exports = {
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2017-2018 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
// SPDX-License-Identifier: MIT
//
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

'use strict'
const path = require('path')
const utils = require('./utils')
@@ -31,7 +37,8 @@ module.exports = {
    publicPath:
      process.env.NODE_ENV === 'production'
        ? config.build.assetsPublicPath
        : config.dev.assetsPublicPath
        : config.dev.assetsPublicPath,
    hashFunction: 'sha512'
  },
  resolve: {
    extensions: ['.js', '.vue', '.json'],
@@ -65,22 +72,14 @@ module.exports = {
        }
      },
      {
        test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
        loader: 'url-loader',
        test: /\.(png|jpe?g|gif)(\?.*)?$/,
        loader: 'file-loader',
        exclude: [resolve('src/icons')],
        options: {
          limit: 10000,
          name: utils.assetsPath('img/[name].[hash:7].[ext]')
        }
      },
      {
        test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
        loader: 'url-loader',
        options: {
          limit: 10000,
          name: utils.assetsPath('media/[name].[hash:7].[ext]')
        }
      },
      {
        test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
        loader: 'file-loader',
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2017-2018 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
// SPDX-License-Identifier: MIT
//
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

'use strict'
const path = require('path')
const utils = require('./utils')
@@ -6,8 +12,6 @@ const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const portfinder = require('portfinder')

function resolve(dir) {
  return path.join(__dirname, '..', dir)
@@ -43,7 +47,6 @@ const devWebpackConfig = merge(baseWebpackConfig, {
      : false,
    publicPath: devEnv.ASSETS_PUBLIC_PATH,
    proxy: config.dev.proxyTable,
    quiet: true, // necessary for FriendlyErrorsPlugin
    watchOptions: {
      poll: config.dev.poll
    },
@@ -71,33 +74,5 @@ const devWebpackConfig = merge(baseWebpackConfig, {
})

module.exports = new Promise((resolve, reject) => {
  portfinder.basePort = process.env.PORT || config.dev.port
  portfinder.getPort((err, port) => {
    if (err) {
      reject(err)
    } else {
      // publish the new Port, necessary for e2e tests
      process.env.PORT = port
      // add port to devServer config
      devWebpackConfig.devServer.port = port

      // Add FriendlyErrorsPlugin
      devWebpackConfig.plugins.push(
        new FriendlyErrorsPlugin({
          compilationSuccessInfo: {
            messages: [
              `Your application is running here: http://${
                devWebpackConfig.devServer.host
              }:${port}`
            ]
          },
          onErrors: config.dev.notifyOnErrors
            ? utils.createNotifierCallback()
            : undefined
        })
      )

  resolve(devWebpackConfig)
    }
  })
})
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2017-2018 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
// SPDX-License-Identifier: MIT
//
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

'use strict'
const path = require('path')
const utils = require('./utils')
@@ -5,9 +11,7 @@ const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
@@ -89,14 +93,6 @@ const webpackConfig = merge(baseWebpackConfig, {
    }),
    // keep module.id stable when vender modules does not change
    new webpack.HashedModuleIdsPlugin(),
    // copy custom static assets
    new CopyWebpackPlugin([
      {
        from: path.resolve(__dirname, '../static'),
        to: config.build.assetsSubDirectory,
        ignore: ['.*']
      }
    ])
  ],
  optimization: {
    splitChunks: {
@@ -156,28 +152,4 @@ if (config.build.productionGzip) {
  )
}

if (config.build.generateAnalyzerReport || config.build.bundleAnalyzerReport) {
  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
    .BundleAnalyzerPlugin

  if (config.build.bundleAnalyzerReport) {
    webpackConfig.plugins.push(
      new BundleAnalyzerPlugin({
        analyzerPort: 8080,
        generateStatsFile: false
      })
    )
  }

  if (config.build.generateAnalyzerReport) {
    webpackConfig.plugins.push(
      new BundleAnalyzerPlugin({
        analyzerMode: 'static',
        reportFilename: 'bundle-report.html',
        openAnalyzer: false
      })
    )
  }
}

module.exports = webpackConfig
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2017-2019 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
// SPDX-License-Identifier: MIT
//
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

module.exports = {
  NODE_ENV: '"development"',
  ENV_CONFIG: '"dev"',
+6 −0
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2017-2019 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
// SPDX-License-Identifier: MIT
//
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

'use strict'
// Template version: 1.2.6
// see http://vuejs-templates.github.io/webpack for documentation.
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2017-2019 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
// SPDX-License-Identifier: MIT
//
// SPDX-License-Identifier: AGPL-3.0-only
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>

module.exports = {
  NODE_ENV: '"production"',
  ENV_CONFIG: '"prod"',
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2017-2019 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
// SPDX-License-Identifier: MIT

module.exports = {
  NODE_ENV: '"production"',
  ENV_CONFIG: '"sit"',
+8 −0
Original line number Diff line number Diff line
#!/bin/sh

# SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
# SPDX-License-Identifier: AGPL-3.0-only

set -e
envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < "/etc/nginx/nginx.conf.tpl" > "/etc/nginx/nginx.conf"
exec "$@"

docker/nginx.conf.tpl

0 → 100644
+35 −0
Original line number Diff line number Diff line
# SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
# SPDX-License-Identifier: AGPL-3.0-only

user  nginx;
worker_processes  1;
error_log  /var/log/nginx/error.log warn;
pid        /tmp/nginx.pid;
events {
    worker_connections  1024;
}
http {
    client_body_temp_path /tmp/client_temp;
    proxy_temp_path       /tmp/proxy_temp_path;
    fastcgi_temp_path     /tmp/fastcgi_temp;
    uwsgi_temp_path       /tmp/uwsgi_temp;
    scgi_temp_path        /tmp/scgi_temp;
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  /var/log/nginx/access.log  main;
    sendfile        on;
    keepalive_timeout  65;
    proxy_cache_path /tmp/pleroma-media-cache levels=1:2 keys_zone=pleroma_media_cache:10m max_size=10g
                     inactive=720m use_temp_path=off;
    server {
        listen 80;
        server_name _;
        root /usr/share/nginx/html;
        location / {
        try_files $uri $uri/ /index.html;
      }
    }
}
+5 −1
Original line number Diff line number Diff line
<!--
SPDX-FileCopyrightText: 2017-2019 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
SPDX-License-Identifier: MIT
-->

<!DOCTYPE html>
<html>
  <head>
@@ -8,7 +13,6 @@
    <title>Admin FE</title>
  </head>
  <body>
    <script src=<%= BASE_URL %>/tinymce4.7.5/tinymce.min.js></script>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
+69 −97
Original line number Diff line number Diff line
@@ -5,20 +5,13 @@
  "author": "Pan <panfree23@gmail.com>",
  "license": "MIT",
  "scripts": {
    "dev": "cross-env BABEL_ENV=development webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
    "build:prod": "cross-env NODE_ENV=production env_config=prod node build/build.js",
    "build:sit": "cross-env NODE_ENV=production env_config=sit node build/build.js",
    "dev": "cross-env BABEL_ENV=development NODE_OPTIONS=--openssl-legacy-provider webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
    "build:prod": "cross-env NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production env_config=prod node build/build.js",
    "build:sit": "cross-env NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production env_config=sit node build/build.js",
    "lint": "eslint --ext .js,.vue src",
    "test": "jest",
    "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
    "precommit": "lint-staged",
    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
  },
  "lint-staged": {
    "src/**/*.{js,vue}": [
      "eslint --fix",
      "git add"
    ]
    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.json"
  },
  "keywords": [
    "vue",
@@ -29,110 +22,88 @@
  ],
  "repository": {
    "type": "git",
    "url": "git+https://github.com/PanJiaChen/vue-element-admin.git"
    "url": "git+https://git.pleroma.social/pleroma/admin-fe.git"
  },
  "resolutions": {
    "prosemirror-model": "1.18.3"
  },
  "bugs": {
    "url": "https://github.com/PanJiaChen/vue-element-admin/issues"
    "url": "https://git.pleroma.social/pleroma/admin-fe/-/issues"
  },
  "dependencies": {
    "@babel/runtime": "^7.3.4",
    "axios": "0.18.0",
    "clipboard": "1.7.1",
    "codemirror": "5.39.2",
    "default-passive-events": "^1.0.10",
    "driver.js": "0.8.1",
    "dropzone": "5.2.0",
    "echarts": "4.1.0",
    "element-ui": "^2.10.0",
    "file-saver": "1.3.8",
    "fuse.js": "3.4.2",
    "js-cookie": "2.2.0",
    "jsonlint": "1.6.3",
    "jszip": "3.1.5",
    "localforage": "^1.7.3",
    "lodash": "^4.17.11",
    "lodash.debounce": "^4.0.8",
    "moment": "^2.24.0",
    "@babel/runtime": "7.19.0",
    "axios": "0.27.2",
    "clipboard": "2.0.11",
    "element-ui": "2.15.12",
    "js-cookie": "2.2.1",
    "localforage": "1.10.0",
    "lodash": "4.17.21",
    "lodash.debounce": "4.0.8",
    "marked": "0.8.2",
    "luxon": "3.1.1",
    "normalize.css": "7.0.0",
    "nprogress": "0.2.0",
    "numeral": "^2.0.6",
    "screenfull": "4.0.0",
    "showdown": "1.8.6",
    "sortablejs": "1.7.0",
    "tui-editor": "1.2.7",
    "vue": "^2.6.8",
    "vue-count-to": "1.0.13",
    "vue-i18n": "^8.9.0",
    "vue-router": "3.0.2",
    "vue-splitpane": "1.0.2",
    "vue2-ace-editor": "^0.0.13",
    "vuedraggable": "^2.16.0",
    "vuex": "3.0.1",
    "xlsx": "^0.11.16"
    "numeral": "2.0.6",
    "tiptap": "1.32.2",
    "tiptap-extensions": "1.35.2",
    "vue": "2.7.8",
    "vue-i18n": "8.28.2",
    "vue-router": "3.6.5",
    "vuex": "3.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.3.4",
    "@babel/plugin-syntax-dynamic-import": "^7.2.0",
    "@babel/plugin-transform-runtime": "^7.3.4",
    "@babel/preset-env": "^7.3.4",
    "@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.2",
    "@vue/babel-preset-jsx": "^1.0.0-beta.2",
    "@vue/test-utils": "^1.0.0-beta.29",
    "autoprefixer": "8.5.0",
    "@babel/core": "7.19.1",
    "@babel/plugin-syntax-dynamic-import": "7.8.3",
    "@babel/plugin-transform-runtime": "7.19.1",
    "@babel/preset-env": "7.19.1",
    "@vue/babel-helper-vue-jsx-merge-props": "1.4.0",
    "@vue/babel-preset-jsx": "1.4.0",
    "@vue/test-utils": "1.3.3",
    "autoprefixer": "10.4.16",
    "babel-eslint": "8.2.6",
    "babel-helper-vue-jsx-merge-props": "2.0.3",
    "babel-jest": "^24.1.0",
    "babel-loader": "^8.0.5",
    "babel-plugin-dynamic-import-node-babel-7": "^2.0.7",
    "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
    "chalk": "2.4.1",
    "babel-jest": "25.5.1",
    "babel-loader": "8.2.5",
    "babel-plugin-dynamic-import-node-babel-7": "2.0.7",
    "babel-plugin-transform-es2015-modules-commonjs": "6.26.2",
    "compression-webpack-plugin": "2.0.0",
    "connect": "3.6.6",
    "copy-webpack-plugin": "4.5.2",
    "cross-env": "5.2.0",
    "css-loader": "1.0.0",
    "connect": "3.7.0",
    "cross-env": "7.0.3",
    "css-loader": "1.0.1",
    "eslint": "4.19.1",
    "eslint-friendly-formatter": "4.0.1",
    "eslint-loader": "2.0.0",
    "eslint-loader": "2.2.1",
    "eslint-plugin-vue": "4.7.1",
    "file-loader": "1.1.11",
    "flush-promises": "^1.0.2",
    "friendly-errors-webpack-plugin": "1.7.0",
    "flush-promises": "1.0.2",
    "hash-sum": "1.0.2",
    "html-webpack-plugin": "^3.2.0",
    "husky": "0.14.3",
    "jest": "^24.1.0",
    "jest-transform-stub": "^2.0.0",
    "lint-staged": "7.2.2",
    "mini-css-extract-plugin": "0.4.1",
    "node-notifier": "5.2.1",
    "node-sass": "^4.12.0",
    "optimize-css-assets-webpack-plugin": "5.0.0",
    "ora": "3.0.0",
    "html-webpack-plugin": "3.2.0",
    "jest": "25.5.4",
    "jest-transform-stub": "2.0.0",
    "mini-css-extract-plugin": "0.12.0",
    "sass": "1.57.1",
    "optimize-css-assets-webpack-plugin": "5.0.8",
    "ora": "3.4.0",
    "path-to-regexp": "2.4.0",
    "portfinder": "1.0.13",
    "postcss-loader": "2.1.6",
    "postcss-url": "7.3.2",
    "rimraf": "2.6.2",
    "sass-loader": "7.0.3",
    "script-ext-html-webpack-plugin": "2.0.1",
    "postcss": "8.4.20",
    "postcss-loader": "4.3.0",
    "postcss-url": "10.1.3",
    "rimraf": "2.7.1",
    "sass-loader": "7.3.1",
    "script-loader": "0.7.2",
    "semver": "5.5.0",
    "serve-static": "1.13.2",
    "shelljs": "0.8.2",
    "svg-sprite-loader": "3.8.0",
    "svgo": "1.0.5",
    "uglifyjs-webpack-plugin": "1.2.7",
    "url-loader": "1.0.1",
    "vue-jest": "4.0.0-beta.2",
    "vue-loader": "15.3.0",
    "vue-style-loader": "4.1.2",
    "vue-template-compiler": "^2.6.8",
    "webpack": "^4.29.6",
    "webpack-bundle-analyzer": "2.13.1",
    "webpack-cli": "^3.2.3",
    "webpack-dev-server": "3.1.14",
    "webpack-merge": "4.1.4"
    "semver": "5.7.1",
    "serve-static": "1.15.0",
    "svg-sprite-loader": "3.9.2",
    "svgo": "2.8.0",
    "uglifyjs-webpack-plugin": "1.3.0",
    "vue-jest": "4.0.1",
    "vue-loader": "15.10.1",
    "vue-style-loader": "4.1.3",
    "vue-template-compiler": "2.7.8",
    "webpack": "4.46.0",
    "webpack-cli": "3.3.12",
    "webpack-dev-server": "3.11.3",
    "webpack-merge": "4.2.2"
  },
  "engines": {
    "node": ">= 6.0.0",
@@ -144,6 +115,7 @@
    "not ie <= 8"
  ],
  "jest": {
    "coverageReporters": ["cobertura", "text-summary"],
    "moduleFileExtensions": [
      "js",
      "json",

renovate.json

0 → 100644
+6 −0
Original line number Diff line number Diff line
{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": [
    "config:base"
  ]
}
+5 −0
Original line number Diff line number Diff line
<!--
SPDX-FileCopyrightText: 2017-2019 PanJiaChen <https://github.com/PanJiaChen/vue-element-admin>
SPDX-License-Identifier: MIT
-->

<template>
  <div id="app">
    <router-view/>
+10 −0
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

export async function needReboot(authHost, token) {
  return Promise.resolve({ data: false })
}

export async function restartApp(authHost, token) {
  return Promise.resolve()
}
+620 −0
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

export async function fetchChat(id, authHost, token) {
  return Promise.resolve({ data: userChats[0] })
}

export async function fetchChatMessages(id, max_id, authHost, token) {
  return Promise.resolve({ data: chatMessages })
}

export async function deleteChat(chat_id, message_id, authHost, token) {
  return Promise.resolve({ data: userChats[0] })
}

export const userChats = [
  {
    id: '9y8e7ESoVUiKVMAoCW',
    last_message: {
      account_id: '9xUIiQfGrdPJDZe39s',
      attachment: null,
      card: null,
      chat_id: '9y8e7ESoVUiKVMAoCW',
      content: 'heyy',
      created_at: '2020-09-11T00:07:13.000Z',
      emojis: [],
      id: '9z22Q9MzWiAk7GZnNY',
      unread: false
    },
    receiver: {
      acct: 'test10',
      avatar: 'http://localhost:4000/images/avi.png',
      avatar_static: 'http://localhost:4000/images/avi.png',
      bot: false,
      created_at: '2020-07-27T00:33:02.000Z',
      display_name: 'test10',
      emojis: [],
      fields: [],
      followers_count: 2,
      following_count: 1,
      header: 'http://localhost:4000/images/banner.png',
      header_static: 'http://localhost:4000/images/banner.png',
      id: '9xUj5WTmzSlFPN6OLg',
      locked: false,
      note: '',
      pleroma: {
        accepts_chat_messages: true,
        ap_id: 'http://localhost:4000/users/test10',
        background_image: null,
        is_confirmed: true,
        favicon: null,
        hide_favorites: true,
        hide_followers: false,
        hide_followers_count: false,
        hide_follows: false,
        hide_follows_count: false,
        is_admin: false,
        is_moderator: true,
        relationship: {},
        skip_thread_containment: false,
        tags: [
          'mrf_tag:media-force-nsfw',
          'mrf_tag:media-strip',
          'mrf_tag:force-unlisted'
        ]
      },
      source: {
        fields: [],
        note: '',
        pleroma: {
          actor_type: 'Person',
          discoverable: false
        },
        sensitive: false
      },
      statuses_count: 20,
      url: 'http://localhost:4000/users/test10',
      username: 'test10'
    },
    sender: {
      acct: 'mk',
      avatar: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
      avatar_static: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
      bot: false,
      created_at: '2020-07-26T19:37:31.000Z',
      display_name: 'mk',
      emojis: [],
      fields: [
        {
          name: 'website',
          value: '<a href="http://marykatefain.com" rel="ugc">marykatefain.com</a>'
        }
      ],
      followers_count: 2,
      following_count: 1,
      header: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
      header_static: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
      id: '9xUIiQfGrdPJDZe39s',
      locked: false,
      note: 'a bio about me',
      pleroma: {
        accepts_chat_messages: true,
        ap_id: 'https://localhost/users/mk',
        background_image: null,
        is_confirmed: true,
        favicon: null,
        hide_favorites: true,
        hide_followers: false,
        hide_followers_count: false,
        hide_follows: false,
        hide_follows_count: false,
        is_admin: true,
        is_moderator: false,
        relationship: {},
        skip_thread_containment: false,
        tags: [
          'verified'
        ]
      },
      source: {
        fields: [
          {
            name: 'website',
            value: 'marykatefain.com'
          }
        ],
        note: 'a bio about me',
        pleroma: {
          actor_type: 'Person',
          discoverable: false
        },
        sensitive: false
      },
      statuses_count: 77,
      url: 'https://localhost/users/mk',
      username: 'mk'
    },
    unread: 0,
    updated_at: '2020-09-11T00:07:13.000Z'
  },
  {
    id: '9y8dwDAQzFBZIZJzEG',
    last_message: {
      account_id: '9xUIiQfGrdPJDZe39s',
      attachment: null,
      card: null,
      chat_id: '9y8dwDAQzFBZIZJzEG',
      content: 'hiiiiiiiiiiiiiiiiiii',
      created_at: '2020-08-15T06:45:13.000Z',
      emojis: [],
      id: '9y8e4EZndDmfzA0lGa',
      unread: false
    },
    receiver: {
      acct: 'user2',
      avatar: 'http://localhost:4000/media/5a702176cd5181f81532a42fafa87953db1586ca39a3c83cd3df1bc9b5cb7d07.png',
      avatar_static: 'http://localhost:4000/media/5a702176cd5181f81532a42fafa87953db1586ca39a3c83cd3df1bc9b5cb7d07.png',
      bot: false,
      created_at: '2020-08-01T19:23:57.000Z',
      display_name: 'User2',
      emojis: [],
      fields: [],
      followers_count: 0,
      following_count: 2,
      header: 'http://localhost:4000/media/1b1fc87d56e4f94b0ca8eb23100c92f67371bfa37b2898cd804341ed1a2d5c84.jpg',
      header_static: 'http://localhost:4000/media/1b1fc87d56e4f94b0ca8eb23100c92f67371bfa37b2898cd804341ed1a2d5c84.jpg',
      id: '9xfhRuCIyydruc0Sh6',
      locked: false,
      note: 'Just me!',
      pleroma: {
        accepts_chat_messages: true,
        ap_id: 'http://localhost:4000/users/user2',
        background_image: null,
        is_confirmed: false,
        favicon: null,
        hide_favorites: true,
        hide_followers: false,
        hide_followers_count: false,
        hide_follows: false,
        hide_follows_count: false,
        is_admin: false,
        is_moderator: false,
        relationship: {},
        skip_thread_containment: false,
        tags: [
          'mrf_tag:force-unlisted',
          'mrf_tag:media-strip'
        ]
      },
      source: {
        fields: [],
        note: 'Just me!',
        pleroma: {
          actor_type: 'Person',
          discoverable: false
        },
        sensitive: false
      },
      statuses_count: 69,
      url: 'http://localhost:4000/users/user2',
      username: 'user2'
    },
    sender: {
      acct: 'mk',
      avatar: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
      avatar_static: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
      bot: false,
      created_at: '2020-07-26T19:37:31.000Z',
      display_name: 'mk',
      emojis: [],
      fields: [
        {
          name: 'website',
          value: '<a href="http://marykatefain.com" rel="ugc">marykatefain.com</a>'
        }
      ],
      followers_count: 2,
      following_count: 1,
      header: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
      header_static: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
      id: '9xUIiQfGrdPJDZe39s',
      locked: false,
      note: 'a bio about me',
      pleroma: {
        accepts_chat_messages: true,
        ap_id: 'https://localhost/users/mk',
        background_image: null,
        is_confirmed: true,
        favicon: null,
        hide_favorites: true,
        hide_followers: false,
        hide_followers_count: false,
        hide_follows: false,
        hide_follows_count: false,
        is_admin: true,
        is_moderator: false,
        relationship: {},
        skip_thread_containment: false,
        tags: [
          'verified'
        ]
      },
      source: {
        fields: [
          {
            name: 'website',
            value: 'marykatefain.com'
          }
        ],
        note: 'a bio about me',
        pleroma: {
          actor_type: 'Person',
          discoverable: false
        },
        sensitive: false
      },
      statuses_count: 77,
      url: 'https://localhost/users/mk',
      username: 'mk'
    },
    unread: 0,
    updated_at: '2020-08-15T06:45:13.000Z'
  },
  {
    id: '9y8dubemxq32fkkoeu',
    last_message: null,
    receiver: {
      acct: 'mk',
      avatar: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
      avatar_static: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
      bot: false,
      created_at: '2020-07-26T19:37:31.000Z',
      display_name: 'mk',
      emojis: [],
      fields: [
        {
          name: 'website',
          value: '<a href="http://marykatefain.com" rel="ugc">marykatefain.com</a>'
        }
      ],
      followers_count: 2,
      following_count: 1,
      header: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
      header_static: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
      id: '9xUIiQfGrdPJDZe39s',
      locked: false,
      note: 'a bio about me',
      pleroma: {
        accepts_chat_messages: true,
        ap_id: 'https://localhost/users/mk',
        background_image: null,
        is_confirmed: true,
        favicon: null,
        hide_favorites: true,
        hide_followers: false,
        hide_followers_count: false,
        hide_follows: false,
        hide_follows_count: false,
        is_admin: true,
        is_moderator: false,
        relationship: {},
        skip_thread_containment: false,
        tags: [
          'verified'
        ]
      },
      source: {
        fields: [
          {
            name: 'website',
            value: 'marykatefain.com'
          }
        ],
        note: 'a bio about me',
        pleroma: {
          actor_type: 'Person',
          discoverable: false
        },
        sensitive: false
      },
      statuses_count: 77,
      url: 'https://localhost/users/mk',
      username: 'mk'
    },
    sender: {
      acct: 'mk',
      avatar: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
      avatar_static: 'http://localhost:4000/media/9051960b674309674f2f1a3a0e05916013260af13f672df32c869cb841958a44.gif',
      bot: false,
      created_at: '2020-07-26T19:37:31.000Z',
      display_name: 'mk',
      emojis: [],
      fields: [
        {
          name: 'website',
          value: '<a href="http://marykatefain.com" rel="ugc">marykatefain.com</a>'
        }
      ],
      followers_count: 2,
      following_count: 1,
      header: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
      header_static: 'http://localhost:4000/media/139889433c4085dcf219171fdcc48659fa3fb5090a748ca37513fda051226b12.gif',
      id: '9xUIiQfGrdPJDZe39s',
      locked: false,
      note: 'a bio about me',
      pleroma: {
        accepts_chat_messages: true,
        ap_id: 'https://localhost/users/mk',
        background_image: null,
        is_confirmed: true,
        favicon: null,
        hide_favorites: true,
        hide_followers: false,
        hide_followers_count: false,
        hide_follows: false,
        hide_follows_count: false,
        is_admin: true,
        is_moderator: false,
        relationship: {},
        skip_thread_containment: false,
        tags: [
          'verified'
        ]
      },
      source: {
        fields: [
          {
            name: 'website',
            value: 'marykatefain.com'
          }
        ],
        note: 'a bio about me',
        pleroma: {
          actor_type: 'Person',
          discoverable: false
        },
        sensitive: false
      },
      statuses_count: 77,
      url: 'https://localhost/users/mk',
      username: 'mk'
    },
    unread: 0,
    updated_at: '2020-08-15T06:43:29.000Z'
  }
]

export const chatMessages = [
  {
    account_id: '9xUIiQfGrdPJDZe39s',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'heyy',
    created_at: '2020-09-11T00:07:13.000Z',
    emojis: [],
    id: '9z22Q9MzWiAk7GZnNY',
    unread: false
  },
  {
    account_id: '9xUIiQfGrdPJDZe39s',
    attachment: {
      description: null,
      id: '-1990764178',
      pleroma: {
        mime_type: 'image/png'
      },
      preview_url: 'http://localhost:4000/media/b087b890b39aa8301f736e8b45c02213183986c8a994c2c99e921ae85afa17e4.png',
      remote_url: 'http://localhost:4000/media/b087b890b39aa8301f736e8b45c02213183986c8a994c2c99e921ae85afa17e4.png',
      text_url: 'http://localhost:4000/media/b087b890b39aa8301f736e8b45c02213183986c8a994c2c99e921ae85afa17e4.png',
      type: 'image',
      url: 'http://localhost:4000/media/b087b890b39aa8301f736e8b45c02213183986c8a994c2c99e921ae85afa17e4.png'
    },
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: null,
    created_at: '2020-09-10T20:35:33.000Z',
    emojis: [],
    id: '9z1jWuQNaq8Ef6fdOS',
    unread: false
  },
  {
    account_id: '9xUIiQfGrdPJDZe39s',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'probably',
    created_at: '2020-09-10T16:57:33.000Z',
    emojis: [],
    id: '9z1Q4eXb9kBYA8rNT6',
    unread: false
  },
  {
    account_id: '9xUj5WTmzSlFPN6OLg',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'That has got to be 20 by now',
    created_at: '2020-09-10T16:57:29.000Z',
    emojis: [],
    id: '9z1Q4LQAF9wuraEfk8',
    unread: false
  },
  {
    account_id: '9xUIiQfGrdPJDZe39s',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'I miss bars :(',
    created_at: '2020-09-10T16:57:22.000Z',
    emojis: [],
    id: '9z1Q3gmlKEfEpnUdm4',
    unread: false
  },
  {
    account_id: '9xUIiQfGrdPJDZe39s',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'Yeah tying to!',
    created_at: '2020-09-10T16:57:15.000Z',
    emojis: [],
    id: '9z1Q307VxCiKVhs6eO',
    unread: false
  },
  {
    account_id: '9xUj5WTmzSlFPN6OLg',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'staying safe with covid and such?',
    created_at: '2020-09-10T16:57:10.000Z',
    emojis: [],
    id: '9z1Q2Z56U3k6ePXIe1',
    unread: false
  },
  {
    account_id: '9xUj5WTmzSlFPN6OLg',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'how have you been?',
    created_at: '2020-09-10T16:57:06.000Z',
    emojis: [],
    id: '9z1Q29XvQHLfSGowxU',
    unread: false
  },
  {
    account_id: '9xUj5WTmzSlFPN6OLg',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'so what are you doing?',
    created_at: '2020-09-10T16:57:02.000Z',
    emojis: [],
    id: '9z1Q1lPb9aQYbUjxeD',
    unread: false
  },
  {
    account_id: '9xUIiQfGrdPJDZe39s',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'crazy',
    created_at: '2020-09-10T16:56:55.000Z',
    emojis: [],
    id: '9z1Q19zQHwVMXbD2DA',
    unread: false
  },
  {
    account_id: '9xUIiQfGrdPJDZe39s',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'omg yeah same',
    created_at: '2020-09-10T16:56:54.000Z',
    emojis: [],
    id: '9z1Q12zWJBQIpsCVtI',
    unread: false
  },
  {
    account_id: '9xUIiQfGrdPJDZe39s',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'hahahaha',
    created_at: '2020-09-10T16:56:51.000Z',
    emojis: [],
    id: '9z1Q0pyKiHkWSQXsjg',
    unread: false
  },
  {
    account_id: '9xUj5WTmzSlFPN6OLg',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'I think this is 13',
    created_at: '2020-09-10T16:56:45.000Z',
    emojis: [],
    id: '9z1Q0Ft6sEBGXnpCb3',
    unread: false
  },
  {
    account_id: '9xUj5WTmzSlFPN6OLg',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'We need to keep typing until we hit 20',
    created_at: '2020-09-10T16:56:42.000Z',
    emojis: [],
    id: '9z1PzywjrTyy08OMOO',
    unread: false
  },
  {
    account_id: '9xUIiQfGrdPJDZe39s',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'That&#39;s nice',
    created_at: '2020-09-10T16:56:03.000Z',
    emojis: [],
    id: '9z1PwOkJzs8orKsJDU',
    unread: false
  },
  {
    account_id: '9xUj5WTmzSlFPN6OLg',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'I&#39;ve been good! Keeping busy',
    created_at: '2020-09-10T16:56:00.000Z',
    emojis: [],
    id: '9z1Pw7qmoaDASSljQv',
    unread: false
  },
  {
    account_id: '9xUIiQfGrdPJDZe39s',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: '*been',
    created_at: '2020-09-10T16:55:55.000Z',
    emojis: [],
    id: '9z1PvcWVHwZFIa2b0y',
    unread: false
  },
  {
    account_id: '9xUIiQfGrdPJDZe39s',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'How have you ben?',
    created_at: '2020-09-10T16:55:52.000Z',
    emojis: [],
    id: '9z1PvK4BuTE03YejNw',
    unread: false
  },
  {
    account_id: '9xUIiQfGrdPJDZe39s',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'Oh it&#39;s okay! No worries!',
    created_at: '2020-09-10T16:55:44.000Z',
    emojis: [],
    id: '9z1Puc4hTDUJcOYW4O',
    unread: false
  },
  {
    account_id: '9xUj5WTmzSlFPN6OLg',
    attachment: null,
    card: null,
    chat_id: '9y8e7ESoVUiKVMAoCW',
    content: 'didn&#39;t mean to ignore you',
    created_at: '2020-09-10T16:55:32.000Z',
    emojis: [],
    id: '9z1PtWGNamQTIvUspk',
    unread: false
  }
]
+54 −0
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

export async function addNewEmojiFile(packName, file, shortcode, filename, host, token) {
  return Promise.resolve()
}

export function addressOfEmojiInPack(host, packName, name) {
  return Promise.resolve()
}

export async function createPack(host, token, packName) {
  return Promise.resolve()
}

export async function deleteEmojiFile(packName, shortcode, host, token) {
  return Promise.resolve()
}

export async function deletePack(host, token, packName) {
  return Promise.resolve()
}

export async function downloadFrom(instanceAddress, packName, as, host, token) {
  return Promise.resolve()
}

export async function fetchPack(packName, page, pageSize, host, token) {
  return Promise.resolve()
}

export async function importFromFS(host, token) {
  return Promise.resolve()
}

export async function listPacks(page, pageSize, host, token) {
  return Promise.resolve()
}

export async function listRemotePacks(instance, page, pageSize, host, token) {
  return Promise.resolve()
}

export async function reloadEmoji(host, token) {
  return Promise.resolve()
}

export async function savePackMetadata(host, token, packName, metadata) {
  return Promise.resolve()
}

export async function updateEmojiFile(packName, shortcode, newShortcode, newFilename, force, host, token) {
  return Promise.resolve()
}
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

let inviteTokens = [
  { expires_at: '01-01-2020', id: 1, invite_type: 'one_time', max_use: 3, token: 'DCN8XyTsVEuz9_KuxPlkbH1RgMsMHepwmZE2gyX07Jw=', used: false, uses: 1 },
  { expires_at: '02-02-2020', id: 2, invite_type: 'one_time', max_use: 1, token: 'KnJTHNedj2Mh14ckx06t-VfOuFL8oNA0nVAK1HLeLf4=', used: true, uses: 1 },
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

const users = [
  { username: 'bob', password: '123456', authHost: 'pleroma' }
]
@@ -8,7 +11,7 @@ export async function loginByUsername(username, password, authHost) {
  const verifyHost = user.authHost === authHost
  const data = {
    'token_type': 'Bearer',
    'scope': 'read write follow',
    'scope': 'read write follow push admin',
    'refresh_token': 'foo123',
    'me': 'bob',
    'expires_in': 600,
@@ -43,7 +46,7 @@ export function getUserInfo(token, authHost) {
    'statuses_count': 0,
    'cover_photo': '',
    'hide_follows': false,
    'pleroma': { 'confirmation_pending': false, 'deactivated': false, 'tags': ['force_nsfw'], 'is_admin': true },
    'pleroma': { 'is_confirmed': true, 'is_active': true, 'tags': ['force_nsfw'], 'is_admin': true },
    'profile_image_url_original': '',
    'created_at': 'Fri Mar 01 15:15:19 +0000 2019',
    'fields': [],
+23 −0
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

const urls = [
  'http://example.com/media/a688346.jpg',
  'http://example.com/media/fb1f4d.jpg'
]

export async function listBannedUrls(page, pageSize, authHost, token) {
  return Promise.resolve({ data: { page_size: 1, count: 2, urls }})
}

export async function purgeUrls(urls, ban, authHost, token) {
  return Promise.resolve()
}

export async function removeBannedUrls(urls, authHost, token) {
  return Promise.resolve()
}

export async function searchBannedUrls(query, page, pageSize, authHost, token) {
  return Promise.resolve()
}
+6 −0
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

export function uploadMedia({ formData, authHost }) {
  return Promise.resolve()
}
+14 −0
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

export async function fetchLog(authHost, token, params, page = 1) {
  return Promise.resolve()
}

export async function fetchAdmins(authHost, token) {
  return Promise.resolve()
}

export async function fetchModerators(authHost, token) {
  return Promise.resolve()
}
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

export async function getNodeInfo(authHost) {
  const data = {
    metadata: {
+7 −0
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

export async function fetchPeers(authHost, token) {
  const data = ['lain.com', 'heaven.com']
  return Promise.resolve({ data })
}
+14 −0
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

export async function fetchRelays(authHost, token) {
  return Promise.resolve()
}

export async function addRelay(relay_url, authHost, token) {
  return Promise.resolve()
}

export async function deleteRelay(relay_url, authHost, token) {
  return Promise.resolve()
}
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

const reports = [
  { created_at: '2019-05-21T21:35:33.000Z', account: { acct: 'benj', display_name: 'Benjamin Fame', tags: [] }, actor: { acct: 'admin' }, state: 'open', id: '2', content: 'This is a report', statuses: [] },
  { created_at: '2019-05-20T22:45:33.000Z', account: { acct: 'alice', display_name: 'Alice Pool', tags: [] }, actor: { acct: 'admin2' }, state: 'resolved', id: '1', content: 'Please block this user', statuses: [] },
  { created_at: '2019-05-18T13:01:33.000Z', account: { acct: 'nick', display_name: 'Nick Keys', tags: [] }, actor: { acct: 'admin' }, state: 'closed', id: '3', content: '', statuses: [] },
  { created_at: '2019-05-21T21:35:33.000Z', account: { acct: 'benj', display_name: 'Benjamin Fame', tags: [] }, actor: { acct: 'admin' }, state: 'open', id: '5', content: 'This is a report', statuses: [] },
  { created_at: '2019-05-20T22:45:33.000Z', account: { acct: 'alice', display_name: 'Alice Pool', tags: [] }, actor: { acct: 'admin2' }, state: 'resolved', id: '7', content: 'Please block this user', statuses: [
    { account: { display_name: 'Alice Pool', avatar: '' }, visibility: 'public', sensitive: false, id: '11', content: 'Hey!', url: '', created_at: '2019-05-10T21:35:33.000Z' },
    { account: { display_name: 'Alice Pool', avatar: '' }, visibility: 'unlisted', sensitive: true, id: '10', content: 'Bye!', url: '', created_at: '2019-05-10T21:00:33.000Z' }
  { created_at: '2019-05-21T21:35:33.000Z', account: { nickname: 'benjamin', tags: [] }, actor: {}, state: 'open', id: '2', content: 'This is a report', statuses: [] },
  { created_at: '2019-05-20T22:45:33.000Z', account: { nickname: 'alice', tags: [] }, actor: {}, state: 'resolved', id: '1', content: 'Please block this user', statuses: [] },
  { created_at: '2019-05-18T13:01:33.000Z', account: { nickname: 'nick_keys', tags: [] }, actor: {}, state: 'closed', id: '3', content: '', statuses: [] },
  { created_at: '2019-05-21T21:35:33.000Z', account: { nickname: 'benjamin', tags: [] }, actor: {}, state: 'open', id: '5', content: 'This is a report', statuses: [] },
  { created_at: '2019-05-20T22:45:33.000Z', account: { nickname: 'alice', tags: [] }, actor: {}, state: 'resolved', id: '7', content: 'Please block this user', statuses: [
    { account: { nickname: 'alice', avatar: '' }, visibility: 'public', sensitive: false, id: '11', content: 'Hey!', url: '', created_at: '2019-05-10T21:35:33.000Z' },
    { account: { nickname: 'alice', avatar: '' }, visibility: 'unlisted', sensitive: true, id: '10', content: 'Bye!', url: '', created_at: '2019-05-10T21:00:33.000Z' }
  ] },
  { created_at: '2019-05-18T13:01:33.000Z', account: { acct: 'nick', display_name: 'Nick Keys', tags: [] }, actor: { acct: 'admin' }, state: 'closed', id: '6', content: '', statuses: [] },
  { created_at: '2019-05-18T13:01:33.000Z', account: { acct: 'nick', display_name: 'Nick Keys', tags: [] }, actor: { acct: 'admin' }, state: 'closed', id: '4', content: '', statuses: [] }
  { created_at: '2019-05-18T13:01:33.000Z', account: { nickname: 'nick_keys', tags: [] }, actor: {}, state: 'closed', id: '6', content: '', statuses: [] },
  { created_at: '2019-05-18T13:01:33.000Z', account: { nickname: 'nick_keys', tags: [] }, actor: {}, state: 'closed', id: '4', content: '', statuses: [] }
]

export async function fetchReports(limit, max_id, authHost, token) {
  const paginatedReports = max_id.length > 0 ? reports.slice(5) : reports.slice(0, 5)
  return Promise.resolve({ data: { reports: paginatedReports }})
}

export async function filterReports(filter, limit, max_id, authHost, token) {
  const filteredReports = reports.filter(report => report.state === filter)
  const paginatedReports = max_id.length > 0 ? filteredReports.slice(5) : filteredReports.slice(0, 5)
  return Promise.resolve({ data: { reports: paginatedReports }})
export async function fetchReports(filter, page, pageSize, authHost, token) {
  return filter.length > 0
    ? Promise.resolve({ data: { reports: reports.filter(report => report.state === filter) }})
    : Promise.resolve({ data: { reports }})
}

export async function changeState(state, id, authHost, token) {
  const report = reports.find(report => report.id === id)
  return Promise.resolve({ data: { ...report, state }})
export async function changeState(reportsData, authHost, token) {
  return Promise.resolve({ data: '' })
}

export async function changeStatusScope(id, sensitive, visibility, authHost, token) {
  const status = reports[4].statuses[0]
  return Promise.resolve({ data: { ...status, sensitive, visibility }})
export async function createNote(content, reportID, authHost, token) {
  return Promise.resolve()
}

export async function deleteStatus(statusId, authHost, token) {
export async function deleteNote(noteID, reportID, authHost, token) {
  return Promise.resolve()
}

// export async function changeStatusScope(id, sensitive, visibility, authHost, token) {
//   const status = reports[4].statuses[0]
//   return Promise.resolve({ data: { ...status, sensitive, visibility }})
// }

// export async function deleteStatus(statusId, authHost, token) {
//   return Promise.resolve()
// }
+62 −0
Original line number Diff line number Diff line
// SPDX-FileCopyrightText: 2019-2022 Pleroma Authors <https://pleroma.social>
// SPDX-License-Identifier: AGPL-3.0-only

const configsWithTagPolicy = {
  configs: [{
    group: ':pleroma',
    key: ':mrf',
    value: [
      { tuple: [':policies', ['Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy', 'Pleroma.Web.ActivityPub.MRF.TagPolicy']] },
      { tuple: [':transparency', true] },
      { tuple: [':transparency_exclusions', []] }
    ] },
  {
    group: ':pleroma',
    key: ':media_proxy',
    value: [
      { tuple: [':enabled', true] },
      { tuple: [':invalidation', [
        { tuple: [':provider', 'Pleroma.Web.MediaProxy.Invalidation.Script'] },
        { tuple: [':enabled', true] }
      ]] }
    ] }],
  need_reboot: false
}

const configAfterUpdate = {
  configs: [{
    db: [':policies'],
    group: ':pleroma',
    key: ':mrf',
    value: [{ tuple: [':policies', ['Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy', 'Pleroma.Web.ActivityPub.MRF.TagPolicy']] }]
  }],
  need_reboot: false
}

export async function fetchSettings(authHost, token) {
  return Promise.resolve({ data: configsWithTagPolicy })
}

export async function getInstanceDocument(name, authHost, token) {
  return Promise.resolve({ data: '<h1>Instance panel</h1>' })
}

export async function updateSettings(configs, authHost, token) {
  return Promise.resolve({ data: configAfterUpdate })
}

export async function deleteInstanceDocument(name, authHost, token) {
  return Promise.resolve()
}

export async function fetchDescription(authHost, token) {
  return Promise.resolve()
}

export async function updateInstanceDocument(name, formData, authHost, token) {
  return Promise.resolve()
}

export async function removeSettings(configs, authHost, token) {
  return Promise.resolve()
}