npm.io
1.1.3 • Published 1 week ago

@sap-ux/odata-vocabularies

Licence
Apache-2.0
Version
1.1.3
Deps
1
Size
903 kB
Vulns
0
Weekly
0
Stars
159

Changelog Github repo

@sap-ux/odata-vocabularies

Library that contains the most recent copies of the OData vocabularies authored by OASIS and SAP

Supported Vocabularies

OASIS Vocabularies

  • Aggregation
  • Authorization
  • Core
  • Capabilities
  • Measures
  • Temporal
  • Repeatability
  • Validation
  • JSON

SAP Vocabularies

  • Analytics
  • Auditing
  • CodeList
  • Common
  • Communication
  • DataIntegration
  • DirectEdit
  • Graph
  • Hierarchy
  • HTML5
  • ODM
  • PDF
  • PersonalData
  • Session
  • Support
  • UI

Maintaining Vocabularies

Use the odata-vocabularies-sync skill (.agents/skills/odata-vocabularies-sync/SKILL.md) via an AI agent:

  • No argument — update all existing vocabularies to their latest published versions
  • With a JSON URL (must end in .json, XML is not supported) — register a new vocabulary, then update all

Local testing in tools-suite

To test local changes to this package inside the XML annotation language server of tools-suite, use yalc. pnpm link does not work there because the language server is an esbuild bundle and dependencies are resolved at build time.

Quick reference — after every change:

# in open-ux-tools/packages/odata-vocabularies
pnpm --filter @sap-ux/odata-vocabularies build
yalc push

# in tools-suite root
yalc add @sap-ux/odata-vocabularies
yarn build:scope sap-ux-annotation-modeler-extension
# restart the Extension Host in VS Code

Installation

Npm npm install --save @sap-ux/odata-vocabularies

Yarn yarn add @sap-ux/odata-vocabularies

Pnpm pnpm add @sap-ux/odata-vocabularies

Usage

  1. Import the needed functions in your modules

    import { VocabularyService } from '@sap-ux/odata-vocabularies';

Vocabulary API

The vocabulary API is implemented via class VocabularyService and currently exposes the following functions:

  • checkTermApplicability

  • getComplexType

  • getComplexTypeProperty

  • getDerivedTypeNames

  • getDocumentation

  • getTerm

  • getTermsForTargetKinds

  • getType

  • getVocabularies

  • getVocabulary

  • getVocabularyNamespace