mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
Adds a WarpDrive store (`service:warp-store`, LegacyMode + JSON:API cache) alongside the existing `service:store`, routing requests through Discourse's `ajax()` helper. `RestCompatModel` bridges legacy `RestModel` callsites (`get`/`set`/`setProperties`, `store.createRecord`, `save`, `destroyRecord`) onto it. Converts **badge, user-badge, topic-details, bookmark, tag, tag-group, tag-info, tag-notification, tag-settings and archetype**, with per-model schemas, request builders and payload normalizers. Attributes outside a schema (plugin `add_to_serializer` fields, ad-hoc `create` keys) are retained separately so nothing the server sends is dropped.
29 lines
917 B
JavaScript
29 lines
917 B
JavaScript
import { ArchetypeSchema } from "./archetype";
|
|
import { BadgeSchema } from "./badge";
|
|
import { BadgeGroupingSchema } from "./badge-grouping";
|
|
import { BadgeTypeSchema } from "./badge-type";
|
|
import { BookmarkSchema } from "./bookmark";
|
|
import { TagSchema } from "./tag";
|
|
import { TagGroupSchema } from "./tag-group";
|
|
import { TagInfoSchema } from "./tag-info";
|
|
import { TagNotificationSchema } from "./tag-notification";
|
|
import { TagSettingsSchema } from "./tag-settings";
|
|
import { TopicDetailsSchema } from "./topic-details";
|
|
import { UserBadgeSchema } from "./user-badge";
|
|
|
|
/** @type {import("@warp-drive/core/types/schema/fields").LegacyResourceSchema[]} */
|
|
export const schemas = [
|
|
ArchetypeSchema,
|
|
BadgeSchema,
|
|
BadgeTypeSchema,
|
|
BadgeGroupingSchema,
|
|
BookmarkSchema,
|
|
TagSchema,
|
|
TagGroupSchema,
|
|
TagInfoSchema,
|
|
TagNotificationSchema,
|
|
TagSettingsSchema,
|
|
TopicDetailsSchema,
|
|
UserBadgeSchema,
|
|
];
|