backtest-kit 2.0.3 → 2.0.4

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/build/index.cjs CHANGED
@@ -783,10 +783,14 @@ class ClientExchange {
783
783
  // Apply distinct by timestamp to remove duplicates
784
784
  const uniqueData = Array.from(new Map(filteredData.map((candle) => [candle.timestamp, candle])).values());
785
785
  if (filteredData.length !== uniqueData.length) {
786
- this.params.logger.warn(`ClientExchange Removed ${filteredData.length - uniqueData.length} duplicate candles by timestamp`);
786
+ const msg = `ClientExchange Removed ${filteredData.length - uniqueData.length} duplicate candles by timestamp`;
787
+ this.params.logger.warn(msg);
788
+ console.warn(msg);
787
789
  }
788
790
  if (uniqueData.length < limit) {
789
- this.params.logger.warn(`ClientExchange Expected ${limit} candles, got ${uniqueData.length}`);
791
+ const msg = `ClientExchange Expected ${limit} candles, got ${uniqueData.length}`;
792
+ this.params.logger.warn(msg);
793
+ console.warn(msg);
790
794
  }
791
795
  await CALL_CANDLE_DATA_CALLBACKS_FN(this, symbol, interval, since, limit, uniqueData);
792
796
  return uniqueData;
@@ -9896,11 +9900,119 @@ class RiskSchemaService {
9896
9900
  }
9897
9901
  }
9898
9902
 
