@tgam/pb-schema
v1.0.2
Published
Types for ArcXP ANS Schema
Keywords
Readme
PageBuilder Content Source Types
ArcXP ANS Schema
ANS ("Arc Native Specification") is the collection of schema documents that comprise the Washington Post's definition of "content", in so far as content is passed back and forth between systems in the Arc ecosystem of applications.
The ANS Schema repo only contains JSON schema specifications.
This repo converts the JSON schema specifications to TypeScript types, for use by PageBuilder web apps.
ANS Documentation
- https://docs.arcxp.com/en/products/content/getting-started-with-ans.html
- https://dev.arcxp.com/concepts/content-model-ans/understanding-arc-native-specification-ans/
Installation
While ans-schema is a public package, it does require a GitHub authentication token to be installed. First, you will need to generate a "personal access token (classic)" with the scope read:packages. Once you have the token, you can add these lines to your ~/.npmrc:
@washingtonpost:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=ghp_XXXXXXXXXXXXXX (put your token here)Finally, you can install the package:
npm install @washingtonpost/ans-schemaFor more information, please refer to GitHub documentation:
- https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#installing-a-package
- https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages
The current production version of ANS is 0.10.11
The current development version of ANS is 0.10.12
Schema files
ANS Schema files are defined with the JSON Schema specification. Schemas are defined in individual files under the src/main/resrouces/schema/ans/version/ directory.
Small, self-contained, attributes such as "had copyright" or "had unique id" are modeled as traits, which are combined together or applied directly to more complicated schema objects for the purpose of re-usability. The "content.json" schema, for example, composes the traits "credit", "locale", "location", and "copyright".
One can use a variety of third party tools to validate their content against the schema files hosted here on github publicly, such as Ajv.
