Skip to content

Releases: bcgsc/pori_graphkb_schema

v4.0.0

13 May 17:46
722fd55
Compare
Choose a tag to compare

Breaking Changes

  • No longer using classes for ClassDefinition and PropertyDefinition, see migration guide in the README (and below)

Migration Guide: v3 to v4

To facilitate more reuseable typing schemes ClassModel and Property classes have been removed and now are simply objects. All interactions with these models should go through the schema class instead of interacting directly with the model and property objects. Return types are given only when they differ.

v3 v4 equivalent
ClassModel._properties ClassDefinition.properties
ClassModel.properties SchemaDefinition.getProperties(modelName: string)
ClassModel.required SchemaDefinition.requiredProperties(modelName: string)
ClassModel.optional SchemaDefinition.optionalProperties(modelName: string)
ClassModel.getActiveProperties() SchemaDefinition.activeProperties(modelName: string)
ClassModel.inherits SchemaDefinition.ancestors(modelName: string)
ClassModel.subclasses: ClassModel[] SchemaDefinition.children(modelName: string): string[]
ClassModel.descendantTree(excludeAbstract: boolean): ClassModel[] SchemaDefinition.descendants(modelName: string, opt: { excludeAbstract?: boolean, includeSelf?: boolean }): string[] 1
ClassModel.queryProperties: Record<string,Property[]> SchemaDefinition.queryableProperties(modelName: string): Record<string,PropertyDefinition[]>
ClassModel.inheritsProperty(propName: string) SchemaDefinition.inheritsProperty(modelName: string, propName: string)
ClassModel.toJSON N/A 2
ClassModel.formatRecord(record: GraphRecord, opt = {}) SchemaDefinition.formatRecord(modelName: string, record: GraphRecord, opt = {})
Property.validate(inputValue: unknown): unknown validateProperty = (prop: PropertyDefinition, inputValue: unknown): unknown
  1. must be called with includeSelf=true to match v3 edition

  2. There is no need for this function now since the ClassDefinition object is effectively already a JSON object

v3.16.0

22 Mar 19:40
93f30b9
Compare
Choose a tag to compare

Improvements

  • Converted to typescript
  • Update to new typescript-based parser peer dependency

New Features

  • Added splitClassLevels function to SchemaDefn class (copied from API repo)

v3.15.1

26 Nov 18:29
684a0df
Compare
Choose a tag to compare

Improvements

  • Add support for node 16
  • Drop support for node 10

v3.15.0

28 Apr 18:21
1ee52df
Compare
Choose a tag to compare

v3.15.0

BugFixes

Note: Minor release since it requires a corresponding migration update in the API

v3.14.3

19 Jan 23:42
2e50b50
Compare
Choose a tag to compare

Bug Fixes

  • fix spelling error in statement templates

Improvements

  • devops: add builds for node 10, 12, and 14

v3.14.2

18 Dec 00:28
Compare
Choose a tag to compare

Initial Public Release