9903
+ /**
9904
+ * List of valid method names allowed in action handlers.
9905
+ * Any public methods not in this list will trigger validation errors.
9906
+ * Private methods (starting with _ or #) are ignored during validation.
9907
+ */
9908
+ const VALID_METHOD_NAMES = [
9909
+ "init",
9910
+ "signal",
9911
+ "signalLive",
9912
+ "signalBacktest",
9913
+ "breakevenAvailable",
9914
+ "partialProfitAvailable",
9915
+ "partialLossAvailable",
9916
+ "pingScheduled",
9917
+ "pingActive",
9918
+ "riskRejection",
9919
+ "dispose",
9920
+ ];
9921
+ /**
9922
+ * Validates that all public methods in a class-based action handler are in the allowed list.
9923
+ *
9924
+ * Inspects the class prototype to find all method names and ensures they match
9925
+ * the VALID_METHOD_NAMES list. Private methods (starting with _ or #) are skipped.
9926
+ * Private fields with # are not visible via Object.getOwnPropertyNames() and don't
9927
+ * need validation as they're truly private and inaccessible.
9928
+ *
9929
+ * @param actionName - Name of the action being validated
9930
+ * @param handler - Class constructor for the action handler
9931
+ * @param self - ActionSchemaService instance for logging
9932
+ * @throws Error if any public method is not in VALID_METHOD_NAMES
9933
+ */
9934
+ const VALIDATE_CLASS_METHODS = (actionName, handler, self) => {
9935
+ // Get all method names from prototype (for classes)
9936
+ // Note: Private fields with # are not visible via Object.getOwnPropertyNames()
9937
+ // and don't need validation as they're truly private and inaccessible
9938
+ const prototypeProps = Object.getOwnPropertyNames(handler.prototype);
9939
+ for (const methodName of prototypeProps) {
9940
+ // Skip constructor and conventionally private methods (starting with _)
9941
+ if (methodName === "constructor" || methodName.startsWith("_")) {
9942
+ continue;
9943
+ }
9944
+ const descriptor = Object.getOwnPropertyDescriptor(handler.prototype, methodName);
9945
+ const isMethod = descriptor && typeof descriptor.value === "function";
9946
+ if (isMethod && !VALID_METHOD_NAMES.includes(methodName)) {
9947
+ const msg = functoolsKit.str.newline(`ActionSchema ${actionName} contains invalid method "${methodName}". `, `Valid methods are: ${VALID_METHOD_NAMES.join(", ")}`, `If you want to keep this property name use one of these patterns: _${methodName} or #${methodName}`);
9948
+ self.loggerService.log(`actionValidationService exception thrown`, {
9949
+ msg,
9950
+ });
9951
+ throw new Error(msg);
9952
+ }
9953
+ }
9954
+ };
9955
+ /**
9956
+ * Validates that all public methods in an object-based action handler are in the allowed list.
9957
+ *
9958
+ * Inspects the object's own properties to find all method names and ensures they match
9959
+ * the VALID_METHOD_NAMES list. Private properties (starting with _) are skipped.
9960
+ *
9961
+ * @param actionName - Name of the action being validated
9962
+ * @param handler - Plain object implementing partial IPublicAction interface
9963
+ * @param self - ActionSchemaService instance for logging
9964
+ * @throws Error if any public method is not in VALID_METHOD_NAMES
9965
+ */
9966
+ const VALIDATE_OBJECT_METHODS = (actionName, handler, self) => {
9967
+ // For plain objects (Partial<IPublicAction>)
9968
+ const methodNames = Object.keys(handler);
9969
+ for (const methodName of methodNames) {
9970
+ // Skip private properties (starting with _)
9971
+ if (methodName.startsWith("_")) {
9972
+ continue;
9973
+ }
9974
+ if (typeof handler[methodName] === "function" &&
9975
+ !VALID_METHOD_NAMES.includes(methodName)) {
9976
+ const msg = functoolsKit.str.newline(`ActionSchema ${actionName} contains invalid method "${methodName}". `, `Valid methods are: ${VALID_METHOD_NAMES.join(", ")}`, `If you want to keep this property name use one of these patterns: _${methodName} or #${methodName}`);
9977
+ self.loggerService.log(`actionValidationService exception thrown`, {
9978
+ msg,
9979
+ });
9980
+ throw new Error(msg);
9981
+ }
9982
+ }
9983
+ };
9899
9984
  /**
9900
9985
  * Service for managing action schema registry.
9901
9986
  *
9987
+ * Manages registration, validation and retrieval of action schemas.
9902
9988
  * Uses ToolRegistry from functools-kit for type-safe schema storage.
9903
- * Action handlers are registered via addAction() and retrieved by name.
9989
+ * Validates that action handlers only contain allowed public methods
9990
+ * from the IPublicAction interface.
9991
+ *
9992
+ * Key features:
9993
+ * - Type-safe action schema registration
9994
+ * - Method name validation for class and object handlers
9995
+ * - Private method support (methods starting with _ or #)
9996
+ * - Schema override capabilities
9997
+ *
9998
+ * @example
9999
+ * ```typescript
10000
+ * // Register a class-based action
10001
+ * actionSchemaService.register("telegram-notifier", {
10002
+ * actionName: "telegram-notifier",
10003
+ * handler: TelegramNotifierAction,
10004
+ * callbacks: { ... }
10005
+ * });
10006
+ *
10007
+ * // Register an object-based action
10008
+ * actionSchemaService.register("logger", {
10009
+ * actionName: "logger",
10010
+ * handler: {
10011
+ * signal: async (event) => { ... },
10012
+ * dispose: async () => { ... }
10013
+ * }
10014
+ * });
10015
+ * ```
9904
10016
  */
