Skip to content

Commit 501794d

Browse files
chore(dcs): expose canMigrate and migrateTo methods from DecoratorManager (#979)
Signed-off-by: sanketshevkar <[email protected]>
1 parent 037e12c commit 501794d

File tree

6 files changed

+64
-62
lines changed

6 files changed

+64
-62
lines changed

packages/concerto-core/api.txt

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ class Concerto {
5858
+ object setCurrentTime()
5959
class DecoratorManager {
6060
+ ModelManager validate(decoratorCommandSet,ModelFile[]) throws Error
61+
+ object migrateTo(decoratorCommandSet,string)
62+
+ boolean canMigrate(decoratorCommandSet,DCS_VERSION)
6163
+ ModelManager decorateModels(ModelManager,decoratorCommandSet,object?,boolean?,boolean?,boolean?,boolean?,boolean?)
6264
+ ExtractDecoratorsResult extractDecorators(ModelManager,object,boolean,string)
6365
+ ExtractDecoratorsResult extractVocabularies(ModelManager,object,boolean,string)

packages/concerto-core/changelog.txt

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
# Note that the latest public API is documented using JSDocs and is available in api.txt.
2525
#
2626

27+
28+
Version 3.20.4 {335406876b7005f0a2e6f9ca3e0d0dbf} 2025-01-21
29+
- expose canMigrate and MigrateTo methods from decorator manager
30+
2731
Version 3.19.2 {844c910d1f8f61ab31c34e85d8c51546} 2024-10-21
2832
- update options for ModelManager
2933

packages/concerto-core/lib/decoratormanager.js

-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ class DecoratorManager {
199199

200200
/**
201201
* Rewrites the $class property on decoratorCommandSet classes.
202-
* @private
203202
* @param {*} decoratorCommandSet the DecoratorCommandSet object
204203
* @param {string} version the DCS version upgrade target
205204
* @returns {object} the migrated DecoratorCommandSet object
@@ -224,7 +223,6 @@ class DecoratorManager {
224223
/**
225224
* Checks if the supplied decoratorCommandSet can be migrated.
226225
* Migrations should only take place across minor versions of the same major version.
227-
* @private
228226
* @param {*} decoratorCommandSet the DecoratorCommandSet object
229227
* @param {*} DCS_VERSION the DecoratorCommandSet version
230228
* @returns {boolean} returns true if major versions are equal

packages/concerto-core/types/lib/decoratormanager.d.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,19 @@ declare class DecoratorManager {
2121
static validate(decoratorCommandSet: any, modelFiles?: ModelFile[]): ModelManager;
2222
/**
2323
* Rewrites the $class property on decoratorCommandSet classes.
24-
* @private
2524
* @param {*} decoratorCommandSet the DecoratorCommandSet object
2625
* @param {string} version the DCS version upgrade target
2726
* @returns {object} the migrated DecoratorCommandSet object
2827
*/
29-
private static migrateTo;
28+
static migrateTo(decoratorCommandSet: any, version: string): object;
3029
/**
3130
* Checks if the supplied decoratorCommandSet can be migrated.
3231
* Migrations should only take place across minor versions of the same major version.
33-
* @private
3432
* @param {*} decoratorCommandSet the DecoratorCommandSet object
3533
* @param {*} DCS_VERSION the DecoratorCommandSet version
3634
* @returns {boolean} returns true if major versions are equal
3735
*/
38-
private static canMigrate;
36+
static canMigrate(decoratorCommandSet: any, DCS_VERSION: any): boolean;
3937
/**
4038
* Add decorator commands set with index object to the coresponding target map
4139
* @param {*} targetMap the target map to add the command to

packages/concerto-vocabulary/lib/vocabularymanager.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const YAML = require('yaml');
1818
const { MetaModelNamespace } = require('@accordproject/concerto-metamodel');
1919
const Vocabulary = require('./vocabulary');
2020

21-
const DC_NAMESPACE = 'org.accordproject.decoratorcommands@0.3.0';
21+
const DC_NAMESPACE = 'org.accordproject.decoratorcommands@0.4.0';
2222

2323
// Types needed for TypeScript generation.
2424
/* eslint-disable no-unused-vars */

0 commit comments

Comments
 (0)