Skip to content

Commit 2116452

Browse files
committed
docs: update validations and docs regarding last changes of namespaces field
1 parent bdd3aca commit 2116452

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

src/docs/module.doc.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,13 @@ paths:
241241
description: Metadata for the hivemind module on Notion.
242242
- type: object
243243
properties:
244-
pageIds:
244+
namespaces:
245245
type: array
246246
items:
247-
type: string
247+
type: number
248+
default: [0]
249+
activated:
250+
type: boolean
248251
description: Metadata for the hivemind module on MediaWiki.
249252
- type: object
250253
description: Metadata for the hivemind module on website.

src/docs/platform.doc.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,17 @@ paths:
165165
type: string
166166
description: Metadata for Notion.
167167
- type: object
168-
required: [baseURL, path, namespaces]
168+
required: [baseURL, path]
169169
properties:
170170
baseURL:
171171
type: string
172172
path:
173173
type: string
174174
namespaces:
175-
type: array
175+
type: array
176176
items:
177177
type: number
178+
default: [0]
178179
description: Metadata for MediaWiki.
179180
- type: object
180181
required: [id, period, analyzerStartedAt, resources]

src/validations/module.validation.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import Joi from 'joi';
22

33
import {
4-
HivemindPlatformNames,
5-
ModuleNames,
6-
PlatformNames,
7-
ViolationDetectionPlatformNames,
4+
HivemindPlatformNames, ModuleNames, PlatformNames, ViolationDetectionPlatformNames
85
} from '@togethercrew.dev/db';
96

107
import { objectId } from './custom.validation';
@@ -79,6 +76,7 @@ const hivemindNotionMetadata = () => {
7976

8077
const hivemindMediaWikiMetadata = () => {
8178
return Joi.object().keys({
79+
namespaces: Joi.array().items(Joi.number()).default([0]),
8280
activated: Joi.boolean(),
8381
});
8482
};

src/validations/platform.validation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const mediaWikiUpdateMetadata = () => {
3939
return Joi.object().keys({
4040
baseURL: Joi.string().required(),
4141
path: Joi.string().required(),
42-
namespaces: Joi.array().items(Joi.number()).required(),
42+
namespaces: Joi.array().items(Joi.number()).default([0]),
4343
});
4444
};
4545

@@ -94,7 +94,7 @@ const mediaWikiMetadata = () => {
9494
return Joi.object().keys({
9595
baseURL: Joi.string().required(),
9696
path: Joi.string().required(),
97-
namespaces: Joi.array().items(Joi.number()).required(),
97+
namespaces: Joi.array().items(Joi.number()).default([0]),
9898
});
9999
};
100100

0 commit comments

Comments
 (0)