9905
10017
  class ActionSchemaService {
9906
10018
  constructor() {
@@ -9909,9 +10021,13 @@ class ActionSchemaService {
9909
10021
  /**
9910
10022
  * Registers a new action schema.
9911
10023
  *
9912
- * @param key - Unique action name
9913
- * @param value - Action schema configuration
9914
- * @throws Error if action name already exists
10024
+ * Validates the schema structure and method names before registration.
10025
+ * Throws an error if the action name already exists in the registry.
10026
+ *
10027
+ * @param key - Unique action name identifier
10028
+ * @param value - Action schema configuration with handler and optional callbacks
10029
+ * @throws Error if action name already exists in registry
10030
+ * @throws Error if validation fails (missing required fields, invalid handler, invalid method names)
9915
10031
  */
9916
10032
  this.register = (key, value) => {
9917
10033
  this.loggerService.log(`actionSchemaService register`, { key });
@@ -9923,11 +10039,13 @@ class ActionSchemaService {
9923
10039
  *
9924
10040
  * Performs shallow validation to ensure all required properties exist
9925
10041
  * and have correct types before registration in the registry.
10042
+ * Also validates that all public methods in the handler are allowed.
9926
10043
  *
9927
10044
  * @param actionSchema - Action schema to validate
9928
10045
  * @throws Error if actionName is missing or not a string
9929
- * @throws Error if handler is missing or not a function
9930
- * @throws Error if callbacks is not an object
10046
+ * @throws Error if handler is not a function or plain object
10047
+ * @throws Error if handler contains invalid public method names
10048
+ * @throws Error if callbacks is provided but not an object
9931
10049
  */
9932
10050
  this.validateShallow = (actionSchema) => {
9933
10051
  this.loggerService.log(`actionSchemaService validateShallow`, {
@@ -9936,21 +10054,30 @@ class ActionSchemaService {
9936
10054
  if (typeof actionSchema.actionName !== "string") {
9937
10055
  throw new Error(`action schema validation failed: missing actionName`);
9938
10056
  }
9939
- if (typeof actionSchema.handler !== "function" && !functoolsKit.isObject(actionSchema.handler)) {
10057
+ if (typeof actionSchema.handler !== "function" &&
10058
+ !functoolsKit.isObject(actionSchema.handler)) {
9940
10059
  throw new Error(`action schema validation failed: handler is not a function or plain object for actionName=${actionSchema.actionName}`);
9941
10060
  }
9942
- if (actionSchema.callbacks &&
9943
- !functoolsKit.isObject(actionSchema.callbacks)) {
10061
+ if (typeof actionSchema.handler === "function" && actionSchema.handler.prototype) {
10062
+ VALIDATE_CLASS_METHODS(actionSchema.actionName, actionSchema.handler, this);
10063
+ }
10064
+ if (typeof actionSchema.handler === "object" && actionSchema.handler !== null) {
10065
+ VALIDATE_OBJECT_METHODS(actionSchema.actionName, actionSchema.handler, this);
10066
+ }
10067
+ if (actionSchema.callbacks && !functoolsKit.isObject(actionSchema.callbacks)) {
9944
10068
  throw new Error(`action schema validation failed: callbacks is not an object for actionName=${actionSchema.actionName}`);
9945
10069
  }
9946
10070
  };
9947
10071
  /**
9948
10072
  * Overrides an existing action schema with partial updates.
9949
10073
  *
10074
+ * Merges provided partial schema updates with the existing schema.
10075
+ * Useful for modifying handler or callbacks without re-registering the entire schema.
10076
+ *
9950
10077
  * @param key - Action name to override
9951
- * @param value - Partial schema updates
9952
- * @returns Updated action schema
9953
- * @throws Error if action name doesn't exist
10078
+ * @param value - Partial schema updates to merge
10079
+ * @returns Updated action schema after override
10080
+ * @throws Error if action name doesn't exist in registry
9954
10081
  */
9955
10082
  this.override = (key, value) => {
9956
10083
  this.loggerService.log(`actionSchemaService override`, { key });
@@ -9960,9 +10087,12 @@ class ActionSchemaService {
9960
10087
  /**
9961
10088
  * Retrieves an action schema by name.
9962
10089
  *
9963
- * @param key - Action name
10090
+ * Returns the complete action schema configuration including handler and callbacks.
10091
+ * Used internally by ActionConnectionService to instantiate ClientAction instances.
10092
+ *
10093
+ * @param key - Action name identifier
9964
10094
  * @returns Action schema configuration
9965
- * @throws Error if action name doesn't exist
10095
+ * @throws Error if action name doesn't exist in registry
9966
10096
  */
9967
10097
  this.get = (key) => {
9968
10098
  this.loggerService.log(`actionSchemaService get`, { key });
package/build/index.mjs CHANGED
@@ -763,10 +763,14 @@ class ClientExchange {
763
763
  // Apply distinct by timestamp to remove duplicates
764
764
  const uniqueData = Array.from(new Map(filteredData.map((candle) => [candle.timestamp, candle])).values());
765
765
  if (filteredData.length !== uniqueData.length) {
766
- this.params.logger.warn(`ClientExchange Removed ${filteredData.length - uniqueData.length} duplicate candles by timestamp`);
766
+ const msg = `ClientExchange Removed ${filteredData.length - uniqueData.length} duplicate candles by timestamp`;
767
+ this.params.logger.warn(msg);
768
+ console.warn(msg);
767
769
  }
768
770
  if (uniqueData.length < limit) {
769
- this.params.logger.warn(`ClientExchange Expected ${limit} candles, got ${uniqueData.length}`);
771
+ const msg = `ClientExchange Expected ${limit} candles, got ${uniqueData.length}`;
772
+ this.params.logger.warn(msg);
773
+ console.warn(msg);
770
774
  }
771
775
  await CALL_CANDLE_DATA_CALLBACKS_FN(this, symbol, interval, since, limit, uniqueData);
772
776
  return uniqueData;
@@ -9876,11 +9880,119 @@ class RiskSchemaService {
9876
9880
  }
9877
9881
  }
9878
9882
 
9883
+ /**
9884
+ * List of valid method names allowed in action handlers.
9885
+ * Any public methods not in this list will trigger validation errors.
9886
+ * Private methods (starting with _ or #) are ignored during validation.
9887
+ */
9888
+ const VALID_METHOD_NAMES = [
9889
+ "init",
9890
+ "signal",
9891
+ "signalLive",
9892
+ "signalBacktest",
9893
+ "breakevenAvailable",
9894
+ "partialProfitAvailable",
9895
+ "partialLossAvailable",
9896
+ "pingScheduled",
9897
+ "pingActive",
9898
+ "riskRejection",
9899
+ "dispose",
9900
+ ];
9901
+ /**
9902
+ * Validates that all public methods in a class-based action handler are in the allowed list.
9903
+ *
9904
+ * Inspects the class prototype to find all method names and ensures they match
9905
+ * the VALID_METHOD_NAMES list. Private methods (starting with _ or #) are skipped.
9906
+ * Private fields with # are not visible via Object.getOwnPropertyNames() and don't
9907
+ * need validation as they're truly private and inaccessible.
9908
+ *
9909
+ * @param actionName - Name of the action being validated
9910
+ * @param handler - Class constructor for the action handler
9911
+ * @param self - ActionSchemaService instance for logging
9912
+ * @throws Error if any public method is not in VALID_METHOD_NAMES
9913
+ */
9914
+ const VALIDATE_CLASS_METHODS = (actionName, handler, self) => {
9915
+ // Get all method names from prototype (for classes)
9916
+ // Note: Private fields with # are not visible via Object.getOwnPropertyNames()
9917
+ // and don't need validation as they're truly private and inaccessible
9918
+ const prototypeProps = Object.getOwnPropertyNames(handler.prototype);
9919
+ for (const methodName of prototypeProps) {
9920
+ // Skip constructor and conventionally private methods (starting with _)
9921
+ if (methodName === "constructor" || methodName.startsWith("_")) {
9922
+ continue;
9923
+ }
9924
+ const descriptor = Object.getOwnPropertyDescriptor(handler.prototype, methodName);
9925
+ const isMethod = descriptor && typeof descriptor.value === "function";
9926
+ if (isMethod && !VALID_METHOD_NAMES.includes(methodName)) {
9927
+ const msg = str.newline(`ActionSchema ${actionName} contains invalid method "${methodName}". `, `Valid methods are: ${VALID_METHOD_NAMES.join(", ")}`, `If you want to keep this property name use one of these patterns: _${methodName} or #${methodName}`);
9928
+ self.loggerService.log(`actionValidationService exception thrown`, {
9929
+ msg,
9930
+ });
9931
+ throw new Error(msg);
9932
+ }
9933
+ }
9934
+ };
9935
+ /**
9936
+ * Validates that all public methods in an object-based action handler are in the allowed list.
9937
+ *
9938
+ * Inspects the object's own properties to find all method names and ensures they match
9939
+ * the VALID_METHOD_NAMES list. Private properties (starting with _) are skipped.
9940
+ *
9941
+ * @param actionName - Name of the action being validated
9942
+ * @param handler - Plain object implementing partial IPublicAction interface
9943
+ * @param self - ActionSchemaService instance for logging
9944
+ * @throws Error if any public method is not in VALID_METHOD_NAMES
9945
+ */
9946
+ const VALIDATE_OBJECT_METHODS = (actionName, handler, self) => {
9947
+ // For plain objects (Partial<IPublicAction>)
9948
+ const methodNames = Object.keys(handler);
9949
+ for (const methodName of methodNames) {
9950
+ // Skip private properties (starting with _)
9951
+ if (methodName.startsWith("_")) {
9952
+ continue;
9953
+ }
9954
+ if (typeof handler[methodName] === "function" &&
9955
+ !VALID_METHOD_NAMES.includes(methodName)) {
9956
+ const msg = str.newline(`ActionSchema ${actionName} contains invalid method "${methodName}". `, `Valid methods are: ${VALID_METHOD_NAMES.join(", ")}`, `If you want to keep this property name use one of these patterns: _${methodName} or #${methodName}`);
9957
+ self.loggerService.log(`actionValidationService exception thrown`, {
9958
+ msg,
9959
+ });
9960
+ throw new Error(msg);
9961
+ }
9962
+ }
9963
+ };
9879
9964
  /**
9880
9965
  * Service for managing action schema registry.
9881
9966
  *
9967
+ * Manages registration, validation and retrieval of action schemas.
9882
9968
  * Uses ToolRegistry from functools-kit for type-safe schema storage.
9883
- * Action handlers are registered via addAction() and retrieved by name.
9969
+ * Validates that action handlers only contain allowed public methods
9970
+ * from the IPublicAction interface.
9971
+ *
9972
+ * Key features:
9973
+ * - Type-safe action schema registration
9974
+ * - Method name validation for class and object handlers
9975
+ * - Private method support (methods starting with _ or #)
9976
+ * - Schema override capabilities
9977
+ *
9978
+ * @example
9979
+ * ```typescript
9980
+ * // Register a class-based action
9981
+ * actionSchemaService.register("telegram-notifier", {
9982
+ * actionName: "telegram-notifier",
9983
+ * handler: TelegramNotifierAction,
9984
+ * callbacks: { ... }
9985
+ * });
9986
+ *
9987
+ * // Register an object-based action
9988
+ * actionSchemaService.register("logger", {
9989
+ * actionName: "logger",
9990
+ * handler: {
9991
+ * signal: async (event) => { ... },
9992
+ * dispose: async () => { ... }
9993
+ * }
9994
+ * });
9995
+ * ```
9884
9996
  */
9885
9997
  class ActionSchemaService {
9886
9998
  constructor() {
@@ -9889,9 +10001,13 @@ class ActionSchemaService {
9889
10001
  /**
9890
10002
  * Registers a new action schema.
9891
10003
  *
9892
- * @param key - Unique action name
9893
- * @param value - Action schema configuration
9894
- * @throws Error if action name already exists
10004
+ * Validates the schema structure and method names before registration.
10005
+ * Throws an error if the action name already exists in the registry.
10006
+ *
10007
+ * @param key - Unique action name identifier
10008
+ * @param value - Action schema configuration with handler and optional callbacks
10009
+ * @throws Error if action name already exists in registry
10010
+ * @throws Error if validation fails (missing required fields, invalid handler, invalid method names)
9895
10011
  */
9896
10012
  this.register = (key, value) => {
9897
10013
  this.loggerService.log(`actionSchemaService register`, { key });
@@ -9903,11 +10019,13 @@ class ActionSchemaService {
9903
10019
  *
9904
10020
  * Performs shallow validation to ensure all required properties exist
9905
10021
  * and have correct types before registration in the registry.
10022
+ * Also validates that all public methods in the handler are allowed.
9906
10023
  *
9907
10024
  * @param actionSchema - Action schema to validate
9908
10025
  * @throws Error if actionName is missing or not a string
9909
- * @throws Error if handler is missing or not a function
9910
- * @throws Error if callbacks is not an object
10026
+ * @throws Error if handler is not a function or plain object
10027
+ * @throws Error if handler contains invalid public method names
10028
+ * @throws Error if callbacks is provided but not an object
9911
10029
  */
9912
10030
  this.validateShallow = (actionSchema) => {
9913
10031
  this.loggerService.log(`actionSchemaService validateShallow`, {
@@ -9916,21 +10034,30 @@ class ActionSchemaService {
9916
10034
  if (typeof actionSchema.actionName !== "string") {
9917
10035
  throw new Error(`action schema validation failed: missing actionName`);
9918
10036
  }
9919
- if (typeof actionSchema.handler !== "function" && !isObject(actionSchema.handler)) {
10037
+ if (typeof actionSchema.handler !== "function" &&
10038
+ !isObject(actionSchema.handler)) {
9920
10039
  throw new Error(`action schema validation failed: handler is not a function or plain object for actionName=${actionSchema.actionName}`);
9921
10040
  }
9922
- if (actionSchema.callbacks &&
9923
- !isObject(actionSchema.callbacks)) {
10041
+ if (typeof actionSchema.handler === "function" && actionSchema.handler.prototype) {
10042
+ VALIDATE_CLASS_METHODS(actionSchema.actionName, actionSchema.handler, this);
10043
+ }
10044
+ if (typeof actionSchema.handler === "object" && actionSchema.handler !== null) {
10045
+ VALIDATE_OBJECT_METHODS(actionSchema.actionName, actionSchema.handler, this);
10046
+ }
10047
+ if (actionSchema.callbacks && !isObject(actionSchema.callbacks)) {
9924
10048
  throw new Error(`action schema validation failed: callbacks is not an object for actionName=${actionSchema.actionName}`);
9925
10049
  }
9926
10050
  };
9927
10051
  /**
9928
10052
  * Overrides an existing action schema with partial updates.
9929
10053
  *
10054
+ * Merges provided partial schema updates with the existing schema.
10055
+ * Useful for modifying handler or callbacks without re-registering the entire schema.
10056
+ *
9930
10057
  * @param key - Action name to override
9931
- * @param value - Partial schema updates
9932
- * @returns Updated action schema
9933
- * @throws Error if action name doesn't exist
10058
+ * @param value - Partial schema updates to merge
10059
+ * @returns Updated action schema after override
10060
+ * @throws Error if action name doesn't exist in registry
9934
10061
  */
9935
10062
  this.override = (key, value) => {
9936
10063
  this.loggerService.log(`actionSchemaService override`, { key });
@@ -9940,9 +10067,12 @@ class ActionSchemaService {
9940
10067
  /**
9941
10068
  * Retrieves an action schema by name.
9942
10069
  *
9943
- * @param key - Action name
10070
+ * Returns the complete action schema configuration including handler and callbacks.
10071
+ * Used internally by ActionConnectionService to instantiate ClientAction instances.
10072
+ *
10073
+ * @param key - Action name identifier
9944
10074
  * @returns Action schema configuration
9945
- * @throws Error if action name doesn't exist
10075
+ * @throws Error if action name doesn't exist in registry
9946
10076
  */
9947
10077
  this.get = (key) => {
9948
10078
  this.loggerService.log(`actionSchemaService get`, { key });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backtest-kit",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "A TypeScript library for trading system backtest",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -16569,8 +16569,35 @@ declare class RiskSchemaService {
16569
16569
  /**
16570
16570
  * Service for managing action schema registry.
16571
16571
  *
16572
+ * Manages registration, validation and retrieval of action schemas.
16572
16573
  * Uses ToolRegistry from functools-kit for type-safe schema storage.
16573
- * Action handlers are registered via addAction() and retrieved by name.
16574
+ * Validates that action handlers only contain allowed public methods
16575
+ * from the IPublicAction interface.
16576
+ *
16577
+ * Key features:
16578
+ * - Type-safe action schema registration
16579
+ * - Method name validation for class and object handlers
16580
+ * - Private method support (methods starting with _ or #)
16581
+ * - Schema override capabilities
16582
+ *
16583
+ * @example
16584
+ * ```typescript
16585
+ * // Register a class-based action
16586
+ * actionSchemaService.register("telegram-notifier", {
16587
+ * actionName: "telegram-notifier",
16588
+ * handler: TelegramNotifierAction,
16589
+ * callbacks: { ... }
16590
+ * });
16591
+ *
16592
+ * // Register an object-based action
16593
+ * actionSchemaService.register("logger", {
16594
+ * actionName: "logger",
16595
+ * handler: {
16596
+ * signal: async (event) => { ... },
16597
+ * dispose: async () => { ... }
16598
+ * }
16599
+ * });
16600
+ * ```
16574
16601
  */
16575
16602
  declare class ActionSchemaService {
16576
16603
  readonly loggerService: LoggerService;
@@ -16578,9 +16605,13 @@ declare class ActionSchemaService {
16578
16605
  /**
16579
16606
  * Registers a new action schema.
16580
16607
  *
16581
- * @param key - Unique action name
16582
- * @param value - Action schema configuration
16583
- * @throws Error if action name already exists
16608
+ * Validates the schema structure and method names before registration.
16609
+ * Throws an error if the action name already exists in the registry.
16610
+ *
16611
+ * @param key - Unique action name identifier
16612
+ * @param value - Action schema configuration with handler and optional callbacks
16613
+ * @throws Error if action name already exists in registry
16614
+ * @throws Error if validation fails (missing required fields, invalid handler, invalid method names)
16584
16615
  */
16585
16616
  register: (key: ActionName, value: IActionSchema) => void;
16586
16617
  /**
@@ -16588,28 +16619,36 @@ declare class ActionSchemaService {
16588
16619
  *
16589
16620
  * Performs shallow validation to ensure all required properties exist
16590
16621
  * and have correct types before registration in the registry.
16622
+ * Also validates that all public methods in the handler are allowed.
16591
16623
  *
16592
16624
  * @param actionSchema - Action schema to validate
16593
16625
  * @throws Error if actionName is missing or not a string
16594
- * @throws Error if handler is missing or not a function
16595
- * @throws Error if callbacks is not an object
16626
+ * @throws Error if handler is not a function or plain object
16627
+ * @throws Error if handler contains invalid public method names
16628
+ * @throws Error if callbacks is provided but not an object
16596
16629
  */
16597
16630
  private validateShallow;
16598
16631
  /**
16599
16632
  * Overrides an existing action schema with partial updates.
16600
16633
  *
16634
+ * Merges provided partial schema updates with the existing schema.
16635
+ * Useful for modifying handler or callbacks without re-registering the entire schema.
16636
+ *
16601
16637
  * @param key - Action name to override
16602
- * @param value - Partial schema updates
16603
- * @returns Updated action schema
16604
- * @throws Error if action name doesn't exist
16638
+ * @param value - Partial schema updates to merge
16639
+ * @returns Updated action schema after override
16640
+ * @throws Error if action name doesn't exist in registry
16605
16641
  */
16606
16642
  override: (key: ActionName, value: Partial<IActionSchema>) => IActionSchema;
16607
16643
  /**
16608
16644
  * Retrieves an action schema by name.
16609
16645
  *
16610
- * @param key - Action name
16646
+ * Returns the complete action schema configuration including handler and callbacks.
16647
+ * Used internally by ActionConnectionService to instantiate ClientAction instances.
16648
+ *
16649
+ * @param key - Action name identifier
16611
16650
  * @returns Action schema configuration
16612
- * @throws Error if action name doesn't exist
16651
+ * @throws Error if action name doesn't exist in registry
16613
16652
  */
16614
16653
  get: (key: ActionName) => IActionSchema;
16615
16654
  }