Просмотр исходного кода

Merge pull request #2510 from visuddhinanda/development

Development
visuddhinanda 1 неделя назад
Родитель
Сommit
8c52e1701a

+ 6 - 4
api-v13/app/Http/Resources/V3/TermResource.php

@@ -4,6 +4,7 @@ namespace App\Http\Resources\V3;
 
 use App\Http\Resources\Concerns\ResolvesActor;
 use App\Models\DhammaTerm;
+use App\Services\ChannelService;
 use App\Services\Markup\MarkupService;
 use App\Services\V3\TermService;
 use Illuminate\Http\JsonResponse;
@@ -12,10 +13,11 @@ use Illuminate\Http\Request;
 /**
  * 术语 / 百科词条(`dhamma_terms` 表)。
  *
- * **本类不查库。** 编辑者、协作者、分类从预加载的关系上取;`abilities`、`summary_text`、`body`
+ * **本类不查库。** 编辑者、协作者、分类从预加载的关系上取;`channel`、`abilities`、`summary_text`、`body`
  * 由 {@see TermService} 挂上。
  *
- * - `id` 是 guid(不暴露雪花 id);`channel_id` 为空的是 studio 级术语,`channel` 是它的名字摘要
+ * - `id` 是 guid(不暴露雪花 id);`channel_id` 为空的是 studio 级术语,`channel` 是所属 channel 的摘要({@see ChannelService::summary()},
+ *   `studio_id` 是 channel 拥有者的 uuid)
  * - `summary` / `note` 是源码,方言见 `content_type`;`body` 是渲染后的「摘要 + 正文」节点树({@see MarkupService}),
  *   单条里有,按词查带 `with_body` 时每条也有;单条带 `format=html` 时换成 HTML 字符串 `html`(给 WebView 显示的客户端)
  * - `summary_text` 是纯文本摘要:有 summary 用它,没有取正文第一段
@@ -37,7 +39,7 @@ class TermResource extends BaseResource
      *     other_meaning: string|null,
      *     language: string,
      *     channel_id: string|null,
-     *     channel: array{id: string, name: string}|null,
+     *     channel: array{id: string, name: string, type: string, lang: string, studio_id: string, status: int}|null,
      *     owner_id: string,
      *     quality: string|null,
      *     content_type: string,
@@ -69,7 +71,7 @@ class TermResource extends BaseResource
             'other_meaning' => $this->other_meaning,
             'language' => (string) $this->language,
             'channel_id' => $this->channelUid(),
-            'channel' => $this->channel ? ['id' => (string) $this->channel->uid, 'name' => (string) $this->channel->name] : null,
+            'channel' => $this->channel_summary ?? null,
             'owner_id' => (string) $this->owner,
             'quality' => $this->quality,
             'content_type' => $this->effectiveContentType(),

+ 44 - 19
api-v13/app/Services/V3/TermService.php

@@ -7,6 +7,7 @@ use App\Facades\RedisCache;
 use App\Models\Channel;
 use App\Models\DhammaTerm;
 use App\Models\TermCategory;
+use App\Services\ChannelService;
 use App\Services\Markup\Format;
 use App\Services\Markup\MarkupService;
 use App\Services\Markup\RenderOptions;
@@ -60,6 +61,7 @@ class TermService
         private readonly AgentGrantService $agents,
         private readonly MarkupService $markup,
         private readonly UserService $users,
+        private readonly ChannelService $channelSummaries,
     ) {}
 
     /* ------------------------------------------------------------------ 读 */
