Barazo lexicon schemas and TypeScript types barazo.forum
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: rename ATgora to Barazo

Rename brand from ATgora to Barazo across all code, schemas, and docs.
Key changes:
- Lexicon namespace: forum.atgora.* -> forum.barazo.*
- npm scope: @atgora-forum -> @barazo-forum
- All schema IDs, cross-references, and generated types updated
- Validation, tests, README, and CI config updated

Part of org-wide rename. See brand/naming-decision-barazo.md for rationale.

+147 -147
+1 -1
.github/SECURITY.md
··· 18 18 3. Click "Report a vulnerability" 19 19 4. Fill in the details 20 20 21 - Or email: security@atgora.forum (TBD - will be set up in Phase 2) 21 + Or email: security@barazo.forum (TBD - will be set up in Phase 2) 22 22 23 23 We will respond within 72 hours with next steps. 24 24
+2 -2
.github/workflows/cla.yml
··· 23 23 PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_BOT_TOKEN }} 24 24 with: 25 25 path-to-signatures: 'signatures/cla.json' 26 - path-to-document: 'https://github.com/atgora-forum/.github/blob/main/CLA.md' 26 + path-to-document: 'https://github.com/barazo-forum/.github/blob/main/CLA.md' 27 27 branch: 'main' 28 28 allowlist: 'gxjansen,dependabot[bot],github-actions[bot]' 29 - remote-organization-name: 'atgora-forum' 29 + remote-organization-name: 'barazo-forum' 30 30 remote-repository-name: '.github' 31 31 lock-pullrequest-aftermerge: false 32 32 use-dco-flag: false
+1 -1
.npmrc
··· 1 - @atgora-forum:registry=https://npm.pkg.github.com 1 + @barazo-forum:registry=https://npm.pkg.github.com
+1 -1
LICENSE
··· 1 1 MIT License 2 2 3 - Copyright (c) 2026 atgora-forum 3 + Copyright (c) 2026 barazo-forum 4 4 5 5 Permission is hereby granted, free of charge, to any person obtaining a copy 6 6 of this software and associated documentation files (the "Software"), to deal
+19 -19
README.md
··· 1 - # @atgora-forum/lexicons 1 + # @barazo-forum/lexicons 2 2 3 - AT Protocol lexicon schemas and generated TypeScript types for the ATgora forum platform. Defines the `forum.atgora.*` namespace with record types for topics, replies, reactions, and user preferences. 3 + AT Protocol lexicon schemas and generated TypeScript types for the Barazo forum platform. Defines the `forum.barazo.*` namespace with record types for topics, replies, reactions, and user preferences. 4 4 5 5 ## Installation 6 6 7 7 For npm consumers outside the workspace, configure GitHub Packages access in `.npmrc`: 8 8 9 9 ``` 10 - @atgora-forum:registry=https://npm.pkg.github.com 10 + @barazo-forum:registry=https://npm.pkg.github.com 11 11 ``` 12 12 13 13 Then install: 14 14 15 15 ```bash 16 - pnpm add @atgora-forum/lexicons 16 + pnpm add @barazo-forum/lexicons 17 17 ``` 18 18 19 - For workspace consumers (`atgora-api`, `atgora-web`): already linked via pnpm workspace. 19 + For workspace consumers (`barazo-api`, `barazo-web`): already linked via pnpm workspace. 20 20 21 21 ## Usage 22 22 23 23 ### Generated Types 24 24 25 25 ```typescript 26 - import { ForumAtgoraTopicPost } from "@atgora-forum/lexicons"; 26 + import { ForumBarazoTopicPost } from "@barazo-forum/lexicons"; 27 27 28 28 // Type for a topic post record 29 - type Post = ForumAtgoraTopicPost.Record; 29 + type Post = ForumBarazoTopicPost.Record; 30 30 31 31 // Type guard 32 - if (ForumAtgoraTopicPost.isRecord(record)) { 32 + if (ForumBarazoTopicPost.isRecord(record)) { 33 33 console.log(record.title); 34 34 } 35 35 36 36 // Validate against lexicon schema 37 - const result = ForumAtgoraTopicPost.validateRecord(record); 37 + const result = ForumBarazoTopicPost.validateRecord(record); 38 38 ``` 39 39 40 40 ### Zod Validation 41 41 42 42 ```typescript 43 - import { topicPostSchema } from "@atgora-forum/lexicons"; 43 + import { topicPostSchema } from "@barazo-forum/lexicons"; 44 44 45 45 const result = topicPostSchema.safeParse(input); 46 46 if (result.success) { ··· 51 51 ### Lexicon IDs 52 52 53 53 ```typescript 54 - import { LEXICON_IDS, ids } from "@atgora-forum/lexicons"; 54 + import { LEXICON_IDS, ids } from "@barazo-forum/lexicons"; 55 55 56 - LEXICON_IDS.TopicPost // "forum.atgora.topic.post" 57 - ids.ForumAtgoraTopicPost // "forum.atgora.topic.post" 56 + LEXICON_IDS.TopicPost // "forum.barazo.topic.post" 57 + ids.ForumBarazoTopicPost // "forum.barazo.topic.post" 58 58 ``` 59 59 60 60 ### Raw Lexicon Schemas 61 61 62 62 ```typescript 63 - import { schemas } from "@atgora-forum/lexicons"; 64 - // Array of LexiconDoc objects for all forum.atgora.* schemas 63 + import { schemas } from "@barazo-forum/lexicons"; 64 + // Array of LexiconDoc objects for all forum.barazo.* schemas 65 65 ``` 66 66 67 67 ## Record Types 68 68 69 69 | Lexicon ID | Description | Key Type | 70 70 |------------|-------------|----------| 71 - | `forum.atgora.topic.post` | Forum topic/thread (title, content, community, category, tags, labels) | `tid` | 72 - | `forum.atgora.topic.reply` | Reply to a topic (content, root ref, parent ref, community) | `tid` | 73 - | `forum.atgora.interaction.reaction` | Reaction to content (subject ref, type, community) | `tid` | 74 - | `forum.atgora.actor.preferences` | User preferences singleton (maturity level, muted words, blocked DIDs, cross-post defaults) | `literal:self` | 71 + | `forum.barazo.topic.post` | Forum topic/thread (title, content, community, category, tags, labels) | `tid` | 72 + | `forum.barazo.topic.reply` | Reply to a topic (content, root ref, parent ref, community) | `tid` | 73 + | `forum.barazo.interaction.reaction` | Reaction to content (subject ref, type, community) | `tid` | 74 + | `forum.barazo.actor.preferences` | User preferences singleton (maturity level, muted words, blocked DIDs, cross-post defaults) | `literal:self` | 75 75 76 76 ## Development 77 77
+1 -1
lexicons/forum/atgora/actor/preferences.json lexicons/forum/barazo/actor/preferences.json
··· 1 1 { 2 2 "lexicon": 1, 3 - "id": "forum.atgora.actor.preferences", 3 + "id": "forum.barazo.actor.preferences", 4 4 "defs": { 5 5 "main": { 6 6 "type": "record",
-6
lexicons/forum/atgora/defs.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "forum.atgora.defs", 4 - "description": "Shared type definitions for ATgora forum lexicons. Reserved for future reusable types.", 5 - "defs": {} 6 - }
+1 -1
lexicons/forum/atgora/interaction/reaction.json lexicons/forum/barazo/interaction/reaction.json
··· 1 1 { 2 2 "lexicon": 1, 3 - "id": "forum.atgora.interaction.reaction", 3 + "id": "forum.barazo.interaction.reaction", 4 4 "defs": { 5 5 "main": { 6 6 "type": "record",
+1 -1
lexicons/forum/atgora/topic/post.json lexicons/forum/barazo/topic/post.json
··· 1 1 { 2 2 "lexicon": 1, 3 - "id": "forum.atgora.topic.post", 3 + "id": "forum.barazo.topic.post", 4 4 "defs": { 5 5 "main": { 6 6 "type": "record",
+2 -2
lexicons/forum/atgora/topic/reply.json lexicons/forum/barazo/topic/reply.json
··· 1 1 { 2 2 "lexicon": 1, 3 - "id": "forum.atgora.topic.reply", 3 + "id": "forum.barazo.topic.reply", 4 4 "defs": { 5 5 "main": { 6 6 "type": "record", ··· 24 24 "root": { 25 25 "type": "ref", 26 26 "ref": "com.atproto.repo.strongRef", 27 - "description": "The original topic (AT URI of forum.atgora.topic.post)." 27 + "description": "The original topic (AT URI of forum.barazo.topic.post)." 28 28 }, 29 29 "parent": { 30 30 "type": "ref",
+6
lexicons/forum/barazo/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "forum.barazo.defs", 4 + "description": "Shared type definitions for Barazo forum lexicons. Reserved for future reusable types.", 5 + "defs": {} 6 + }
+3 -3
package.json
··· 1 1 { 2 - "name": "@atgora-forum/lexicons", 2 + "name": "@barazo-forum/lexicons", 3 3 "version": "0.1.0", 4 - "description": "AT Protocol lexicon schemas and generated TypeScript types for the ATgora forum platform", 4 + "description": "AT Protocol lexicon schemas and generated TypeScript types for the Barazo forum platform", 5 5 "type": "module", 6 6 "packageManager": "pnpm@10.29.2", 7 7 "license": "MIT", ··· 11 11 }, 12 12 "repository": { 13 13 "type": "git", 14 - "url": "https://github.com/atgora-forum/atgora-lexicons.git" 14 + "url": "https://github.com/barazo-forum/barazo-lexicons.git" 15 15 }, 16 16 "exports": { 17 17 ".": {
+5 -5
scripts/fixup-generated.js
··· 20 20 */ 21 21 export * as ComAtprotoLabelDefs from "./types/com/atproto/label/defs.js"; 22 22 export * as ComAtprotoRepoStrongRef from "./types/com/atproto/repo/strongRef.js"; 23 - export * as ForumAtgoraActorPreferences from "./types/forum/atgora/actor/preferences.js"; 24 - export * as ForumAtgoraDefs from "./types/forum/atgora/defs.js"; 25 - export * as ForumAtgoraInteractionReaction from "./types/forum/atgora/interaction/reaction.js"; 26 - export * as ForumAtgoraTopicPost from "./types/forum/atgora/topic/post.js"; 27 - export * as ForumAtgoraTopicReply from "./types/forum/atgora/topic/reply.js"; 23 + export * as ForumBarazoActorPreferences from "./types/forum/barazo/actor/preferences.js"; 24 + export * as ForumBarazoDefs from "./types/forum/barazo/defs.js"; 25 + export * as ForumBarazoInteractionReaction from "./types/forum/barazo/interaction/reaction.js"; 26 + export * as ForumBarazoTopicPost from "./types/forum/barazo/topic/post.js"; 27 + export * as ForumBarazoTopicReply from "./types/forum/barazo/topic/reply.js"; 28 28 export { schemas, validate } from "./lexicons.js"; 29 29 `; 30 30
+5 -5
src/generated/index.ts
··· 5 5 */ 6 6 export * as ComAtprotoLabelDefs from "./types/com/atproto/label/defs.js"; 7 7 export * as ComAtprotoRepoStrongRef from "./types/com/atproto/repo/strongRef.js"; 8 - export * as ForumAtgoraActorPreferences from "./types/forum/atgora/actor/preferences.js"; 9 - export * as ForumAtgoraDefs from "./types/forum/atgora/defs.js"; 10 - export * as ForumAtgoraInteractionReaction from "./types/forum/atgora/interaction/reaction.js"; 11 - export * as ForumAtgoraTopicPost from "./types/forum/atgora/topic/post.js"; 12 - export * as ForumAtgoraTopicReply from "./types/forum/atgora/topic/reply.js"; 8 + export * as ForumBarazoActorPreferences from "./types/forum/barazo/actor/preferences.js"; 9 + export * as ForumBarazoDefs from "./types/forum/barazo/defs.js"; 10 + export * as ForumBarazoInteractionReaction from "./types/forum/barazo/interaction/reaction.js"; 11 + export * as ForumBarazoTopicPost from "./types/forum/barazo/topic/post.js"; 12 + export * as ForumBarazoTopicReply from "./types/forum/barazo/topic/reply.js"; 13 13 export { schemas, validate } from "./lexicons.js";
+18 -18
src/generated/lexicons.ts
··· 210 210 }, 211 211 }, 212 212 }, 213 - ForumAtgoraActorPreferences: { 213 + ForumBarazoActorPreferences: { 214 214 lexicon: 1, 215 - id: 'forum.atgora.actor.preferences', 215 + id: 'forum.barazo.actor.preferences', 216 216 defs: { 217 217 main: { 218 218 type: 'record', ··· 259 259 }, 260 260 crossPostDefaults: { 261 261 type: 'ref', 262 - ref: 'lex:forum.atgora.actor.preferences#crossPostConfig', 262 + ref: 'lex:forum.barazo.actor.preferences#crossPostConfig', 263 263 description: 'Per-service toggle for cross-posting new topics.', 264 264 }, 265 265 updatedAt: { ··· 286 286 }, 287 287 }, 288 288 }, 289 - ForumAtgoraDefs: { 289 + ForumBarazoDefs: { 290 290 lexicon: 1, 291 - id: 'forum.atgora.defs', 291 + id: 'forum.barazo.defs', 292 292 description: 293 - 'Shared type definitions for ATgora forum lexicons. Reserved for future reusable types.', 293 + 'Shared type definitions for Barazo forum lexicons. Reserved for future reusable types.', 294 294 defs: {}, 295 295 }, 296 - ForumAtgoraInteractionReaction: { 296 + ForumBarazoInteractionReaction: { 297 297 lexicon: 1, 298 - id: 'forum.atgora.interaction.reaction', 298 + id: 'forum.barazo.interaction.reaction', 299 299 defs: { 300 300 main: { 301 301 type: 'record', ··· 335 335 }, 336 336 }, 337 337 }, 338 - ForumAtgoraTopicPost: { 338 + ForumBarazoTopicPost: { 339 339 lexicon: 1, 340 - id: 'forum.atgora.topic.post', 340 + id: 'forum.barazo.topic.post', 341 341 defs: { 342 342 main: { 343 343 type: 'record', ··· 405 405 }, 406 406 }, 407 407 }, 408 - ForumAtgoraTopicReply: { 408 + ForumBarazoTopicReply: { 409 409 lexicon: 1, 410 - id: 'forum.atgora.topic.reply', 410 + id: 'forum.barazo.topic.reply', 411 411 defs: { 412 412 main: { 413 413 type: 'record', ··· 433 433 type: 'ref', 434 434 ref: 'lex:com.atproto.repo.strongRef', 435 435 description: 436 - 'The original topic (AT URI of forum.atgora.topic.post).', 436 + 'The original topic (AT URI of forum.barazo.topic.post).', 437 437 }, 438 438 parent: { 439 439 type: 'ref', ··· 498 498 export const ids = { 499 499 ComAtprotoLabelDefs: 'com.atproto.label.defs', 500 500 ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef', 501 - ForumAtgoraActorPreferences: 'forum.atgora.actor.preferences', 502 - ForumAtgoraDefs: 'forum.atgora.defs', 503 - ForumAtgoraInteractionReaction: 'forum.atgora.interaction.reaction', 504 - ForumAtgoraTopicPost: 'forum.atgora.topic.post', 505 - ForumAtgoraTopicReply: 'forum.atgora.topic.reply', 501 + ForumBarazoActorPreferences: 'forum.barazo.actor.preferences', 502 + ForumBarazoDefs: 'forum.barazo.defs', 503 + ForumBarazoInteractionReaction: 'forum.barazo.interaction.reaction', 504 + ForumBarazoTopicPost: 'forum.barazo.topic.post', 505 + ForumBarazoTopicReply: 'forum.barazo.topic.reply', 506 506 } as const
+3 -3
src/generated/types/forum/atgora/actor/preferences.ts src/generated/types/forum/barazo/actor/preferences.ts
··· 12 12 13 13 const is$typed = _is$typed, 14 14 validate = _validate 15 - const id = 'forum.atgora.actor.preferences' 15 + const id = 'forum.barazo.actor.preferences' 16 16 17 17 export interface Main { 18 - $type: 'forum.atgora.actor.preferences' 18 + $type: 'forum.barazo.actor.preferences' 19 19 /** Maximum maturity tier to show. Default: 'safe'. */ 20 20 maturityLevel: 'safe' | 'mature' | 'all' 21 21 /** Global muted words (apply to all communities). */ ··· 47 47 } 48 48 49 49 export interface CrossPostConfig { 50 - $type?: 'forum.atgora.actor.preferences#crossPostConfig' 50 + $type?: 'forum.barazo.actor.preferences#crossPostConfig' 51 51 /** Cross-post new topics to Bluesky. Default: false. */ 52 52 bluesky?: boolean 53 53 /** Cross-post new topics to Frontpage. Default: false. */
+1 -1
src/generated/types/forum/atgora/defs.ts src/generated/types/forum/barazo/defs.ts
··· 8 8 9 9 const is$typed = _is$typed, 10 10 validate = _validate 11 - const id = 'forum.atgora.defs' 11 + const id = 'forum.barazo.defs'
+2 -2
src/generated/types/forum/atgora/interaction/reaction.ts src/generated/types/forum/barazo/interaction/reaction.ts
··· 13 13 14 14 const is$typed = _is$typed, 15 15 validate = _validate 16 - const id = 'forum.atgora.interaction.reaction' 16 + const id = 'forum.barazo.interaction.reaction' 17 17 18 18 export interface Main { 19 - $type: 'forum.atgora.interaction.reaction' 19 + $type: 'forum.barazo.interaction.reaction' 20 20 subject: ComAtprotoRepoStrongRef.Main 21 21 /** Reaction type (e.g., 'like', 'heart', 'thumbsup'). Must match community's configured reaction set. */ 22 22 type: string
+2 -2
src/generated/types/forum/atgora/topic/post.ts src/generated/types/forum/barazo/topic/post.ts
··· 13 13 14 14 const is$typed = _is$typed, 15 15 validate = _validate 16 - const id = 'forum.atgora.topic.post' 16 + const id = 'forum.barazo.topic.post' 17 17 18 18 export interface Main { 19 - $type: 'forum.atgora.topic.post' 19 + $type: 'forum.barazo.topic.post' 20 20 /** Topic title. */ 21 21 title: string 22 22 /** Topic body in markdown. */
+2 -2
src/generated/types/forum/atgora/topic/reply.ts src/generated/types/forum/barazo/topic/reply.ts
··· 14 14 15 15 const is$typed = _is$typed, 16 16 validate = _validate 17 - const id = 'forum.atgora.topic.reply' 17 + const id = 'forum.barazo.topic.reply' 18 18 19 19 export interface Main { 20 - $type: 'forum.atgora.topic.reply' 20 + $type: 'forum.barazo.topic.reply' 21 21 /** Reply body in markdown. */ 22 22 content: string 23 23 /** Content format. Defaults to 'markdown' if omitted. */
+11 -11
src/index.ts
··· 1 1 /** 2 - * @atgora-forum/lexicons 2 + * @barazo-forum/lexicons 3 3 * 4 4 * AT Protocol lexicon schemas and generated TypeScript types 5 - * for the ATgora forum platform. 5 + * for the Barazo forum platform. 6 6 * 7 - * Namespace: forum.atgora.* 7 + * Namespace: forum.barazo.* 8 8 */ 9 9 10 10 // Generated types (from lex-cli) 11 11 export { 12 - ForumAtgoraTopicPost, 13 - ForumAtgoraTopicReply, 14 - ForumAtgoraInteractionReaction, 15 - ForumAtgoraActorPreferences, 12 + ForumBarazoTopicPost, 13 + ForumBarazoTopicReply, 14 + ForumBarazoInteractionReaction, 15 + ForumBarazoActorPreferences, 16 16 ComAtprotoRepoStrongRef, 17 17 ComAtprotoLabelDefs, 18 18 } from "./generated/index.js"; ··· 39 39 40 40 // Lexicon ID constants 41 41 export const LEXICON_IDS = { 42 - TopicPost: "forum.atgora.topic.post", 43 - TopicReply: "forum.atgora.topic.reply", 44 - Reaction: "forum.atgora.interaction.reaction", 45 - ActorPreferences: "forum.atgora.actor.preferences", 42 + TopicPost: "forum.barazo.topic.post", 43 + TopicReply: "forum.barazo.topic.reply", 44 + Reaction: "forum.barazo.interaction.reaction", 45 + ActorPreferences: "forum.barazo.actor.preferences", 46 46 } as const;
+1 -1
src/validation/actor-preferences.ts
··· 9 9 }); 10 10 11 11 /** 12 - * Zod schema for forum.atgora.actor.preferences records. 12 + * Zod schema for forum.barazo.actor.preferences records. 13 13 * 14 14 * Mirrors the lexicon constraints from prd-lexicons.md section 3.4. 15 15 * Singleton record (key: literal:self).
+1 -1
src/validation/reaction.ts
··· 4 4 const didRegex = /^did:[a-z]+:[a-zA-Z0-9._:%-]+$/; 5 5 6 6 /** 7 - * Zod schema for forum.atgora.interaction.reaction records. 7 + * Zod schema for forum.barazo.interaction.reaction records. 8 8 * 9 9 * Mirrors the lexicon constraints from prd-lexicons.md section 3.3. 10 10 */
+1 -1
src/validation/topic-post.ts
··· 5 5 const didRegex = /^did:[a-z]+:[a-zA-Z0-9._:%-]+$/; 6 6 7 7 /** 8 - * Zod schema for forum.atgora.topic.post records. 8 + * Zod schema for forum.barazo.topic.post records. 9 9 * 10 10 * Mirrors the lexicon constraints from prd-lexicons.md section 3.1. 11 11 * Note: maxLength in lexicon = UTF-8 bytes, but Zod .max() counts
+1 -1
src/validation/topic-reply.ts
··· 5 5 const didRegex = /^did:[a-z]+:[a-zA-Z0-9._:%-]+$/; 6 6 7 7 /** 8 - * Zod schema for forum.atgora.topic.reply records. 8 + * Zod schema for forum.barazo.topic.reply records. 9 9 * 10 10 * Mirrors the lexicon constraints from prd-lexicons.md section 3.2. 11 11 */
+10 -10
tests/lexicon-schemas.test.ts
··· 2 2 import { readFile, readdir } from "node:fs/promises"; 3 3 import { join, resolve } from "node:path"; 4 4 5 - const LEXICONS_DIR = resolve(import.meta.dirname, "../lexicons/forum/atgora"); 5 + const LEXICONS_DIR = resolve(import.meta.dirname, "../lexicons/forum/barazo"); 6 6 7 7 async function loadJson(path: string): Promise<unknown> { 8 8 const content = await readFile(path, "utf-8"); ··· 41 41 for (const file of files) { 42 42 const lexicon = (await loadJson(file)) as Record<string, unknown>; 43 43 const id = lexicon["id"] as string; 44 - // Convert "forum.atgora.topic.post" to a path fragment "forum/atgora/topic/post.json" 44 + // Convert "forum.barazo.topic.post" to a path fragment "forum/barazo/topic/post.json" 45 45 const expectedPath = id.replace(/\./g, "/") + ".json"; 46 46 expect(file).toContain(expectedPath); 47 47 } 48 48 }); 49 49 }); 50 50 51 - describe("forum.atgora.topic.post lexicon", () => { 51 + describe("forum.barazo.topic.post lexicon", () => { 52 52 let schema: Record<string, unknown>; 53 53 54 54 it("loads successfully", async () => { 55 55 schema = (await loadJson( 56 56 join(LEXICONS_DIR, "topic/post.json"), 57 57 )) as Record<string, unknown>; 58 - expect(schema["id"]).toBe("forum.atgora.topic.post"); 58 + expect(schema["id"]).toBe("forum.barazo.topic.post"); 59 59 }); 60 60 61 61 it("defines a record with key type tid", () => { ··· 120 120 }); 121 121 }); 122 122 123 - describe("forum.atgora.topic.reply lexicon", () => { 123 + describe("forum.barazo.topic.reply lexicon", () => { 124 124 let schema: Record<string, unknown>; 125 125 126 126 it("loads successfully", async () => { 127 127 schema = (await loadJson( 128 128 join(LEXICONS_DIR, "topic/reply.json"), 129 129 )) as Record<string, unknown>; 130 - expect(schema["id"]).toBe("forum.atgora.topic.reply"); 130 + expect(schema["id"]).toBe("forum.barazo.topic.reply"); 131 131 }); 132 132 133 133 it("has required fields: content, root, parent, community, createdAt", () => { ··· 160 160 }); 161 161 }); 162 162 163 - describe("forum.atgora.interaction.reaction lexicon", () => { 163 + describe("forum.barazo.interaction.reaction lexicon", () => { 164 164 let schema: Record<string, unknown>; 165 165 166 166 it("loads successfully", async () => { 167 167 schema = (await loadJson( 168 168 join(LEXICONS_DIR, "interaction/reaction.json"), 169 169 )) as Record<string, unknown>; 170 - expect(schema["id"]).toBe("forum.atgora.interaction.reaction"); 170 + expect(schema["id"]).toBe("forum.barazo.interaction.reaction"); 171 171 }); 172 172 173 173 it("has required fields: subject, type, community, createdAt", () => { ··· 191 191 }); 192 192 }); 193 193 194 - describe("forum.atgora.actor.preferences lexicon", () => { 194 + describe("forum.barazo.actor.preferences lexicon", () => { 195 195 let schema: Record<string, unknown>; 196 196 197 197 it("loads successfully", async () => { 198 198 schema = (await loadJson( 199 199 join(LEXICONS_DIR, "actor/preferences.json"), 200 200 )) as Record<string, unknown>; 201 - expect(schema["id"]).toBe("forum.atgora.actor.preferences"); 201 + expect(schema["id"]).toBe("forum.barazo.actor.preferences"); 202 202 }); 203 203 204 204 it("uses literal:self key (singleton record)", () => {
+45 -45
tests/type-generation.test.ts
··· 1 1 import { describe, it, expect } from "vitest"; 2 2 import { 3 - ForumAtgoraTopicPost, 4 - ForumAtgoraTopicReply, 5 - ForumAtgoraInteractionReaction, 6 - ForumAtgoraActorPreferences, 3 + ForumBarazoTopicPost, 4 + ForumBarazoTopicReply, 5 + ForumBarazoInteractionReaction, 6 + ForumBarazoActorPreferences, 7 7 LEXICON_IDS, 8 8 schemas, 9 9 ids, 10 10 } from "../src/index.js"; 11 11 12 12 describe("generated type exports", () => { 13 - it("exports ForumAtgoraTopicPost with Record type and validators", () => { 14 - expect(ForumAtgoraTopicPost.isRecord).toBeTypeOf("function"); 15 - expect(ForumAtgoraTopicPost.validateRecord).toBeTypeOf("function"); 13 + it("exports ForumBarazoTopicPost with Record type and validators", () => { 14 + expect(ForumBarazoTopicPost.isRecord).toBeTypeOf("function"); 15 + expect(ForumBarazoTopicPost.validateRecord).toBeTypeOf("function"); 16 16 }); 17 17 18 - it("exports ForumAtgoraTopicReply with Record type and validators", () => { 19 - expect(ForumAtgoraTopicReply.isRecord).toBeTypeOf("function"); 20 - expect(ForumAtgoraTopicReply.validateRecord).toBeTypeOf("function"); 18 + it("exports ForumBarazoTopicReply with Record type and validators", () => { 19 + expect(ForumBarazoTopicReply.isRecord).toBeTypeOf("function"); 20 + expect(ForumBarazoTopicReply.validateRecord).toBeTypeOf("function"); 21 21 }); 22 22 23 - it("exports ForumAtgoraInteractionReaction with Record type and validators", () => { 24 - expect(ForumAtgoraInteractionReaction.isRecord).toBeTypeOf("function"); 25 - expect(ForumAtgoraInteractionReaction.validateRecord).toBeTypeOf( 23 + it("exports ForumBarazoInteractionReaction with Record type and validators", () => { 24 + expect(ForumBarazoInteractionReaction.isRecord).toBeTypeOf("function"); 25 + expect(ForumBarazoInteractionReaction.validateRecord).toBeTypeOf( 26 26 "function", 27 27 ); 28 28 }); 29 29 30 - it("exports ForumAtgoraActorPreferences with Record type and validators", () => { 31 - expect(ForumAtgoraActorPreferences.isRecord).toBeTypeOf("function"); 32 - expect(ForumAtgoraActorPreferences.validateRecord).toBeTypeOf("function"); 30 + it("exports ForumBarazoActorPreferences with Record type and validators", () => { 31 + expect(ForumBarazoActorPreferences.isRecord).toBeTypeOf("function"); 32 + expect(ForumBarazoActorPreferences.validateRecord).toBeTypeOf("function"); 33 33 }); 34 34 }); 35 35 36 36 describe("LEXICON_IDS constants", () => { 37 37 it("has correct TopicPost ID", () => { 38 - expect(LEXICON_IDS.TopicPost).toBe("forum.atgora.topic.post"); 38 + expect(LEXICON_IDS.TopicPost).toBe("forum.barazo.topic.post"); 39 39 }); 40 40 41 41 it("has correct TopicReply ID", () => { 42 - expect(LEXICON_IDS.TopicReply).toBe("forum.atgora.topic.reply"); 42 + expect(LEXICON_IDS.TopicReply).toBe("forum.barazo.topic.reply"); 43 43 }); 44 44 45 45 it("has correct Reaction ID", () => { 46 - expect(LEXICON_IDS.Reaction).toBe("forum.atgora.interaction.reaction"); 46 + expect(LEXICON_IDS.Reaction).toBe("forum.barazo.interaction.reaction"); 47 47 }); 48 48 49 49 it("has correct ActorPreferences ID", () => { 50 50 expect(LEXICON_IDS.ActorPreferences).toBe( 51 - "forum.atgora.actor.preferences", 51 + "forum.barazo.actor.preferences", 52 52 ); 53 53 }); 54 54 }); ··· 59 59 expect(schemas.length).toBeGreaterThan(0); 60 60 }); 61 61 62 - it("schemas contain all ATgora lexicon IDs", () => { 62 + it("schemas contain all Barazo lexicon IDs", () => { 63 63 const schemaIds = schemas.map( 64 64 (s: Record<string, unknown>) => s["id"] as string, 65 65 ); 66 - expect(schemaIds).toContain("forum.atgora.topic.post"); 67 - expect(schemaIds).toContain("forum.atgora.topic.reply"); 68 - expect(schemaIds).toContain("forum.atgora.interaction.reaction"); 69 - expect(schemaIds).toContain("forum.atgora.actor.preferences"); 66 + expect(schemaIds).toContain("forum.barazo.topic.post"); 67 + expect(schemaIds).toContain("forum.barazo.topic.reply"); 68 + expect(schemaIds).toContain("forum.barazo.interaction.reaction"); 69 + expect(schemaIds).toContain("forum.barazo.actor.preferences"); 70 70 }); 71 71 }); 72 72 73 73 describe("generated ids map", () => { 74 - it("maps ForumAtgoraTopicPost correctly", () => { 75 - expect(ids.ForumAtgoraTopicPost).toBe("forum.atgora.topic.post"); 74 + it("maps ForumBarazoTopicPost correctly", () => { 75 + expect(ids.ForumBarazoTopicPost).toBe("forum.barazo.topic.post"); 76 76 }); 77 77 78 - it("maps ForumAtgoraTopicReply correctly", () => { 79 - expect(ids.ForumAtgoraTopicReply).toBe("forum.atgora.topic.reply"); 78 + it("maps ForumBarazoTopicReply correctly", () => { 79 + expect(ids.ForumBarazoTopicReply).toBe("forum.barazo.topic.reply"); 80 80 }); 81 81 82 - it("maps ForumAtgoraInteractionReaction correctly", () => { 83 - expect(ids.ForumAtgoraInteractionReaction).toBe( 84 - "forum.atgora.interaction.reaction", 82 + it("maps ForumBarazoInteractionReaction correctly", () => { 83 + expect(ids.ForumBarazoInteractionReaction).toBe( 84 + "forum.barazo.interaction.reaction", 85 85 ); 86 86 }); 87 87 88 - it("maps ForumAtgoraActorPreferences correctly", () => { 89 - expect(ids.ForumAtgoraActorPreferences).toBe( 90 - "forum.atgora.actor.preferences", 88 + it("maps ForumBarazoActorPreferences correctly", () => { 89 + expect(ids.ForumBarazoActorPreferences).toBe( 90 + "forum.barazo.actor.preferences", 91 91 ); 92 92 }); 93 93 }); 94 94 95 95 describe("isRecord type guards", () => { 96 - it("ForumAtgoraTopicPost.isRecord identifies correct $type", () => { 96 + it("ForumBarazoTopicPost.isRecord identifies correct $type", () => { 97 97 expect( 98 - ForumAtgoraTopicPost.isRecord({ 99 - $type: "forum.atgora.topic.post", 98 + ForumBarazoTopicPost.isRecord({ 99 + $type: "forum.barazo.topic.post", 100 100 title: "Test", 101 101 }), 102 102 ).toBe(true); 103 103 }); 104 104 105 - it("ForumAtgoraTopicPost.isRecord rejects wrong $type", () => { 105 + it("ForumBarazoTopicPost.isRecord rejects wrong $type", () => { 106 106 expect( 107 - ForumAtgoraTopicPost.isRecord({ 108 - $type: "forum.atgora.topic.reply", 107 + ForumBarazoTopicPost.isRecord({ 108 + $type: "forum.barazo.topic.reply", 109 109 content: "Test", 110 110 }), 111 111 ).toBe(false); 112 112 }); 113 113 114 - it("ForumAtgoraTopicPost.isRecord rejects non-objects", () => { 115 - expect(ForumAtgoraTopicPost.isRecord("string")).toBe(false); 116 - expect(ForumAtgoraTopicPost.isRecord(null)).toBe(false); 117 - expect(ForumAtgoraTopicPost.isRecord(undefined)).toBe(false); 114 + it("ForumBarazoTopicPost.isRecord rejects non-objects", () => { 115 + expect(ForumBarazoTopicPost.isRecord("string")).toBe(false); 116 + expect(ForumBarazoTopicPost.isRecord(null)).toBe(false); 117 + expect(ForumBarazoTopicPost.isRecord(undefined)).toBe(false); 118 118 }); 119 119 });
+1 -1
tests/zod-validation.test.ts
··· 9 9 const VALID_DID = "did:plc:abc123def456"; 10 10 const VALID_DATETIME = "2026-02-12T10:00:00.000Z"; 11 11 const VALID_STRONG_REF = { 12 - uri: "at://did:plc:abc123/forum.atgora.topic.post/3jzfcijpj2z2a", 12 + uri: "at://did:plc:abc123/forum.barazo.topic.post/3jzfcijpj2z2a", 13 13 cid: "bafyreibouvacvqhc2vkwwtdkfynpcaoatmkde7uhrw47ne4gu63cnzc7yq", 14 14 }; 15 15