@plyaz/core 1.8.0 → 1.8.2

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.
@@ -169,7 +169,7 @@ function getConfigForEnvironment(env) {
169
169
  }
170
170
  __name(getConfigForEnvironment, "getConfigForEnvironment");
171
171
  function validateBaseURL(mergedConfig, errors) {
172
- if (!mergedConfig.baseURL) {
172
+ if (mergedConfig.baseURL === void 0 || mergedConfig.baseURL === null) {
173
173
  errors.push("baseURL is required in API configuration (apiConfig parameter)");
174
174
  }
175
175
  }
@@ -2002,10 +2002,16 @@ var ServiceRegistry = class _ServiceRegistry {
2002
2002
  return initPromise;
2003
2003
  }
2004
2004
  /** Build stores for service injection */
2005
- static buildStoresForService(config) {
2005
+ // eslint-disable-next-line complexity
2006
+ static buildStoresForService(config, entry) {
2006
2007
  const allKeys = /* @__PURE__ */ new Set();
2007
2008
  if (config.store) {
2008
2009
  allKeys.add(config.store);
2010
+ } else if ("primaryStoreKey" in entry.service && typeof entry.service.primaryStoreKey === "string") {
2011
+ allKeys.add(entry.service.primaryStoreKey);
2012
+ _ServiceRegistry.logger.debug(
2013
+ `Auto-resolved store key '${entry.service.primaryStoreKey}' from service class`
2014
+ );
2009
2015
  }
2010
2016
  if (config.readStores) {
2011
2017
  config.readStores.forEach((key) => allKeys.add(key));
@@ -2043,7 +2049,7 @@ var ServiceRegistry = class _ServiceRegistry {
2043
2049
  const observability = _ServiceRegistry.buildObservabilityConfig(config, entry);
2044
2050
  const storage = await _ServiceRegistry.buildStorageConfig(config, entry);
2045
2051
  const notifications = await _ServiceRegistry.buildNotificationsConfig(config, entry);
2046
- const stores = _ServiceRegistry.buildStoresForService(config);
2052
+ const stores = _ServiceRegistry.buildStoresForService(config, entry);
2047
2053
  let observabilityInstance = observability?.instance;
2048
2054
  if (observability?.dedicated && observability.config) {
2049
2055
  observabilityInstance = await _ServiceRegistry.createDedicatedObservability(