@microtronics/studio-cli 0.38.0 → 0.39.0

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.
package/CHANGELOG.md CHANGED
@@ -1,9 +1,17 @@
1
1
  # Changelog
2
2
 
3
- ## 0.38.0 (2025-10-23)
3
+ ## 0.39.0 (2025-11-10)
4
4
 
5
- ### Features
5
+ ### Bug Fixes
6
6
 
7
+ * add separate schema for single record requests ([a52d269](https://bitbucket.org/microtronics-core/vscode-studio/commits/a52d2692ef2e66dbcf49c4b8154c6a4d28d04b2e))
8
+ * fix response schemas for timeseries ([1b24c1c](https://bitbucket.org/microtronics-core/vscode-studio/commits/1b24c1c3deb867b4ab721b4c498930b2cbbd2526))
9
+ * update test fixtures for dde openapi generation ([9653e18](https://bitbucket.org/microtronics-core/vscode-studio/commits/9653e18477bba138a8906d51bc3118470af092fe))
10
+
11
+ ## 0.38.0 (2025-10-23)
12
+
13
+ ### Features
14
+
7
15
  * **cli:** dde generation filter out used containers in precompiler ([15a6c3e](https://bitbucket.org/microtronics-core/vscode-studio/commits/15a6c3eebb8245a3673311de64fa493dfc8c2094))
8
16
 
9
17
  ## 0.37.0 (2025-10-22)
@@ -298,26 +298,27 @@ function generateSchemasFromContainer(apiDescription, containerDefinition, conte
298
298
  schema.required = requiredProperties.length ? requiredProperties : undefined;
299
299
  apiDescription.components.schemas[schemaName] = schema;
300
300
  if (containerDefinition.containerType === ContainerType.hx) {
301
- apiDescription.components.schemas[`${schemaName}Request`] = {
302
- allOf: [
303
- timeseriesRequestBaseRef,
304
- {
305
- type: 'object',
306
- description: `Request schema of "${containerDefinition.title}"`,
307
- additionalProperties: false,
308
- properties: {
309
- select: {
310
- type: 'array',
311
- description: 'Optional selection of specific fields of the given container',
312
- items: {
313
- type: 'string',
314
- enum: Object.keys(schema.properties)
315
- }
316
- }
301
+ const timerSeriesSelect = {
302
+ type: 'object',
303
+ description: `Request schema of "${containerDefinition.title}"`,
304
+ additionalProperties: false,
305
+ properties: {
306
+ select: {
307
+ type: 'array',
308
+ description: 'Optional selection of specific fields of the given container',
309
+ items: {
310
+ type: 'string',
311
+ enum: Object.keys(schema.properties)
317
312
  }
318
313
  }
319
- ]
314
+ }
320
315
  };
316
+ apiDescription.components.schemas[`${schemaName}RequestSingle`] = timerSeriesSelect;
317
+ apiDescription.components.schemas[`${schemaName}Request`] = {
318
+ allOf: [timeseriesRequestBaseRef, timerSeriesSelect]
319
+ };
320
+ // stamp parameter is always returned if it is a timeseries container
321
+ schema.properties['stamp'] = rapidM2MStampRef;
321
322
  }
322
323
  }
323
324
  function getApiDefinitionForField(field) {
@@ -606,17 +607,31 @@ function generatePathInformationFromContainer(apiDescription, containerDefinitio
606
607
  value?.tags?.unshift(...pathOptions.tags);
607
608
  });
608
609
  apiDescription.paths[pathOptions.path] = methods;
610
+ const histdataSingleResponse = {
611
+ ...successfulOperationResponse,
612
+ content: {
613
+ 'application/json': {
614
+ schema: {
615
+ $ref: `#/components/schemas/${containerDefinition.title}`
616
+ }
617
+ }
618
+ }
619
+ };
609
620
  const youngestPath = `${pathOptions.path}/youngest`;
610
621
  const youngestMethod = {
611
622
  get: structuredClone(methods.get)
612
623
  };
613
624
  youngestMethod.get.summary = `Get the youngest record of "${containerDefinition.title}" container`;
625
+ youngestMethod.get.responses['200'] = histdataSingleResponse;
626
+ youngestMethod.get.parameters[1].schema.$ref = `#/components/schemas/${containerDefinition.title}RequestSingle`;
614
627
  apiDescription.paths[youngestPath] = youngestMethod;
615
628
  const oldestPath = `${pathOptions.path}/oldest`;
616
629
  const oldestMethod = {
617
630
  get: structuredClone(methods.get)
618
631
  };
619
632
  oldestMethod.get.summary = `Get the oldest record of "${containerDefinition.title}" container`;
633
+ oldestMethod.get.responses['200'] = histdataSingleResponse;
634
+ oldestMethod.get.parameters[1].schema.$ref = `#/components/schemas/${containerDefinition.title}RequestSingle`;
620
635
  apiDescription.paths[oldestPath] = oldestMethod;
621
636
  }
622
637
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microtronics/studio-cli",
3
- "version": "0.38.0",
3
+ "version": "0.39.0",
4
4
  "description": "Microtronics Studio CLI Tool",
5
5
  "main": "./out/api.js",
6
6
  "typings": "./dist/studio-cli.d.ts",