Migrate everything to pl-api

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-08-28 20:58:20 +02:00
parent 0ddf6f2768
commit eb231d562e
50 changed files with 610 additions and 466 deletions

View File

@@ -2,7 +2,6 @@ import {
Map as ImmutableMap,
List as ImmutableList,
Set as ImmutableSet,
fromJS,
} from 'immutable';
import trimStart from 'lodash/trimStart';
@@ -37,18 +36,18 @@ const toSimplePolicy = (configs: ImmutableList<Config>): MRFSimple => {
}
};
const fromSimplePolicy = (simplePolicy: Policy): ImmutableList<Config> => {
const mapper = ([key, hosts]: [key: string, hosts: ImmutableList<string>]) => fromJS({ tuple: [`:${key}`, hosts] });
const fromSimplePolicy = (simplePolicy: Policy)=> {
const mapper = ([key, hosts]: [key: string, hosts: ImmutableList<string>]) => ({ tuple: [`:${key}`, hosts.toJS()] });
const value = Object.entries(simplePolicy).map(mapper);
return ImmutableList([
ImmutableMap({
return [
{
group: ':pleroma',
key: ':mrf_simple',
value: ImmutableList(value),
}),
]);
value: value,
},
];
};
const ConfigDB = {

View File

@@ -1,7 +1,7 @@
import { List as ImmutableList, fromJS } from 'immutable';
import { emojiReactionSchema } from 'pl-api';
import { normalizeStatus } from 'pl-fe/normalizers';
import { emojiReactionSchema } from 'pl-fe/schemas';
import {
sortEmoji,