Skip to content

Commit c456cda

Browse files
satyam-mishra-pces-adamantine
authored andcommitted
feat: add pub.leaflet.pages.linearDocument to longDescription union
Insert pub.leaflet.pages.linearDocument#main as the second variant in the longDescription union, between descriptionString and strongRef, so clients can embed a Leaflet document directly rather than only via a strongRef indirection. Also fix the style checker to skip ref-resolution for known-external namespaces (pub.leaflet.*, app.bsky.*, com.atproto.*) in union types, consistent with how file-level checks already exempt those namespaces.
1 parent e7fe939 commit c456cda

4 files changed

Lines changed: 24 additions & 9 deletions

File tree

SCHEMAS.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -424,13 +424,15 @@ A location represented as a string, e.g. coordinates or a small GeoJSON string.
424424

425425
#### Properties
426426

427-
| Property | Type | Required | Description | Comments |
428-
| ------------------ | ---------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
429-
| `organizationType` | `string[]` || Legal or operational structures of the organization (e.g. 'nonprofit', 'ngo', 'government', 'social-enterprise', 'cooperative'). | maxLength: 10 |
430-
| `urls` | `ref[]` || Additional reference URLs (social media profiles, contact pages, donation links, etc.) with a display label for each URL. | |
431-
| `location` | `ref` || A strong reference to the location where the organization is based. The record referenced must conform with the lexicon app.certified.location. | |
432-
| `foundedDate` | `string` || When the organization was established. Stored as datetime per ATProto conventions (no date-only format exists). Clients should use midnight UTC (e.g., '2005-01-01T00:00:00.000Z'); consumers should treat only the date portion as canonical. | |
433-
| `createdAt` | `string` || Client-declared timestamp when this record was originally created. | |
427+
| Property | Type | Required | Description | Comments |
428+
| ------------------ | ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
429+
| `organizationType` | `string[]` || Legal or operational structures of the organization (e.g. 'nonprofit', 'ngo', 'government', 'social-enterprise', 'cooperative'). | maxLength: 10 |
430+
| `urls` | `ref[]` || Additional reference URLs (social media profiles, contact pages, donation links, etc.) with a display label for each URL. | |
431+
| `location` | `ref` || A strong reference to the location where the organization is based. The record referenced must conform with the lexicon app.certified.location. | |
432+
| `foundedDate` | `string` || When the organization was established. Stored as datetime per ATProto conventions (no date-only format exists). Clients should use midnight UTC (e.g., '2005-01-01T00:00:00.000Z'); consumers should treat only the date portion as canonical. | |
433+
| `longDescription` | `union` || Long-form description of the organization, such as its mission, history, or detailed project narrative. An inline string for plain text or markdown, a Leaflet linear document record embedded directly, or a strong reference to an existing document record. | |
434+
| `visibility` | `string` || Controls whether the organization or project is publicly discoverable on platforms that honor this setting. | Known values: `public`, `unlisted` |
435+
| `createdAt` | `string` || Client-declared timestamp when this record was originally created. | |
434436

435437
#### Defs
436438

lexicons/app/certified/actor/organization.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@
4242
"type": "union",
4343
"refs": [
4444
"org.hypercerts.defs#descriptionString",
45+
"pub.leaflet.pages.linearDocument#main",
4546
"com.atproto.repo.strongRef"
4647
],
47-
"description": "Long-form description of the organization, such as its mission, history, or detailed project narrative. An inline string for plain text or markdown, or a strong reference to a rich-text document record (e.g. a Leaflet linear document)."
48+
"description": "Long-form description of the organization, such as its mission, history, or detailed project narrative. An inline string for plain text or markdown, a Leaflet linear document record embedded directly, or a strong reference to an existing document record."
4849
},
4950
"visibility": {
5051
"type": "string",

scripts/check-lexicon-style.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,18 @@ class StyleChecker {
608608

609609
// Check if this is an external ref (e.g., "com.atproto.repo.strongRef" or "org.hypercerts.defs#uri")
610610
if (typeof ref === "string" && !ref.startsWith("#")) {
611+
// Known-external lexicon namespaces are not present in the local lexicons/ directory.
612+
// Skip resolution for these — they are valid by convention (the same namespaces skipped
613+
// during file-level style checks).
614+
const knownExternalPrefixes = [
615+
"pub.leaflet.",
616+
"app.bsky.",
617+
"com.atproto.",
618+
];
619+
if (knownExternalPrefixes.some((prefix) => ref.startsWith(prefix))) {
620+
return;
621+
}
622+
611623
const resolvedDef = this.resolveExternalRef(ref);
612624
if (resolvedDef) {
613625
if (!resolvedDef.type) {

tests/validate-actor-organization.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe("app.certified.actor.organization", () => {
3535
}
3636
});
3737

38-
it("should accept record with inline longDescription", () => {
38+
it("should accept record with inline longDescription (descriptionString)", () => {
3939
const result = Organization.validateMain({
4040
$type: ids.AppCertifiedActorOrganization,
4141
longDescription: {

0 commit comments

Comments
 (0)