@@ -475,21 +477,17 @@ class TermService
     }
 
     /**
-     * 预加载 {@see self::relations()} 与所属 channel。
-     *
-     * channel 只给真属于某个 channel 的加载:studio 级的老数据 channal 是空串,
-     * 统一 `with('channel')` 会拿空串去比 uuid 列,PostgreSQL 直接报错。
+     * 预加载 {@see self::relations()},并挂上所属 channel 的摘要 `channel_summary`({@see ChannelService::summaries()},
+     * 整批一次查询;studio 级术语与 channel 已不存在的是 null)。
      *
      * @param  EloquentCollection<int, DhammaTerm>  $terms
      */
     private function loadRelations(EloquentCollection $terms): void
     {
         $terms->load($this->relations());
-        $terms->filter(fn (DhammaTerm $term) => $term->channelUid() !== null)->load('channel:uid,name');
-        $terms->each(function (DhammaTerm $term) {
-            if ($term->channelUid() === null) {
-                $term->setRelation('channel', null);
-            }
+        $summaries = $this->channelSummaries->summaries($terms->map(fn (DhammaTerm $term) => $term->channelUid())->all());
+        $terms->values()->each(function (DhammaTerm $term, int $i) use ($summaries) {
+            $term->channel_summary = $summaries[$i] ?: null;
         });
     }
 
@@ -517,7 +515,7 @@ class TermService
                 'contentType' => $term->effectiveContentType(),
             ];
             $summary = trim((string) $term->summary);
-            $items["{$term->guid}|summary"] = $base + ['source' => $summary !== '' ? $summary : (string) $term->note];
+            $items["{$term->guid}|summary"] = $base + ['source' => $summary !== '' ? $summary : $this->firstParagraph((string) $term->note)];
             if ($withBody) {
                 $bodyChannels = ! empty($render['channels']) ? $render['channels'] : $base['channels'];
                 $items["{$term->guid}|body"] = ['channels' => $bodyChannels] + $base + ['source' => trim($summary."\n\n".(string) $term->note)];
@@ -533,7 +531,7 @@ class TermService
         foreach ($terms as $term) {
             $term->abilities = $abilities[$term->guid];
             $text = (string) $rendered[Format::Text->value]["{$term->guid}|summary"];
-            $term->summary_text = trim((string) $term->summary) !== '' ? trim($text) : $this->firstParagraph($text);
+            $term->summary_text = trim($text);
             if ($withBody && $bodyFormat === Format::Html) {
                 $term->html = (string) $rendered[Format::Html->value]["{$term->guid}|body"];
             } elseif ($withBody) {
@@ -543,18 +541,45 @@ class TermService
     }
 
     /**
-     * 纯文本渲染({@see Format::Text})里段落之间只隔一个换行,第一个非空行就是第一段。
+     * 正文源码(markdown / markdown-e2)的第一个自然段,渲染前在源码上取。
+     *
+     * 不能渲染后再切:纯文本渲染里段落之间与段内换行都只是一个 `\n`,分不出段。
+     * 自然段以空行分隔(两种方言相同),围栏(```)内的空行不算;跳过标题、围栏、分隔线、
+     * 以及只由模板组成的段(`{{toc}}` 等);段首只由模板组成的行(如 `{{ai}}` 提示)去掉。
+     * 一段也没有时退回整篇。
      */
-    private function firstParagraph(string $text): string
-    {
-        foreach (preg_split('/\n/u', $text) ?: [] as $paragraph) {
-            $paragraph = trim($paragraph);
-            if ($paragraph !== '') {
-                return $paragraph;
+    private function firstParagraph(string $source): string
+    {
+        $blocks = [];
+        $lines = [];
+        $fenced = false;
+        foreach (preg_split('/\R/u', $source) ?: [] as $line) {
+            if (preg_match('/^\s*(```|~~~)/u', $line) === 1) {
+                $fenced = ! $fenced;
+            }
+            if (! $fenced && trim($line) === '') {
+                $blocks[] = $lines;
+                $lines = [];
+
+                continue;
             }
+            $lines[] = $line;
+        }
+        $blocks[] = $lines;
+
+        $templateOnly = '/^\s*(?:(?<t>\{\{(?:[^{}]++|(?&t))*\}\})\s*)+$/u';
+        foreach ($blocks as $lines) {
+            while ($lines !== [] && preg_match($templateOnly, $lines[0]) === 1) {
+                array_shift($lines);
+            }
+            if ($lines === [] || preg_match('/^\s*(#|```|~~~|([-*_])\s*\2\s*\2[\s\-*_]*$)/u', $lines[0]) === 1) {
+                continue;
+            }
+
+            return implode("\n", $lines);
         }
 
-        return '';
+        return $source;
     }
 
     /**

+ 16 - 0
api-v13/tests/Feature/TermV3Test.php

@@ -155,6 +155,8 @@ it('shows a term with ETag, and hides terms of private channels', function () {
     expect($res->headers->get('ETag'))->toBe($term['etag']);
     expect($res->json('data.abilities'))->toBe(['update' => false, 'delete' => false]);
     expect($res->json('data.summary_text'))->toBe('正文第一段。');
+    expect($res->json('data.channel'))->toMatchArray(['id' => $channel, 'studio_id' => $owner])
+        ->toHaveKeys(['name', 'type', 'lang', 'status']);
 
     Channel::where('uid', $channel)->update(['status' => Channel::STATUS_PRIVATE]);
     $this->getJson("/api/v3/terms/{$term['id']}")->assertForbidden();
@@ -162,6 +164,20 @@ it('shows a term with ETag, and hides terms of private channels', function () {
     $this->getJson('/api/v3/terms/'.Str::uuid())->assertNotFound();
 });
 
+it('takes the first natural paragraph of the note as summary_text, in both dialects', function (string $contentType) {
+    $owner = makeStudio('owner');
+    $channel = makeChannel($owner);
+    $note = "## 标题\n\n{{toc}}\n\n{{ai}}\n第一段第一行,\n第一段第二行。\n\n```\n围栏\n\n里的空行\n```\n\n第二段。";
+    $term = newTerm($channel, $owner, ['note' => $note, 'content_type' => $contentType]);
+
+    $text = $this->getJson("/api/v3/terms/{$term['id']}")->assertOk()->json('data.summary_text');
+    expect($text)->toContain('第一段第一行')->toContain('第一段第二行')
+        ->not->toContain('AI')->not->toContain('标题')->not->toContain('第二段');
+
+    $listed = $this->getJson("/api/v3/terms?word={$term['word']}")->assertOk()->json('data.0.summary_text');
+    expect($listed)->toBe($text);
+})->with(['markdown', 'markdown-e2']);
+
 it('treats legacy studio-level terms with an empty-string channal like null ones', function () {
     [$team, $users] = makeTeam();
     $created = $this->postJson("/api/v3/studios/{$team}/terms", ['word' => 'legacy', 'meaning' => '老', 'language' => 'zh-Hans'], authHeader($users['owner']))

+ 40 - 0
dashboard-v6/src/api/schema.d.ts

@@ -37927,6 +37927,10 @@ export interface operations {
                             channel?: {
                                 id?: string;
                                 name?: string;
+                                type?: string;
+                                lang?: string;
+                                studio_id?: string;
+                                status?: number;
                             } | null;
                             owner_id?: string;
                             quality?: string | null;
@@ -38043,6 +38047,10 @@ export interface operations {
                             channel?: {
                                 id?: string;
                                 name?: string;
+                                type?: string;
+                                lang?: string;
+                                studio_id?: string;
+                                status?: number;
                             } | null;
                             owner_id?: string;
                             quality?: string | null;
@@ -38104,6 +38112,10 @@ export interface operations {
                             channel?: {
                                 id?: string;
                                 name?: string;
+                                type?: string;
+                                lang?: string;
+                                studio_id?: string;
+                                status?: number;
                             } | null;
                             owner_id?: string;
                             quality?: string | null;
@@ -42072,6 +42084,10 @@ export interface operations {
                             channel?: {
                                 id?: string;
                                 name?: string;
+                                type?: string;
+                                lang?: string;
+                                studio_id?: string;
+                                status?: number;
                             } | null;
                             owner_id?: string;
                             quality?: string | null;
@@ -42191,6 +42207,10 @@ export interface operations {
                             channel?: {
                                 id?: string;
                                 name?: string;
+                                type?: string;
+                                lang?: string;
+                                studio_id?: string;
+                                status?: number;
                             } | null;
                             owner_id?: string;
                             quality?: string | null;
@@ -42252,6 +42272,10 @@ export interface operations {
                             channel?: {
                                 id?: string;
                                 name?: string;
+                                type?: string;
+                                lang?: string;
+                                studio_id?: string;
+                                status?: number;
                             } | null;
                             owner_id?: string;
                             quality?: string | null;
@@ -42414,6 +42438,10 @@ export interface operations {
                             channel?: {
                                 id?: string;
                                 name?: string;
+                                type?: string;
+                                lang?: string;
+                                studio_id?: string;
+                                status?: number;
                             } | null;
                             owner_id?: string;
                             quality?: string | null;
@@ -42498,6 +42526,10 @@ export interface operations {
                             channel?: {
                                 id?: string;
                                 name?: string;
+                                type?: string;
+                                lang?: string;
+                                studio_id?: string;
+                                status?: number;
                             } | null;
                             owner_id?: string;
                             quality?: string | null;
@@ -42583,6 +42615,10 @@ export interface operations {
                             channel?: {
                                 id?: string;
                                 name?: string;
+                                type?: string;
+                                lang?: string;
+                                studio_id?: string;
+                                status?: number;
                             } | null;
                             owner_id?: string;
                             quality?: string | null;
@@ -42696,6 +42732,10 @@ export interface operations {
                             channel?: {
                                 id?: string;
                                 name?: string;
+                                type?: string;
+                                lang?: string;
+                                studio_id?: string;
+                                status?: number;
                             } | null;
                             owner_id?: string;
                             quality?: string | null;

+ 13 - 1
dashboard-v6/src/components/article/TypeTerm.tsx

@@ -1,4 +1,4 @@
-import { Breadcrumb, Button, Space } from "antd";
+import { Breadcrumb, Button, Divider, Space, Typography } from "antd";
 import { useIntl } from "react-intl";
 import { EditOutlined, ShareAltOutlined } from "@ant-design/icons";
 import type { ArticleMode } from "../../api/article";
@@ -13,10 +13,13 @@ import ArticleHeader from "./components/ArticleHeader";
 import ArticleLayout from "./components/ArticleLayout";
 import { useTerm } from "./hooks/useTerm";
 import TermShare from "../term/TermShare";
+import ChannelStatusTag from "../channel/ChannelStatusTag";
 import { QualityCtl } from "../template/Quality";
 import MarkupView from "../markup/MarkupView";
 import type { MarkupNode } from "../markup/types";
 
+const { Text } = Typography;
+
 interface IWidget {
   id?: string;
   mode?: ArticleMode | null;
@@ -114,6 +117,15 @@ const TypeTermWidget = ({
         ]}
         editor={term?.editor}
         coEditor={term?.co_editor}
+        afterEditors={
+          term?.channel ? (
+            <Space size="small">
+              <Divider orientation="vertical" />
+              <Text type="secondary">{term.channel.name}</Text>
+              <ChannelStatusTag status={term.channel.status} />
+            </Space>
+          ) : undefined
+        }
         created_at={term?.created_at}
         updated_at={term?.updated_at}
         loading={loading}

+ 4 - 0
dashboard-v6/src/components/article/components/ArticleLayout.tsx

@@ -32,6 +32,8 @@ export interface IArticleLayout {
   editor?: IEditorBrief | null;
   /** 协作者(v3 的 co_editor):人类授权代写的 AI 模型 */
   coEditor?: IEditorBrief | null;
+  /** 显示在编辑者那一行下面(如术语所属的 channel) */
+  afterEditors?: ReactNode;
   owner?: IStudio;
   loading?: boolean;
   errorCode?: number;
@@ -53,6 +55,7 @@ const ArticleLayout = ({
   editor,
   coEditor,
   updated_at,
+  afterEditors,
   resList,
   loading,
   errorCode,
@@ -97,6 +100,7 @@ const ArticleLayout = ({
               coEditor={coEditor}
               updatedAt={updated_at}
             />
+            {afterEditors}
             <Divider />
           </Flex>
           {html

+ 30 - 0
dashboard-v6/src/components/channel/ChannelStatusTag.tsx

@@ -0,0 +1,30 @@
+import { Tag } from "antd";
+import { useIntl } from "react-intl";
+
+/** channel 的 status → 文案 key 与标签颜色 */
+const STATUS: Record<number, { label: string; color: string }> = {
+  0: { label: "disable", color: "default" },
+  5: { label: "blocked", color: "red" },
+  10: { label: "private", color: "orange" },
+  20: { label: "public_no_list", color: "blue" },
+  30: { label: "public", color: "green" },
+  40: { label: "public.edit", color: "cyan" },
+};
+
+/** channel 公开性标签,按 status 着色;未知的 status 不显示 */
+const ChannelStatusTag = ({ status }: { status?: number | null }) => {
+  const intl = useIntl();
+  const item =
+    status === undefined || status === null ? undefined : STATUS[status];
+  if (!item) {
+    return null;
+  }
+
+  return (
+    <Tag color={item.color}>
+      {intl.formatMessage({ id: `forms.fields.publicity.${item.label}.label` })}
+    </Tag>
+  );
+};
+
+export default ChannelStatusTag;

+ 1 - 1
dashboard-v6/src/components/dict/SearchVocabulary.tsx

@@ -127,7 +127,7 @@ const SearchVocabulary = ({
         value={input}
         style={{ width: "100%" }}
         classNames={{ popup: { root: "certain-category-search-dropdown" } }}
-        popupMatchSelectWidth={400}
+        popupMatchSelectWidth={true}
         options={options}
         onChange={(val: string) => {
           setInput(val);

+ 40 - 23
dashboard-v6/src/components/term/TermCommunity.tsx

@@ -22,7 +22,7 @@ interface IItem<R> {
 }
 interface IWord {
   meaning: IItem<string>[];
-  note: IItem<string>[];
+  summary: IItem<string>[];
   editor: IItem<IUser>[];
 }
 
@@ -33,7 +33,7 @@ const TermCommunityWidget = ({ word }: IWidget) => {
   const intl = useIntl();
   const [show, setShow] = useState(false);
   const [wordData, setWordData] = useState<IWord>();
-  const minScore = 100; //分数阈值。低于这个分数只显示在弹出菜单中
+  const [summaryExpanded, setSummaryExpanded] = useState(false);
 
   useEffect(() => {
     if (typeof word === "undefined") {
@@ -43,7 +43,7 @@ const TermCommunityWidget = ({ word }: IWidget) => {
     lookupTerms({ word, per_page: 200 })
       .then((json) => {
         const meaning = new Map<string, number>();
-        const note = new Map<string, number>();
+        const summary = new Map<string, number>();
         const editorId = new Map<string, number>();
         const editor = new Map<string, IUser>();
         for (const it of json.data ?? []) {
@@ -54,10 +54,14 @@ const TermCommunityWidget = ({ word }: IWidget) => {
             meaning.set(it.meaning, score ? score + currScore : currScore);
           }
 
-          if (it.note) {
-            score = note.get(it.note);
-            const noteScore = it.note.length;
-            note.set(it.note, score ? score + noteScore : noteScore);
+          // summary_text:有 summary 用它,没有取正文第一段(后端算好的纯文本)
+          if (it.summary_text) {
+            score = summary.get(it.summary_text);
+            const summaryScore = it.summary_text.length;
+            summary.set(
+              it.summary_text,
+              score ? score + summaryScore : summaryScore,
+            );
           }
 
           if (it.editor?.id) {
@@ -68,7 +72,7 @@ const TermCommunityWidget = ({ word }: IWidget) => {
         }
         const _data: IWord = {
           meaning: [],
-          note: [],
+          summary: [],
           editor: [],
         };
         meaning.forEach((value, key) => {
@@ -77,12 +81,12 @@ const TermCommunityWidget = ({ word }: IWidget) => {
           }
         });
         _data.meaning.sort((a, b) => b.score - a.score);
-        note.forEach((value, key) => {
+        summary.forEach((value, key) => {
           if (key && key.length > 0) {
-            _data.note.push({ value: key, score: value });
+            _data.summary.push({ value: key, score: value });
           }
         });
-        _data.note.sort((a, b) => b.score - a.score);
+        _data.summary.sort((a, b) => b.score - a.score);
 
         editorId.forEach((value, key) => {
           const currEditor = editor.get(key);
@@ -92,6 +96,7 @@ const TermCommunityWidget = ({ word }: IWidget) => {
         });
         _data.editor.sort((a, b) => b.score - a.score);
         setWordData(_data);
+        setSummaryExpanded(false);
         if (_data.editor.length > 0) {
           setShow(true);
         }
@@ -194,20 +199,32 @@ const TermCommunityWidget = ({ word }: IWidget) => {
           ) : undefined}
         </Space>
       </div>
-      <div key="note">
+      <div key="summary">
         <Space style={{ flexWrap: "wrap" }}>
-          <Text strong>{"note:"}</Text>
-          {wordData?.note
-            .filter((value) => value.score >= minScore)
-            .map((item, id) => {
-              return (
-                <Space key={id}>
-                  {item.value}
-                  <Badge color="geekblue" size="small" count={item.score} />
-                </Space>
-              );
-            })}
+          <Text strong>{"摘要:"}</Text>
         </Space>
+        {/* 只显示第一条摘要,其余点「展开」才显示 */}
+        {(summaryExpanded
+          ? wordData?.summary
+          : wordData?.summary.slice(0, 1)
+        )?.map((item, id) => {
+          return (
+            <div key={id}>
+              {item.value}
+              <Badge color="geekblue" size="small" count={item.score} />
+            </div>
+          );
+        })}
+        {wordData && wordData.summary.length > 1 ? (
+          <Typography.Link onClick={() => setSummaryExpanded((v) => !v)}>
+            {summaryExpanded
+              ? intl.formatMessage({ id: "search.show_less" })
+              : intl.formatMessage(
+                  { id: "search.show_more" },
+                  { n: wordData.summary.length - 1 },
+                )}
+          </Typography.Link>
+        ) : undefined}
       </div>
       <div key="collaborator">
         <Space style={{ flexWrap: "wrap" }}>

+ 9 - 1
openapi/public/assets/protocol/resources/auto/v3-channels-channel-terms.yaml

@@ -111,7 +111,7 @@ get:
                       nullable: true
                     channel:
                       type: object
-                      properties: { id: { type: string }, name: { type: string } }
+                      properties: { id: { type: string }, name: { type: string }, type: { type: string }, lang: { type: string }, studio_id: { type: string }, status: { type: integer } }
                       nullable: true
                     owner_id:
                       type: string
@@ -277,6 +277,10 @@ post:
                     properties:
                       id: { type: string }
                       name: { type: string }
+                      type: { type: string }
+                      lang: { type: string }
+                      studio_id: { type: string }
+                      status: { type: integer }
                     nullable: true
                   owner_id:
                     type: string
@@ -376,6 +380,10 @@ post:
                     properties:
                       id: { type: string }
                       name: { type: string }
+                      type: { type: string }
+                      lang: { type: string }
+                      studio_id: { type: string }
+                      status: { type: integer }
                     nullable: true
                   owner_id:
                     type: string

+ 9 - 1
openapi/public/assets/protocol/resources/auto/v3-studios-studio-terms.yaml

@@ -115,7 +115,7 @@ get:
                       nullable: true
                     channel:
                       type: object
-                      properties: { id: { type: string }, name: { type: string } }
+                      properties: { id: { type: string }, name: { type: string }, type: { type: string }, lang: { type: string }, studio_id: { type: string }, status: { type: integer } }
                       nullable: true
                     owner_id:
                       type: string
@@ -287,6 +287,10 @@ post:
                     properties:
                       id: { type: string }
                       name: { type: string }
+                      type: { type: string }
+                      lang: { type: string }
+                      studio_id: { type: string }
+                      status: { type: integer }
                     nullable: true
                   owner_id:
                     type: string
@@ -386,6 +390,10 @@ post:
                     properties:
                       id: { type: string }
                       name: { type: string }
+                      type: { type: string }
+                      lang: { type: string }
+                      studio_id: { type: string }
+                      status: { type: integer }
                     nullable: true
                   owner_id:
                     type: string

+ 12 - 0
openapi/public/assets/protocol/resources/auto/v3-terms-term.yaml

@@ -80,6 +80,10 @@ get:
                     properties:
                       id: { type: string }
                       name: { type: string }
+                      type: { type: string }
+                      lang: { type: string }
+                      studio_id: { type: string }
+                      status: { type: integer }
                     nullable: true
                   owner_id:
                     type: string
@@ -254,6 +258,10 @@ patch:
                     properties:
                       id: { type: string }
                       name: { type: string }
+                      type: { type: string }
+                      lang: { type: string }
+                      studio_id: { type: string }
+                      status: { type: integer }
                     nullable: true
                   owner_id:
                     type: string
@@ -396,6 +404,10 @@ delete:
                     properties:
                       id: { type: string }
                       name: { type: string }
+                      type: { type: string }
+                      lang: { type: string }
+                      studio_id: { type: string }
+                      status: { type: integer }
                     nullable: true
                   owner_id:
                     type: string

+ 1 - 1
openapi/public/assets/protocol/resources/auto/v3-terms.yaml

@@ -89,7 +89,7 @@ get:
                       nullable: true
                     channel:
                       type: object
-                      properties: { id: { type: string }, name: { type: string } }
+                      properties: { id: { type: string }, name: { type: string }, type: { type: string }, lang: { type: string }, studio_id: { type: string }, status: { type: integer } }
                       nullable: true
                     owner_id:
                       type: string