@plyaz/core 1.13.4 → 1.14.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/dist/index.js CHANGED
@@ -49951,7 +49951,8 @@ var BackendFilesDomainService = class _BackendFilesDomainService extends BaseBac
49951
49951
  const startTime = Date.now();
49952
49952
  this.logDebug("Persisting uploaded file to DB", {
49953
49953
  fileId: metadata.fileId,
49954
- filename: metadata.filename
49954
+ filename: metadata.filename,
49955
+ storagePath: metadata.path
49955
49956
  });
49956
49957
  try {
49957
49958
  const dbRow = FilesMapper.toDbRow({ metadata, variants }, userId);
@@ -49995,6 +49996,20 @@ var BackendFilesDomainService = class _BackendFilesDomainService extends BaseBac
49995
49996
  // - uploadFile(params) - for POST /files/upload
49996
49997
  // - generateFile(params) - for POST /files/generate-document
49997
49998
  // ─────────────────────────────────────────────────────────────────────────
49999
+ /**
50000
+ * Get file record by storage path
50001
+ * Used to retrieve the DB record after upload (since event handler persists it)
50002
+ */
50003
+ async getByStoragePath(storagePath) {
50004
+ const result2 = await this.repository.findMany({
50005
+ filter: { field: "storage_path", operator: "eq", value: storagePath }
50006
+ });
50007
+ const data = result2.value?.data ?? [];
50008
+ if (result2.success && data.length > 0) {
50009
+ return data[0];
50010
+ }
50011
+ return void 0;
50012
+ }
49998
50013
  };
49999
50014
  var backendFilesDomainService = new BackendFilesDomainService();
50000
50015
  var _instance = null;