@baron1996/kline-scene-schema 0.4.3 → 0.5.1

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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** 场景协议包版本;Scene version 仍保持 1。 */
2
- export declare const SCENE_PACKAGE_VERSION: "0.4.3";
2
+ export declare const SCENE_PACKAGE_VERSION: "0.5.1";
3
3
  export * from './canonical-json.js';
4
4
  export * from './canonicalize.js';
5
5
  export * from './decimal-normalization.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /** 场景协议包版本;Scene version 仍保持 1。 */
2
- export const SCENE_PACKAGE_VERSION = '0.4.3';
2
+ export const SCENE_PACKAGE_VERSION = '0.5.1';
3
3
  export * from './canonical-json.js';
4
4
  export * from './canonicalize.js';
5
5
  export * from './decimal-normalization.js';
@@ -1 +1 @@
1
- {"version":3,"file":"semantic-validator.d.ts","sourceRoot":"","sources":["../src/semantic-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EAIV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAiiB/E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,UAAU,EAAE,CAM9E;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAM3D"}
1
+ {"version":3,"file":"semantic-validator.d.ts","sourceRoot":"","sources":["../src/semantic-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EAIV,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAmC,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AA8iB/E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,UAAU,EAAE,CAM9E;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAM3D"}
@@ -98,7 +98,13 @@ function validateIndicator(indicator, pane, index, issues) {
98
98
  issues.push(issue('INVALID_REFERENCE', `${path}/yAxisId`, 'Indicator yAxisId must reference an axis in its containing Pane.'));
99
99
  }
100
100
  const expectedCount = INDICATOR_PARAM_COUNTS[indicator.name];
101
- if (indicator.calcParams.length !== expectedCount) {
101
+ if (indicator.name === 'MA') {
102
+ if (indicator.calcParams.length < 1 ||
103
+ indicator.calcParams.length > 8) {
104
+ issues.push(issue('SCENE_SCHEMA_INVALID', `${path}/calcParams`, 'MA requires 1 to 8 calculation parameters.'));
105
+ }
106
+ }
107
+ else if (indicator.calcParams.length !== expectedCount) {
102
108
  issues.push(issue('SCENE_SCHEMA_INVALID', `${path}/calcParams`, `${indicator.name} requires exactly ${expectedCount} calculation parameters.`));
103
109
  }
104
110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baron1996/kline-scene-schema",
3
- "version": "0.4.3",
3
+ "version": "0.5.1",
4
4
  "description": "Strict ChartScene schema, types, validation, and canonical serialization.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",