Skip to content

Commit

Permalink
TA-2977: Rename serializedContent
Browse files Browse the repository at this point in the history
  • Loading branch information
promeris committed May 21, 2024
1 parent 19b9a02 commit d831676
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/interfaces/package-export-transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface NodeExportTransport {
name: string;
type: string;
exportSerializationType: string;
serializedContent: string;
configuration: string;
schemaVersion: number;

spaceId: string;
Expand Down
4 changes: 2 additions & 2 deletions src/services/studio/studio.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ class StudioService {
const packageEntry = packageZip.getEntry("package.yml");

const exportedNode: NodeExportTransport = parse(packageEntry.getData().toString());
const nodeContent: NodeSerializedContent = parse(exportedNode.serializedContent);
const nodeContent: NodeSerializedContent = parse(exportedNode.configuration);

nodeContent.variables = nodeContent.variables.map(variable => ({
...variable,
metadata: variable.type === PackageManagerVariableType.CONNECTION ?
connectionVariablesByKey.get(variable.key).metadata : variable.metadata
}));

exportedNode.serializedContent = stringify(nodeContent);
exportedNode.configuration = stringify(nodeContent);
packageZip.updateFile(packageEntry, Buffer.from(stringify(exportedNode)));
}

Expand Down
6 changes: 3 additions & 3 deletions tests/config/config-export.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ describe("Config export", () => {
const firstPackageExportedZip = new AdmZip(actualZip.getEntry("key-1_1.0.0.zip").getData());
const firstPackageExportedNode: NodeExportTransport = parse(firstPackageExportedZip.getEntry("package.yml").getData().toString());
expect(firstPackageExportedNode).toBeTruthy();
const firstPackageContent: NodeSerializedContent = parse(firstPackageExportedNode.serializedContent);
const firstPackageContent: NodeSerializedContent = parse(firstPackageExportedNode.configuration);
expect(firstPackageContent.variables).toHaveLength(2);
expect(firstPackageContent.variables).toEqual([
{
Expand All @@ -422,7 +422,7 @@ describe("Config export", () => {
const secondPackageExportedZip = new AdmZip(actualZip.getEntry("key-2_1.0.0.zip").getData());
const secondPackageExportedNode: NodeExportTransport = parse(secondPackageExportedZip.getEntry("package.yml").getData().toString());
expect(secondPackageExportedNode).toBeTruthy();
const secondPackageContent: NodeSerializedContent = parse(secondPackageExportedNode.serializedContent);
const secondPackageContent: NodeSerializedContent = parse(secondPackageExportedNode.configuration);
expect(secondPackageContent.variables).toHaveLength(2);
expect(secondPackageContent.variables).toEqual([{
...secondPackageVariableDefinition[0],
Expand Down Expand Up @@ -513,7 +513,7 @@ describe("Config export", () => {
const firstPackageExportedZip = new AdmZip(actualZip.getEntry("key_with_underscores_1_1.0.0.zip").getData());
const firstPackageExportedNode: NodeExportTransport = parse(firstPackageExportedZip.getEntry("package.yml").getData().toString());
expect(firstPackageExportedNode).toBeTruthy();
const firstPackageContent: NodeSerializedContent = parse(firstPackageExportedNode.serializedContent);
const firstPackageContent: NodeSerializedContent = parse(firstPackageExportedNode.configuration);
expect(firstPackageContent.variables).toHaveLength(3);
expect(firstPackageContent.variables).toEqual([
{
Expand Down
4 changes: 2 additions & 2 deletions tests/utls/config-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class ConfigUtils {
name: "name",
type: "PACKAGE",
exportSerializationType: "YAML",
serializedContent,
configuration: serializedContent,
schemaVersion: 1,
invalidContent: false,
serializedDocument: null,
Expand All @@ -81,7 +81,7 @@ export class ConfigUtils {
name: "name",
type: type,
exportSerializationType: "YAML",
serializedContent: "",
configuration: "",
schemaVersion: 1,
invalidContent: false,
serializedDocument: null,
Expand Down

0 comments on commit d831676

Please sign in to comment.