@plyaz/core 1.9.7 → 1.10.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.
@@ -34,8 +34,13 @@ import { FilesMapperClass } from './mappers/FilesMapper';
34
34
  */
35
35
  export declare class FrontendFilesDomainService extends BaseFrontendDomainService<FilesFrontendServiceConfig, FilesFrontendStoreSlice, FilesFrontendStoreData, FilesEntity, GetFileResponse, FilesCreateInput, Partial<FilesCreateInput>, Record<string, unknown>, FilesStoreItem, InstanceType<typeof FilesMapperClass>, CoreBaseValidatorInstance, void> {
36
36
  static readonly serviceKey = "files-frontend";
37
+ /**
38
+ * Primary store key for this service.
39
+ * Used by ServiceRegistry to auto-inject the store.
40
+ * Must be static for base class constructor to access.
41
+ */
42
+ static readonly primaryStoreKey: "files";
37
43
  protected eventPrefix: string;
38
- protected primaryStoreKey: "files";
39
44
  static create(config?: FilesFrontendServiceConfig, options?: CoreServiceCreateOptions): Promise<FrontendFilesDomainService>;
40
45
  constructor(config?: FilesFrontendServiceConfig, options?: CoreServiceCreateOptions);
41
46
  isAvailable(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"FrontendFilesDomainService.d.ts","sourceRoot":"","sources":["../../../src/domain/files/FrontendFilesDomainService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,WAAW,EACX,0BAA0B,EAC1B,gBAAgB,EAGjB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,cAAc,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,S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CtF;;;OAGG;IACH,SAAS,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAE1E;;;OAGG;IACH,SAAS,CAAC,iBAAiB,CAAC,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;CAC1E;AAQD,wBAAsB,6BAA6B,CACjD,MAAM,CAAC,EAAE,0BAA0B,EACnC,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,0BAA0B,CAAC,CAGrC;AAED,wBAAgB,yBAAyB,IAAI,IAAI,CAKhD"}
1
+ {"version":3,"file":"FrontendFilesDomainService.d.ts","sourceRoot":"","sources":["../../../src/domain/files/FrontendFilesDomainService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,WAAW,EACX,0BAA0B,EAC1B,gBAAgB,EAGjB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,cAAc,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAe,MAAM,uBAAuB,CAAC;AAUtE;;;;;;;;;;;;;GAaG;AACH,qBAAa,0BAA2B,SAAQ,yBAAyB,CACvE,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,OAAO,CAAC,gBAAgB,CAAC,EACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvB,cAAc,EACd,YAAY,CAAC,OAAO,gBAAgB,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wB,GACjC,OAAO,CAAC,0BAA0B,CAAC,CAGrC;AAED,wBAAgB,yBAAyB,IAAI,IAAI,CAKhD"}
@@ -2273,10 +2273,10 @@ var init_ServiceRegistry = __esm({
2273
2273
  const dedicatedDb = config.dedicatedDb;
2274
2274
  const isDedicated = dedicatedDb === true || typeof dedicatedDb === "object";
2275
2275
  const serviceKey = entry.service.serviceKey;
2276
- const isBackendRuntime = types.BACKEND_RUNTIMES.includes(_ServiceRegistry._runtime);
2276
+ const isBackendRuntime = types.BACKEND_RUNTIMES.includes(_ServiceRegistry._runtime) || types.UNIVERSAL_RUNTIMES.includes(_ServiceRegistry._runtime);
2277
2277
  if ((isDedicated || _ServiceRegistry._dbConfig) && !isBackendRuntime) {
2278
2278
  _ServiceRegistry.logger.warn(
2279
- `Service '${serviceKey}' is requesting database injection in '${_ServiceRegistry._runtime}' runtime. Database is only available in backend runtimes (${types.BACKEND_RUNTIMES.join(", ")}). This service will not have database access.`
2279
+ `Service '${serviceKey}' is requesting database injection in '${_ServiceRegistry._runtime}' runtime. Database is only available in backend runtimes (${types.BACKEND_RUNTIMES.join(", ")}) or universal runtimes (${types.UNIVERSAL_RUNTIMES.join(", ")}). This service will not have database access.`
2280
2280
  );
2281
2281
  return void 0;
2282
2282
  }
@@ -2389,10 +2389,10 @@ var init_ServiceRegistry = __esm({
2389
2389
  const dedicatedStorage = config.dedicatedStorage;
2390
2390
  const isDedicated = dedicatedStorage === true || typeof dedicatedStorage === "object";
2391
2391
  const serviceKey = entry.service.serviceKey;
2392
- const isBackendRuntime = types.BACKEND_RUNTIMES.includes(_ServiceRegistry._runtime);
2392
+ const isBackendRuntime = types.BACKEND_RUNTIMES.includes(_ServiceRegistry._runtime) || types.UNIVERSAL_RUNTIMES.includes(_ServiceRegistry._runtime);
2393
2393
  if ((isDedicated || _ServiceRegistry._storageConfig) && !isBackendRuntime) {
2394
2394
  _ServiceRegistry.logger.warn(
2395
- `Service '${serviceKey}' is requesting storage injection in '${_ServiceRegistry._runtime}' runtime. Storage is only available in backend runtimes (${types.BACKEND_RUNTIMES.join(", ")}). This service will not have storage access.`
2395
+ `Service '${serviceKey}' is requesting storage injection in '${_ServiceRegistry._runtime}' runtime. Storage is only available in backend runtimes (${types.BACKEND_RUNTIMES.join(", ")}) or universal runtimes (${types.UNIVERSAL_RUNTIMES.join(", ")}). This service will not have storage access.`
2396
2396
  );
2397
2397
  return void 0;
2398
2398
  }
@@ -2441,10 +2441,10 @@ var init_ServiceRegistry = __esm({
2441
2441
  const dedicatedNotifications = config.dedicatedNotifications;
2442
2442
  const isDedicated = dedicatedNotifications === true || typeof dedicatedNotifications === "object";
2443
2443
  const serviceKey = entry.service.serviceKey;
2444
- const isBackendRuntime = types.BACKEND_RUNTIMES.includes(_ServiceRegistry._runtime);
2444
+ const isBackendRuntime = types.BACKEND_RUNTIMES.includes(_ServiceRegistry._runtime) || types.UNIVERSAL_RUNTIMES.includes(_ServiceRegistry._runtime);
2445
2445
  if ((isDedicated || _ServiceRegistry._notificationsConfig) && !isBackendRuntime) {
2446
2446
  _ServiceRegistry.logger.warn(
2447
- `Service '${serviceKey}' is requesting notifications injection in '${_ServiceRegistry._runtime}' runtime. Notifications is only available in backend runtimes (${types.BACKEND_RUNTIMES.join(", ")}). This service will not have notifications access.`
2447
+ `Service '${serviceKey}' is requesting notifications injection in '${_ServiceRegistry._runtime}' runtime. Notifications is only available in backend runtimes (${types.BACKEND_RUNTIMES.join(", ")}) or universal runtimes (${types.UNIVERSAL_RUNTIMES.join(", ")}). This service will not have notifications access.`
2448
2448
  );
2449
2449
  return void 0;
2450
2450
  }
@@ -9250,11 +9250,13 @@ var init_FrontendFilesDomainService = __esm({
9250
9250
  logger4 = new logger$1.PackageLogger({ packageName: "core", service: "FrontendFilesDomainService" });
9251
9251
  FrontendFilesDomainService = class _FrontendFilesDomainService extends BaseFrontendDomainService {
9252
9252
  constructor(config = {}, options) {
9253
+ const apiBasePath = config.apiBasePath || "/api";
9253
9254
  super({
9254
9255
  serviceName: "FrontendFilesDomainService",
9255
9256
  supportedRuntimes: ["frontend"],
9256
9257
  serviceConfig: {
9257
9258
  enabled: true,
9259
+ apiBasePath,
9258
9260
  responseDataKey: "data",
9259
9261
  ...config,
9260
9262
  // Configure fetchers for CRUD operations
@@ -9288,7 +9290,6 @@ var init_FrontendFilesDomainService = __esm({
9288
9290
  injected: options?.injected
9289
9291
  });
9290
9292
  this.eventPrefix = "files";
9291
- this.primaryStoreKey = store.STORE_KEYS.FILES;
9292
9293
  }
9293
9294
  static {
9294
9295
  __name(this, "FrontendFilesDomainService");
@@ -9296,9 +9297,25 @@ var init_FrontendFilesDomainService = __esm({
9296
9297
  static {
9297
9298
  this.serviceKey = "files-frontend";
9298
9299
  }
9300
+ static {
9301
+ /**
9302
+ * Primary store key for this service.
9303
+ * Used by ServiceRegistry to auto-inject the store.
9304
+ * Must be static for base class constructor to access.
9305
+ */
9306
+ this.primaryStoreKey = store.STORE_KEYS.FILES;
9307
+ }
9299
9308
  static async create(config = {}, options) {
9300
9309
  this.registerEventHandlers();
9301
- return new _FrontendFilesDomainService(config, options);
9310
+ const mergedConfig = {
9311
+ ...config,
9312
+ // Use || instead of ?? because api.baseURL may be '' (empty string) for same-origin requests.
9313
+ // The ?? operator only falls through on null/undefined, not empty strings.
9314
+ // An empty string is not a valid API path, so we treat it as "not provided" and fall through to default.
9315
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
9316
+ apiBasePath: config.apiBasePath || options?.apiClient?.options?.baseURL || "/api"
9317
+ };
9318
+ return new _FrontendFilesDomainService(mergedConfig, options);
9302
9319
  }
9303
9320
  isAvailable() {
9304
9321
  return this.isServiceEnabled && typeof window !== "undefined";