Skip to content

Commit

Permalink
chore(dcs): expose canMigrate and migrateTo methods from DecoratorMan…
Browse files Browse the repository at this point in the history
…ager (#979)

Signed-off-by: sanketshevkar <[email protected]>
  • Loading branch information
sanketshevkar authored Jan 21, 2025
1 parent 037e12c commit 501794d
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 62 deletions.
2 changes: 2 additions & 0 deletions packages/concerto-core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class Concerto {
+ object setCurrentTime()
class DecoratorManager {
+ ModelManager validate(decoratorCommandSet,ModelFile[]) throws Error
+ object migrateTo(decoratorCommandSet,string)
+ boolean canMigrate(decoratorCommandSet,DCS_VERSION)
+ ModelManager decorateModels(ModelManager,decoratorCommandSet,object?,boolean?,boolean?,boolean?,boolean?,boolean?)
+ ExtractDecoratorsResult extractDecorators(ModelManager,object,boolean,string)
+ ExtractDecoratorsResult extractVocabularies(ModelManager,object,boolean,string)
Expand Down
4 changes: 4 additions & 0 deletions packages/concerto-core/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
# Note that the latest public API is documented using JSDocs and is available in api.txt.
#


Version 3.20.4 {335406876b7005f0a2e6f9ca3e0d0dbf} 2025-01-21
- expose canMigrate and MigrateTo methods from decorator manager

Version 3.19.2 {844c910d1f8f61ab31c34e85d8c51546} 2024-10-21
- update options for ModelManager

Expand Down
2 changes: 0 additions & 2 deletions packages/concerto-core/lib/decoratormanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ class DecoratorManager {

/**
* Rewrites the $class property on decoratorCommandSet classes.
* @private
* @param {*} decoratorCommandSet the DecoratorCommandSet object
* @param {string} version the DCS version upgrade target
* @returns {object} the migrated DecoratorCommandSet object
Expand All @@ -224,7 +223,6 @@ class DecoratorManager {
/**
* Checks if the supplied decoratorCommandSet can be migrated.
* Migrations should only take place across minor versions of the same major version.
* @private
* @param {*} decoratorCommandSet the DecoratorCommandSet object
* @param {*} DCS_VERSION the DecoratorCommandSet version
* @returns {boolean} returns true if major versions are equal
Expand Down
6 changes: 2 additions & 4 deletions packages/concerto-core/types/lib/decoratormanager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,19 @@ declare class DecoratorManager {
static validate(decoratorCommandSet: any, modelFiles?: ModelFile[]): ModelManager;
/**
* Rewrites the $class property on decoratorCommandSet classes.
* @private
* @param {*} decoratorCommandSet the DecoratorCommandSet object
* @param {string} version the DCS version upgrade target
* @returns {object} the migrated DecoratorCommandSet object
*/
private static migrateTo;
static migrateTo(decoratorCommandSet: any, version: string): object;
/**
* Checks if the supplied decoratorCommandSet can be migrated.
* Migrations should only take place across minor versions of the same major version.
* @private
* @param {*} decoratorCommandSet the DecoratorCommandSet object
* @param {*} DCS_VERSION the DecoratorCommandSet version
* @returns {boolean} returns true if major versions are equal
*/
private static canMigrate;
static canMigrate(decoratorCommandSet: any, DCS_VERSION: any): boolean;
/**
* Add decorator commands set with index object to the coresponding target map
* @param {*} targetMap the target map to add the command to
Expand Down
2 changes: 1 addition & 1 deletion packages/concerto-vocabulary/lib/vocabularymanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const YAML = require('yaml');
const { MetaModelNamespace } = require('@accordproject/concerto-metamodel');
const Vocabulary = require('./vocabulary');

const DC_NAMESPACE = 'org.accordproject.decoratorcommands@0.3.0';
const DC_NAMESPACE = 'org.accordproject.decoratorcommands@0.4.0';

// Types needed for TypeScript generation.
/* eslint-disable no-unused-vars */
Expand Down
Loading

0 comments on commit 501794d

Please sign in to comment.