@kumori/aurora-backend-handler 1.0.38 → 1.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -592,10 +592,14 @@ export const processRevisionData = (
592
592
  const parameters = extractParametersFromConfig(config.parameter || {});
593
593
  const resources = extractResources(config.resource || {});
594
594
 
595
+ let schema: any = {};
596
+ if (revisionData.revision) {
597
+ schema = extractStructuredSchema(revisionData);
598
+ }
599
+
595
600
  if (revisionsMap && serviceId && revisionData.revision) {
596
601
  const revisionId: string = revisionData.revision;
597
602
  const revisionKey = `${serviceId}-${revisionId}`;
598
- const schema = extractStructuredSchema(revisionData);
599
603
  const existing = revisionsMap.get(revisionKey);
600
604
  if (existing) {
601
605
  revisionsMap.set(revisionKey, { ...existing, schema });
@@ -645,26 +649,35 @@ export const processRevisionData = (
645
649
  const deploymentName = solution.top || service.name;
646
650
  const deployment = solution.deployments[deploymentName];
647
651
 
652
+ const applySchemaToService = (svc: Service): Service => {
653
+ if (!revisionData.revision || !schema) return svc;
654
+ const revisionId: string = revisionData.revision;
655
+ return {
656
+ ...svc,
657
+ revisions: svc.revisions.map((rev) =>
658
+ rev.id === revisionId ? { ...rev, schema } : rev,
659
+ ),
660
+ };
661
+ };
662
+
648
663
  if (!deployment) {
649
664
  const firstDeploymentKey = Object.keys(solution.deployments)[0];
650
665
  if (firstDeploymentKey) {
651
- return processDeployment(
652
- service,
653
- solution.deployments[firstDeploymentKey],
654
- revisionData,
655
- parameters,
656
- resources,
666
+ return applySchemaToService(
667
+ processDeployment(
668
+ service,
669
+ solution.deployments[firstDeploymentKey],
670
+ revisionData,
671
+ parameters,
672
+ resources,
673
+ ),
657
674
  );
658
675
  }
659
- return { ...service, parameters, resources };
676
+ return applySchemaToService({ ...service, parameters, resources });
660
677
  }
661
678
 
662
- return processDeployment(
663
- service,
664
- deployment,
665
- revisionData,
666
- parameters,
667
- resources,
679
+ return applySchemaToService(
680
+ processDeployment(service, deployment, revisionData, parameters, resources),
668
681
  );
669
682
  };
670
683
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumori/aurora-backend-handler",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "description": "backend handler",
5
5
  "main": "backend-handler.ts",
6
6
  "scripts": {