-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from celonis/fisgeci/tn-x-add-datamodel-mapping
Tn-4460: Add dataModelMappings option to import packages command
- Loading branch information
Showing
11 changed files
with
141 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { | ||
ContentNodeTransport, | ||
VariableDefinitionWithValue, VariablesAssignments | ||
} from "../interfaces/package-manager.interfaces"; | ||
import {httpClientV2} from "../services/http-client-service.v2"; | ||
import {FatalError} from "../util/logger"; | ||
|
||
class VariablesApi { | ||
public static readonly INSTANCE = new VariablesApi(); | ||
|
||
public async assignVariableValues(packageKey: string, variablesAssignments: VariablesAssignments[]): Promise<ContentNodeTransport[]> { | ||
return httpClientV2.post(`/package-manager/api/nodes/by-package-key/${packageKey}/variables/values`, variablesAssignments).catch(e => { | ||
throw new FatalError(`Problem updating variables of package ${packageKey}: ${e}`); | ||
}); | ||
} | ||
} | ||
|
||
export const variablesApi = VariablesApi.INSTANCE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
import {packageApi} from "../../api/package-api"; | ||
import {PackageWithVariableAssignments, VariablesAssignments} from "../../interfaces/package-manager.interfaces"; | ||
import { | ||
PackageWithVariableAssignments, | ||
VariableDefinitionWithValue, | ||
VariablesAssignments | ||
} from "../../interfaces/package-manager.interfaces"; | ||
import {BatchExportNodeTransport} from "../../interfaces/batch-export-node-transport"; | ||
import {variablesApi} from "../../api/variables-api"; | ||
|
||
class VariableService { | ||
|
||
public async getVariableAssignmentsForNodes(nodes: BatchExportNodeTransport[]): Promise<PackageWithVariableAssignments[]> { | ||
return await packageApi.findAllPackagesWithVariableAssignments(); | ||
} | ||
|
||
public async assignVariableValues(packageKey: string, variablesAssignments: VariablesAssignments[]): Promise<void> { | ||
await variablesApi.assignVariableValues(packageKey, variablesAssignments); | ||
} | ||
} | ||
|
||
export const variableService = new VariableService(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export class SemanticVersioning { | ||
private version: string; | ||
|
||
constructor(version: string) { | ||
this.version = version; | ||
} | ||
|
||
public isGreaterThan(versionToCompare: SemanticVersioning): boolean { | ||
const splitVersion1 = this.version.split("."); | ||
const splitVersion2 = versionToCompare.version.split("."); | ||
|
||
const majorVersion1 = splitVersion1[0]; | ||
const majorVersion2 = splitVersion2[0]; | ||
|
||
const minorVersion1 = splitVersion1[1]; | ||
const minorVersion2 = splitVersion2[1]; | ||
|
||
const patchVersion1 = splitVersion1[2]; | ||
const patchVersion2 = splitVersion2[2]; | ||
|
||
return (majorVersion1 > majorVersion2) || (minorVersion1 > minorVersion2) || (patchVersion1 > patchVersion2); | ||
} | ||
} |