@vived/host 4.11.2 → 4.12.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.
Files changed (37) hide show
  1. package/dist/cjs/Apps/Factories/AppsFeatureFactory.js +2 -3
  2. package/dist/cjs/Apps/Factories/AppsFeatureFactory.js.map +1 -1
  3. package/dist/cjs/Assets/Controllers/fetchAssetFile.js +42 -0
  4. package/dist/cjs/Assets/Controllers/fetchAssetFile.js.map +1 -0
  5. package/dist/cjs/Assets/Controllers/index.js +1 -0
  6. package/dist/cjs/Assets/Controllers/index.js.map +1 -1
  7. package/dist/cjs/Assets/Factories/AssetsFactory.js +8 -19
  8. package/dist/cjs/Assets/Factories/AssetsFactory.js.map +1 -1
  9. package/dist/cjs/Cache/Factories/CacheFeatureFactory.js +51 -0
  10. package/dist/cjs/Cache/Factories/CacheFeatureFactory.js.map +1 -0
  11. package/dist/cjs/Cache/Factories/index.js +1 -0
  12. package/dist/cjs/Cache/Factories/index.js.map +1 -1
  13. package/dist/esm/Apps/Factories/AppsFeatureFactory.js +2 -3
  14. package/dist/esm/Apps/Factories/AppsFeatureFactory.js.map +1 -1
  15. package/dist/esm/Assets/Controllers/fetchAssetFile.js +39 -0
  16. package/dist/esm/Assets/Controllers/fetchAssetFile.js.map +1 -0
  17. package/dist/esm/Assets/Controllers/index.js +1 -0
  18. package/dist/esm/Assets/Controllers/index.js.map +1 -1
  19. package/dist/esm/Assets/Factories/AssetsFactory.js +11 -22
  20. package/dist/esm/Assets/Factories/AssetsFactory.js.map +1 -1
  21. package/dist/esm/Cache/Factories/CacheFeatureFactory.js +47 -0
  22. package/dist/esm/Cache/Factories/CacheFeatureFactory.js.map +1 -0
  23. package/dist/esm/Cache/Factories/index.js +1 -0
  24. package/dist/esm/Cache/Factories/index.js.map +1 -1
  25. package/dist/types/Apps/Factories/AppsFeatureFactory.d.ts +0 -1
  26. package/dist/types/Apps/Factories/AppsFeatureFactory.d.ts.map +1 -1
  27. package/dist/types/Assets/Controllers/fetchAssetFile.d.ts +32 -0
  28. package/dist/types/Assets/Controllers/fetchAssetFile.d.ts.map +1 -0
  29. package/dist/types/Assets/Controllers/index.d.ts +1 -0
  30. package/dist/types/Assets/Controllers/index.d.ts.map +1 -1
  31. package/dist/types/Assets/Factories/AssetsFactory.d.ts +0 -3
  32. package/dist/types/Assets/Factories/AssetsFactory.d.ts.map +1 -1
  33. package/dist/types/Cache/Factories/CacheFeatureFactory.d.ts +27 -0
  34. package/dist/types/Cache/Factories/CacheFeatureFactory.d.ts.map +1 -0
  35. package/dist/types/Cache/Factories/index.d.ts +1 -0
  36. package/dist/types/Cache/Factories/index.d.ts.map +1 -1
  37. package/package.json +1 -1
@@ -19,9 +19,8 @@ class AppsFeatureFactory extends core_1.DomainFactory {
19
19
  * Sets up all entities required for the Apps system
20
20
  */
21
21
  setupEntities() {
22
- this.appRepoAO = this.appObjects.getOrCreate("App Repository");
23
22
  // Initialize entities
24
- (0, Entities_1.makeAppRepo)(this.appRepoAO);
23
+ (0, Entities_1.makeAppRepo)(this.appObject);
25
24
  }
26
25
  /**
27
26
  * Sets up all use cases for the Apps system
@@ -35,7 +34,7 @@ class AppsFeatureFactory extends core_1.DomainFactory {
35
34
  */
36
35
  setupPMs() {
37
36
  // App Repository PMs
38
- (0, PMs_1.makeAppsListPM)(this.appRepoAO);
37
+ (0, PMs_1.makeAppsListPM)(this.appObject);
39
38
  }
40
39
  /**
41
40
  * Performs any final setup operations after all components are initialized
@@ -1 +1 @@
1
- {"version":3,"file":"AppsFeatureFactory.js","sourceRoot":"","sources":["../../../../src/Apps/Factories/AppsFeatureFactory.ts"],"names":[],"mappings":";;;AAAA,sCAAuD;AACvD,0CAAyD;AACzD,gCAAmD;AAEnD;;;;GAIG;AACH,MAAa,kBAAmB,SAAQ,oBAAa;IAOnD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QAPnB,+BAA+B;QACtB,gBAAW,GAAG,oBAAoB,CAAC;IAO5C,CAAC;IAED;;OAEG;IACH,aAAa;QACX,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAE/D,sBAAsB;QACtB,IAAA,sBAAW,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,+DAA+D;QAC/D,0EAA0E;IAC5E,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,qBAAqB;QACrB,IAAA,oBAAc,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,UAAU;QACR,wCAAwC;IAC1C,CAAC;CACF;AA3CD,gDA2CC","sourcesContent":["import { AppObject, DomainFactory } from \"@vived/core\";\r\nimport { makeAppEntity, makeAppRepo } from \"../Entities\";\r\nimport { makeAppPM, makeAppsListPM } from \"../PMs\";\r\n\r\n/**\r\n * Factory responsible for setting up the Apps domain components.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the Apps functionality.\r\n */\r\nexport class AppsFeatureFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"AppsFeatureFactory\";\r\n\r\n // Store references to key AppObjects needed across setup phases\r\n private appRepoAO!: AppObject;\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the Apps system\r\n */\r\n setupEntities(): void {\r\n this.appRepoAO = this.appObjects.getOrCreate(\"App Repository\");\r\n\r\n // Initialize entities\r\n makeAppRepo(this.appRepoAO);\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the Apps system\r\n */\r\n setupUCs(): void {\r\n // Note: App UCs have complex dependencies and should be set up\r\n // separately to avoid circular dependencies during factory initialization\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the Apps system\r\n */\r\n setupPMs(): void {\r\n // App Repository PMs\r\n makeAppsListPM(this.appRepoAO);\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for apps\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"AppsFeatureFactory.js","sourceRoot":"","sources":["../../../../src/Apps/Factories/AppsFeatureFactory.ts"],"names":[],"mappings":";;;AAAA,sCAAuD;AACvD,0CAAyD;AACzD,gCAAmD;AAEnD;;;;GAIG;AACH,MAAa,kBAAmB,SAAQ,oBAAa;IAInD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJnB,+BAA+B;QACtB,gBAAW,GAAG,oBAAoB,CAAC;IAI5C,CAAC;IAED;;OAEG;IACH,aAAa;QACX,sBAAsB;QACtB,IAAA,sBAAW,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,+DAA+D;QAC/D,0EAA0E;IAC5E,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,qBAAqB;QACrB,IAAA,oBAAc,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,UAAU;QACR,wCAAwC;IAC1C,CAAC;CACF;AAtCD,gDAsCC","sourcesContent":["import { AppObject, DomainFactory } from \"@vived/core\";\r\nimport { makeAppEntity, makeAppRepo } from \"../Entities\";\r\nimport { makeAppPM, makeAppsListPM } from \"../PMs\";\r\n\r\n/**\r\n * Factory responsible for setting up the Apps domain components.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the Apps functionality.\r\n */\r\nexport class AppsFeatureFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"AppsFeatureFactory\";\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the Apps system\r\n */\r\n setupEntities(): void {\r\n // Initialize entities\r\n makeAppRepo(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the Apps system\r\n */\r\n setupUCs(): void {\r\n // Note: App UCs have complex dependencies and should be set up\r\n // separately to avoid circular dependencies during factory initialization\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the Apps system\r\n */\r\n setupPMs(): void {\r\n // App Repository PMs\r\n makeAppsListPM(this.appObject);\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for apps\r\n }\r\n}\r\n"]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ /**
3
+ * fetchAssetFile.ts
4
+ *
5
+ * This controller function retrieves an asset file as a File object,
6
+ * handling caching and error management for file access operations.
7
+ *
8
+ * Key Concepts:
9
+ * - Retrieves asset files as File objects for download or processing
10
+ * - Uses GetAssetFileUC to handle caching and file retrieval logic
11
+ * - Provides error handling for missing components
12
+ * - Coordinates with asset file management workflows
13
+ *
14
+ * Usage Patterns:
15
+ * - Called from UI components when users need asset file access
16
+ * - Used in asset management workflows for file processing
17
+ * - Integrated with download and preview functionality
18
+ */
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.fetchAssetFile = fetchAssetFile;
21
+ const GetAssetFileUC_1 = require("../UCs/GetAssetFileUC");
22
+ /**
23
+ * Retrieves an asset file as a File object.
24
+ *
25
+ * This function provides a controller-level interface for asset file retrieval.
26
+ * It handles the complete file access workflow including caching optimization,
27
+ * error handling, and returns a File object ready for use in web applications.
28
+ *
29
+ * @param assetID - The unique identifier of the asset whose file should be retrieved
30
+ * @param appObjects - Repository for accessing asset-related app objects and components
31
+ * @returns Promise<File> - A promise that resolves to the File object for the asset,
32
+ * or undefined if the operation cannot be completed
33
+ */
34
+ function fetchAssetFile(assetID, appObjects) {
35
+ const uc = GetAssetFileUC_1.GetAssetFileUC.get(appObjects);
36
+ if (!uc) {
37
+ appObjects.submitWarning("fetchAssetFile", "Unable to find GetAssetFileUC");
38
+ return;
39
+ }
40
+ return uc.getAssetFile(assetID);
41
+ }
42
+ //# sourceMappingURL=fetchAssetFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchAssetFile.js","sourceRoot":"","sources":["../../../../src/Assets/Controllers/fetchAssetFile.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;AAiBH,wCAWC;AAzBD,0DAAuD;AAEvD;;;;;;;;;;;GAWG;AACH,SAAgB,cAAc,CAC5B,OAAe,EACf,UAAyB;IAEzB,MAAM,EAAE,GAAG,+BAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC1C,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,UAAU,CAAC,aAAa,CAAC,gBAAgB,EAAE,+BAA+B,CAAC,CAAC;QAC5E,OAAO;IACT,CAAC;IAED,OAAO,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC","sourcesContent":["/**\r\n * fetchAssetFile.ts\r\n *\r\n * This controller function retrieves an asset file as a File object,\r\n * handling caching and error management for file access operations.\r\n *\r\n * Key Concepts:\r\n * - Retrieves asset files as File objects for download or processing\r\n * - Uses GetAssetFileUC to handle caching and file retrieval logic\r\n * - Provides error handling for missing components\r\n * - Coordinates with asset file management workflows\r\n *\r\n * Usage Patterns:\r\n * - Called from UI components when users need asset file access\r\n * - Used in asset management workflows for file processing\r\n * - Integrated with download and preview functionality\r\n */\r\n\r\nimport { AppObjectRepo } from \"@vived/core\";\r\nimport { GetAssetFileUC } from \"../UCs/GetAssetFileUC\";\r\n\r\n/**\r\n * Retrieves an asset file as a File object.\r\n *\r\n * This function provides a controller-level interface for asset file retrieval.\r\n * It handles the complete file access workflow including caching optimization,\r\n * error handling, and returns a File object ready for use in web applications.\r\n *\r\n * @param assetID - The unique identifier of the asset whose file should be retrieved\r\n * @param appObjects - Repository for accessing asset-related app objects and components\r\n * @returns Promise<File> - A promise that resolves to the File object for the asset,\r\n * or undefined if the operation cannot be completed\r\n */\r\nexport function fetchAssetFile(\r\n assetID: string,\r\n appObjects: AppObjectRepo\r\n): Promise<File> | undefined {\r\n const uc = GetAssetFileUC.get(appObjects);\r\n if (!uc) {\r\n appObjects.submitWarning(\"fetchAssetFile\", \"Unable to find GetAssetFileUC\");\r\n return;\r\n }\r\n\r\n return uc.getAssetFile(assetID);\r\n}\r\n"]}
@@ -37,6 +37,7 @@ __exportStar(require("./archiveAsset"), exports);
37
37
  __exportStar(require("./deleteAsset"), exports);
38
38
  __exportStar(require("./downloadAssetFile"), exports);
39
39
  __exportStar(require("./editAppAsset"), exports);
40
+ __exportStar(require("./fetchAssetFile"), exports);
40
41
  __exportStar(require("./getAppAssets"), exports);
41
42
  __exportStar(require("./newAppAsset"), exports);
42
43
  __exportStar(require("./toggleShowArchivedAssets"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Assets/Controllers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;AAEH,iDAA+B;AAC/B,gDAA8B;AAC9B,sDAAoC;AACpC,iDAA+B;AAC/B,iDAA+B;AAC/B,gDAA8B;AAC9B,6DAA2C;AAC3C,uDAAqC;AACrC,oDAAkC","sourcesContent":["/**\r\n * Assets Controllers Index\r\n *\r\n * This module exports all controller functions for the Assets feature.\r\n * Controllers provide simple, stateless functions that serve as entry points\r\n * for asset-related operations from UI components and external systems.\r\n *\r\n * Key Concepts:\r\n * - Controllers act as the interface layer between UI components and business logic\r\n * - Each controller function handles a specific asset operation\r\n * - Controllers delegate to Use Cases (UCs) for actual business logic implementation\r\n * - Error handling and validation are performed at the controller level\r\n *\r\n * Available Operations:\r\n * - Asset lifecycle: create, edit, delete, archive\r\n * - File management: upload, download, update\r\n * - Collection management: get app assets, toggle archived visibility\r\n * - Metadata management: update asset information\r\n */\r\n\r\nexport * from \"./archiveAsset\";\r\nexport * from \"./deleteAsset\";\r\nexport * from \"./downloadAssetFile\";\r\nexport * from \"./editAppAsset\";\r\nexport * from \"./getAppAssets\";\r\nexport * from \"./newAppAsset\";\r\nexport * from \"./toggleShowArchivedAssets\";\r\nexport * from \"./updateAppAssetMeta\";\r\nexport * from \"./updateAssetFile\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Assets/Controllers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;AAEH,iDAA+B;AAC/B,gDAA8B;AAC9B,sDAAoC;AACpC,iDAA+B;AAC/B,mDAAiC;AACjC,iDAA+B;AAC/B,gDAA8B;AAC9B,6DAA2C;AAC3C,uDAAqC;AACrC,oDAAkC","sourcesContent":["/**\r\n * Assets Controllers Index\r\n *\r\n * This module exports all controller functions for the Assets feature.\r\n * Controllers provide simple, stateless functions that serve as entry points\r\n * for asset-related operations from UI components and external systems.\r\n *\r\n * Key Concepts:\r\n * - Controllers act as the interface layer between UI components and business logic\r\n * - Each controller function handles a specific asset operation\r\n * - Controllers delegate to Use Cases (UCs) for actual business logic implementation\r\n * - Error handling and validation are performed at the controller level\r\n *\r\n * Available Operations:\r\n * - Asset lifecycle: create, edit, delete, archive\r\n * - File management: upload, download, update\r\n * - Collection management: get app assets, toggle archived visibility\r\n * - Metadata management: update asset information\r\n */\r\n\r\nexport * from \"./archiveAsset\";\r\nexport * from \"./deleteAsset\";\r\nexport * from \"./downloadAssetFile\";\r\nexport * from \"./editAppAsset\";\r\nexport * from \"./fetchAssetFile\";\r\nexport * from \"./getAppAssets\";\r\nexport * from \"./newAppAsset\";\r\nexport * from \"./toggleShowArchivedAssets\";\r\nexport * from \"./updateAppAssetMeta\";\r\nexport * from \"./updateAssetFile\";\r\n"]}
@@ -20,12 +20,9 @@ class AssetsFactory extends core_1.DomainFactory {
20
20
  * Sets up all entities required for the Assets system
21
21
  */
22
22
  setupEntities() {
23
- this.assetRepoAO = this.appObjects.getOrCreate("Asset Repository");
24
- this.appAssetsAO = this.appObjects.getOrCreate("App Assets");
25
23
  // Initialize entities
26
- this.assetRepo = (0, Entities_1.makeAssetRepo)(this.assetRepoAO);
27
- this.assetRepo.assetFactory = this.makeAssetFactory();
28
- (0, Entities_1.makeAppAssets)(this.appAssetsAO);
24
+ const assetRepo = (0, Entities_1.makeAssetRepo)(this.appObject);
25
+ assetRepo.assetFactory = this.makeAssetFactory();
29
26
  }
30
27
  /**
31
28
  * Creates an asset factory function that properly initializes assets with all required components
@@ -40,7 +37,6 @@ class AssetsFactory extends core_1.DomainFactory {
40
37
  (0, UCs_1.makeDeleteAssetUC)(ao);
41
38
  (0, UCs_1.makeDownloadAssetFileUC)(ao);
42
39
  (0, UCs_1.makeUpdateAssetFileUC)(ao);
43
- (0, UCs_1.makeUpdateAppAssetMetaUC)(ao);
44
40
  // PMs for each asset
45
41
  (0, PMs_1.makeAssetPM)(ao);
46
42
  (0, PMs_1.makeAssetFilePM)(ao);
@@ -52,24 +48,17 @@ class AssetsFactory extends core_1.DomainFactory {
52
48
  */
53
49
  setupUCs() {
54
50
  // Repository UCs
55
- (0, UCs_1.makeEditAppAsset)(this.assetRepoAO);
56
- (0, UCs_1.makeGetAssetBlobURLUC)(this.assetRepoAO);
57
- (0, UCs_1.makeGetAssetFileUC)(this.assetRepoAO);
58
- (0, UCs_1.makeGetAssetUC)(this.assetRepoAO);
59
- (0, UCs_1.makePrefetchAssets)(this.assetRepoAO);
60
- (0, UCs_1.makeNewAssetUC)(this.assetRepoAO);
61
- // App Assets UCs
62
- (0, UCs_1.makeNewAppAssetUC)(this.appAssetsAO);
63
- (0, UCs_1.makeGetAppAssetUC)(this.appAssetsAO);
51
+ (0, UCs_1.makeGetAssetBlobURLUC)(this.appObject);
52
+ (0, UCs_1.makeGetAssetFileUC)(this.appObject);
53
+ (0, UCs_1.makeGetAssetUC)(this.appObject);
54
+ (0, UCs_1.makePrefetchAssets)(this.appObject);
55
+ (0, UCs_1.makeNewAssetUC)(this.appObject);
64
56
  }
65
57
  /**
66
58
  * Sets up all presentation managers for the Assets system
67
59
  */
68
60
  setupPMs() {
69
- // App Assets PMs
70
- (0, PMs_1.makeAppAssetListPM)(this.appAssetsAO);
71
- (0, PMs_1.makeShowArchivedAppAssetPM)(this.appAssetsAO);
72
- (0, PMs_1.makeEditingAppAssetPM)(this.appAssetsAO);
61
+ // No PMs needed for core asset functionality
73
62
  }
74
63
  /**
75
64
  * Performs any final setup operations after all components are initialized
@@ -1 +1 @@
1
- {"version":3,"file":"AssetsFactory.js","sourceRoot":"","sources":["../../../../src/Assets/Factories/AssetsFactory.ts"],"names":[],"mappings":";;;AAAA,sCAAsE;AACtE,0CAKqB;AACrB,gCAMgB;AAChB,gCAcgB;AAEhB;;;;GAIG;AACH,MAAa,aAAc,SAAQ,oBAAa;IAS9C,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QATnB,+BAA+B;QACtB,gBAAW,GAAG,eAAe,CAAC;IASvC,CAAC;IAED;;OAEG;IACH,aAAa;QACX,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;QACnE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAE7D,sBAAsB;QACtB,IAAI,CAAC,SAAS,GAAG,IAAA,wBAAa,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjD,IAAI,CAAC,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtD,IAAA,wBAAa,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACK,gBAAgB;QACtB,OAAO,CAAC,EAAU,EAAe,EAAE;YACjC,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YAE3C,WAAW;YACX,MAAM,MAAM,GAAG,IAAA,0BAAe,EAAC,EAAE,CAAC,CAAC;YAEnC,qBAAqB;YACrB,IAAA,wBAAkB,EAAC,EAAE,CAAC,CAAC;YACvB,IAAA,uBAAiB,EAAC,EAAE,CAAC,CAAC;YACtB,IAAA,6BAAuB,EAAC,EAAE,CAAC,CAAC;YAC5B,IAAA,2BAAqB,EAAC,EAAE,CAAC,CAAC;YAC1B,IAAA,8BAAwB,EAAC,EAAE,CAAC,CAAC;YAE7B,qBAAqB;YACrB,IAAA,iBAAW,EAAC,EAAE,CAAC,CAAC;YAChB,IAAA,qBAAe,EAAC,EAAE,CAAC,CAAC;YAEpB,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,iBAAiB;QACjB,IAAA,sBAAgB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACnC,IAAA,2BAAqB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACxC,IAAA,wBAAkB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrC,IAAA,oBAAc,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjC,IAAA,wBAAkB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrC,IAAA,oBAAc,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEjC,iBAAiB;QACjB,IAAA,uBAAiB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACpC,IAAA,uBAAiB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,iBAAiB;QACjB,IAAA,wBAAkB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrC,IAAA,gCAA0B,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC7C,IAAA,2BAAqB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,UAAU;QACR,0CAA0C;IAC5C,CAAC;CACF;AApFD,sCAoFC","sourcesContent":["import { AppObject, AppObjectRepo, DomainFactory } from \"@vived/core\";\r\nimport {\r\n AssetEntity,\r\n makeAppAssets,\r\n makeAssetEntity,\r\n makeAssetRepo\r\n} from \"../Entities\";\r\nimport {\r\n makeAppAssetListPM,\r\n makeAssetFilePM,\r\n makeAssetPM,\r\n makeEditingAppAssetPM,\r\n makeShowArchivedAppAssetPM\r\n} from \"../PMs\";\r\nimport {\r\n makeArchiveAssetUC,\r\n makeDeleteAssetUC,\r\n makeDownloadAssetFileUC,\r\n makeEditAppAsset,\r\n makeGetAppAssetUC,\r\n makeGetAssetBlobURLUC,\r\n makeGetAssetFileUC,\r\n makeGetAssetUC,\r\n makeNewAppAssetUC,\r\n makeNewAssetUC,\r\n makePrefetchAssets,\r\n makeUpdateAppAssetMetaUC,\r\n makeUpdateAssetFileUC\r\n} from \"../UCs\";\r\n\r\n/**\r\n * Factory responsible for setting up the Assets domain components.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the Assets functionality.\r\n */\r\nexport class AssetsFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"AssetsFactory\";\r\n\r\n // Store references to key AppObjects needed across setup phases\r\n private assetRepoAO!: AppObject;\r\n private appAssetsAO!: AppObject;\r\n private assetRepo: any; // This will hold the asset repository\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the Assets system\r\n */\r\n setupEntities(): void {\r\n this.assetRepoAO = this.appObjects.getOrCreate(\"Asset Repository\");\r\n this.appAssetsAO = this.appObjects.getOrCreate(\"App Assets\");\r\n\r\n // Initialize entities\r\n this.assetRepo = makeAssetRepo(this.assetRepoAO);\r\n this.assetRepo.assetFactory = this.makeAssetFactory();\r\n makeAppAssets(this.appAssetsAO);\r\n }\r\n\r\n /**\r\n * Creates an asset factory function that properly initializes assets with all required components\r\n */\r\n private makeAssetFactory() {\r\n return (id: string): AssetEntity => {\r\n const ao = this.appObjects.getOrCreate(id);\r\n\r\n // Entities\r\n const entity = makeAssetEntity(ao);\r\n\r\n // UCs for each asset\r\n makeArchiveAssetUC(ao);\r\n makeDeleteAssetUC(ao);\r\n makeDownloadAssetFileUC(ao);\r\n makeUpdateAssetFileUC(ao);\r\n makeUpdateAppAssetMetaUC(ao);\r\n\r\n // PMs for each asset\r\n makeAssetPM(ao);\r\n makeAssetFilePM(ao);\r\n\r\n return entity;\r\n };\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the Assets system\r\n */\r\n setupUCs(): void {\r\n // Repository UCs\r\n makeEditAppAsset(this.assetRepoAO);\r\n makeGetAssetBlobURLUC(this.assetRepoAO);\r\n makeGetAssetFileUC(this.assetRepoAO);\r\n makeGetAssetUC(this.assetRepoAO);\r\n makePrefetchAssets(this.assetRepoAO);\r\n makeNewAssetUC(this.assetRepoAO);\r\n\r\n // App Assets UCs\r\n makeNewAppAssetUC(this.appAssetsAO);\r\n makeGetAppAssetUC(this.appAssetsAO);\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the Assets system\r\n */\r\n setupPMs(): void {\r\n // App Assets PMs\r\n makeAppAssetListPM(this.appAssetsAO);\r\n makeShowArchivedAppAssetPM(this.appAssetsAO);\r\n makeEditingAppAssetPM(this.appAssetsAO);\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for assets\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"AssetsFactory.js","sourceRoot":"","sources":["../../../../src/Assets/Factories/AssetsFactory.ts"],"names":[],"mappings":";;;AAAA,sCAAsE;AACtE,0CAIqB;AACrB,gCAGgB;AAChB,gCAUgB;AAEhB;;;;GAIG;AACH,MAAa,aAAc,SAAQ,oBAAa;IAI9C,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJnB,+BAA+B;QACtB,gBAAW,GAAG,eAAe,CAAC;IAIvC,CAAC;IAED;;OAEG;IACH,aAAa;QACX,sBAAsB;QACtB,MAAM,SAAS,GAAG,IAAA,wBAAa,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChD,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACnD,CAAC;IAED;;OAEG;IACK,gBAAgB;QACtB,OAAO,CAAC,EAAU,EAAe,EAAE;YACjC,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YAE3C,WAAW;YACX,MAAM,MAAM,GAAG,IAAA,0BAAe,EAAC,EAAE,CAAC,CAAC;YAEnC,qBAAqB;YACrB,IAAA,wBAAkB,EAAC,EAAE,CAAC,CAAC;YACvB,IAAA,uBAAiB,EAAC,EAAE,CAAC,CAAC;YACtB,IAAA,6BAAuB,EAAC,EAAE,CAAC,CAAC;YAC5B,IAAA,2BAAqB,EAAC,EAAE,CAAC,CAAC;YAE1B,qBAAqB;YACrB,IAAA,iBAAW,EAAC,EAAE,CAAC,CAAC;YAChB,IAAA,qBAAe,EAAC,EAAE,CAAC,CAAC;YAEpB,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,iBAAiB;QACjB,IAAA,2BAAqB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtC,IAAA,wBAAkB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnC,IAAA,oBAAc,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/B,IAAA,wBAAkB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnC,IAAA,oBAAc,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,6CAA6C;IAC/C,CAAC;IAED;;OAEG;IACH,UAAU;QACR,0CAA0C;IAC5C,CAAC;CACF;AAlED,sCAkEC","sourcesContent":["import { AppObject, AppObjectRepo, DomainFactory } from \"@vived/core\";\r\nimport {\r\n AssetEntity,\r\n makeAssetEntity,\r\n makeAssetRepo\r\n} from \"../Entities\";\r\nimport {\r\n makeAssetFilePM,\r\n makeAssetPM\r\n} from \"../PMs\";\r\nimport {\r\n makeArchiveAssetUC,\r\n makeDeleteAssetUC,\r\n makeDownloadAssetFileUC,\r\n makeGetAssetBlobURLUC,\r\n makeGetAssetFileUC,\r\n makeGetAssetUC,\r\n makeNewAssetUC,\r\n makePrefetchAssets,\r\n makeUpdateAssetFileUC\r\n} from \"../UCs\";\r\n\r\n/**\r\n * Factory responsible for setting up the Assets domain components.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the Assets functionality.\r\n */\r\nexport class AssetsFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"AssetsFactory\";\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the Assets system\r\n */\r\n setupEntities(): void {\r\n // Initialize entities\r\n const assetRepo = makeAssetRepo(this.appObject);\r\n assetRepo.assetFactory = this.makeAssetFactory();\r\n }\r\n\r\n /**\r\n * Creates an asset factory function that properly initializes assets with all required components\r\n */\r\n private makeAssetFactory() {\r\n return (id: string): AssetEntity => {\r\n const ao = this.appObjects.getOrCreate(id);\r\n\r\n // Entities\r\n const entity = makeAssetEntity(ao);\r\n\r\n // UCs for each asset\r\n makeArchiveAssetUC(ao);\r\n makeDeleteAssetUC(ao);\r\n makeDownloadAssetFileUC(ao);\r\n makeUpdateAssetFileUC(ao);\r\n\r\n // PMs for each asset\r\n makeAssetPM(ao);\r\n makeAssetFilePM(ao);\r\n\r\n return entity;\r\n };\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the Assets system\r\n */\r\n setupUCs(): void {\r\n // Repository UCs\r\n makeGetAssetBlobURLUC(this.appObject);\r\n makeGetAssetFileUC(this.appObject);\r\n makeGetAssetUC(this.appObject);\r\n makePrefetchAssets(this.appObject);\r\n makeNewAssetUC(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the Assets system\r\n */\r\n setupPMs(): void {\r\n // No PMs needed for core asset functionality\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for assets\r\n }\r\n}\r\n"]}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CacheFeatureFactory = void 0;
4
+ const core_1 = require("@vived/core");
5
+ const Entities_1 = require("../Entities");
6
+ const UCs_1 = require("../UCs");
7
+ /**
8
+ * Factory responsible for setting up the Cache domain components.
9
+ * This factory initializes all entities, use cases, and presentation models
10
+ * required for the Cache functionality.
11
+ */
12
+ class CacheFeatureFactory extends core_1.DomainFactory {
13
+ constructor(appObject) {
14
+ super(appObject);
15
+ // Unique name for this factory
16
+ this.factoryName = "CacheFeatureFactory";
17
+ }
18
+ /**
19
+ * Sets up all entities required for the Cache system
20
+ */
21
+ setupEntities() {
22
+ // Initialize entities
23
+ (0, Entities_1.makeCacheEntity)(this.appObject);
24
+ (0, Entities_1.makeScriptCacheEntity)(this.appObject);
25
+ (0, Entities_1.makeAssetCacheEntity)(this.appObject);
26
+ }
27
+ /**
28
+ * Sets up all use cases for the Cache system
29
+ */
30
+ setupUCs() {
31
+ // Cache use cases
32
+ (0, UCs_1.makeGetScriptFromCacheUC)(this.appObject);
33
+ (0, UCs_1.makeStoreScriptInCacheUC)(this.appObject);
34
+ (0, UCs_1.makeGetAssetFromCacheUC)(this.appObject);
35
+ (0, UCs_1.makeStoreAssetInCacheUC)(this.appObject);
36
+ }
37
+ /**
38
+ * Sets up all presentation managers for the Cache system
39
+ */
40
+ setupPMs() {
41
+ // No presentation managers exist for the Cache system
42
+ }
43
+ /**
44
+ * Performs any final setup operations after all components are initialized
45
+ */
46
+ finalSetup() {
47
+ // No additional setup required for cache
48
+ }
49
+ }
50
+ exports.CacheFeatureFactory = CacheFeatureFactory;
51
+ //# sourceMappingURL=CacheFeatureFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CacheFeatureFactory.js","sourceRoot":"","sources":["../../../../src/Cache/Factories/CacheFeatureFactory.ts"],"names":[],"mappings":";;;AAAA,sCAAuD;AACvD,0CAIqB;AACrB,gCAKgB;AAEhB;;;;GAIG;AACH,MAAa,mBAAoB,SAAQ,oBAAa;IAIpD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJnB,+BAA+B;QACtB,gBAAW,GAAG,qBAAqB,CAAC;IAI7C,CAAC;IAED;;OAEG;IACH,aAAa;QACX,sBAAsB;QACtB,IAAA,0BAAe,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChC,IAAA,gCAAqB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtC,IAAA,+BAAoB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,kBAAkB;QAClB,IAAA,8BAAwB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzC,IAAA,8BAAwB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzC,IAAA,6BAAuB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxC,IAAA,6BAAuB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,sDAAsD;IACxD,CAAC;IAED;;OAEG;IACH,UAAU;QACR,yCAAyC;IAC3C,CAAC;CACF;AA1CD,kDA0CC","sourcesContent":["import { AppObject, DomainFactory } from \"@vived/core\";\r\nimport {\r\n makeCacheEntity,\r\n makeAssetCacheEntity,\r\n makeScriptCacheEntity\r\n} from \"../Entities\";\r\nimport {\r\n makeGetAssetFromCacheUC,\r\n makeGetScriptFromCacheUC,\r\n makeStoreAssetInCacheUC,\r\n makeStoreScriptInCacheUC\r\n} from \"../UCs\";\r\n\r\n/**\r\n * Factory responsible for setting up the Cache domain components.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the Cache functionality.\r\n */\r\nexport class CacheFeatureFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"CacheFeatureFactory\";\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the Cache system\r\n */\r\n setupEntities(): void {\r\n // Initialize entities\r\n makeCacheEntity(this.appObject);\r\n makeScriptCacheEntity(this.appObject);\r\n makeAssetCacheEntity(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the Cache system\r\n */\r\n setupUCs(): void {\r\n // Cache use cases\r\n makeGetScriptFromCacheUC(this.appObject);\r\n makeStoreScriptInCacheUC(this.appObject);\r\n makeGetAssetFromCacheUC(this.appObject);\r\n makeStoreAssetInCacheUC(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the Cache system\r\n */\r\n setupPMs(): void {\r\n // No presentation managers exist for the Cache system\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for cache\r\n }\r\n}\r\n"]}
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./setupCache"), exports);
18
+ __exportStar(require("./CacheFeatureFactory"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Cache/Factories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B","sourcesContent":["export * from \"./setupCache\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Cache/Factories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,wDAAsC","sourcesContent":["export * from \"./setupCache\";\r\nexport * from \"./CacheFeatureFactory\";\r\n"]}
@@ -16,9 +16,8 @@ export class AppsFeatureFactory extends DomainFactory {
16
16
  * Sets up all entities required for the Apps system
17
17
  */
18
18
  setupEntities() {
19
- this.appRepoAO = this.appObjects.getOrCreate("App Repository");
20
19
  // Initialize entities
21
- makeAppRepo(this.appRepoAO);
20
+ makeAppRepo(this.appObject);
22
21
  }
23
22
  /**
24
23
  * Sets up all use cases for the Apps system
@@ -32,7 +31,7 @@ export class AppsFeatureFactory extends DomainFactory {
32
31
  */
33
32
  setupPMs() {
34
33
  // App Repository PMs
35
- makeAppsListPM(this.appRepoAO);
34
+ makeAppsListPM(this.appObject);
36
35
  }
37
36
  /**
38
37
  * Performs any final setup operations after all components are initialized
@@ -1 +1 @@
1
- {"version":3,"file":"AppsFeatureFactory.js","sourceRoot":"","sources":["../../../../src/Apps/Factories/AppsFeatureFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAiB,WAAW,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAa,cAAc,EAAE,MAAM,QAAQ,CAAC;AAEnD;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,aAAa;IAOnD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QAPnB,+BAA+B;QACtB,gBAAW,GAAG,oBAAoB,CAAC;IAO5C,CAAC;IAED;;OAEG;IACH,aAAa;QACX,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAE/D,sBAAsB;QACtB,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,+DAA+D;QAC/D,0EAA0E;IAC5E,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,qBAAqB;QACrB,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,UAAU;QACR,wCAAwC;IAC1C,CAAC;CACF","sourcesContent":["import { AppObject, DomainFactory } from \"@vived/core\";\r\nimport { makeAppEntity, makeAppRepo } from \"../Entities\";\r\nimport { makeAppPM, makeAppsListPM } from \"../PMs\";\r\n\r\n/**\r\n * Factory responsible for setting up the Apps domain components.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the Apps functionality.\r\n */\r\nexport class AppsFeatureFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"AppsFeatureFactory\";\r\n\r\n // Store references to key AppObjects needed across setup phases\r\n private appRepoAO!: AppObject;\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the Apps system\r\n */\r\n setupEntities(): void {\r\n this.appRepoAO = this.appObjects.getOrCreate(\"App Repository\");\r\n\r\n // Initialize entities\r\n makeAppRepo(this.appRepoAO);\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the Apps system\r\n */\r\n setupUCs(): void {\r\n // Note: App UCs have complex dependencies and should be set up\r\n // separately to avoid circular dependencies during factory initialization\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the Apps system\r\n */\r\n setupPMs(): void {\r\n // App Repository PMs\r\n makeAppsListPM(this.appRepoAO);\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for apps\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"AppsFeatureFactory.js","sourceRoot":"","sources":["../../../../src/Apps/Factories/AppsFeatureFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAiB,WAAW,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAa,cAAc,EAAE,MAAM,QAAQ,CAAC;AAEnD;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,aAAa;IAInD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJnB,+BAA+B;QACtB,gBAAW,GAAG,oBAAoB,CAAC;IAI5C,CAAC;IAED;;OAEG;IACH,aAAa;QACX,sBAAsB;QACtB,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,+DAA+D;QAC/D,0EAA0E;IAC5E,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,qBAAqB;QACrB,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,UAAU;QACR,wCAAwC;IAC1C,CAAC;CACF","sourcesContent":["import { AppObject, DomainFactory } from \"@vived/core\";\r\nimport { makeAppEntity, makeAppRepo } from \"../Entities\";\r\nimport { makeAppPM, makeAppsListPM } from \"../PMs\";\r\n\r\n/**\r\n * Factory responsible for setting up the Apps domain components.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the Apps functionality.\r\n */\r\nexport class AppsFeatureFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"AppsFeatureFactory\";\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the Apps system\r\n */\r\n setupEntities(): void {\r\n // Initialize entities\r\n makeAppRepo(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the Apps system\r\n */\r\n setupUCs(): void {\r\n // Note: App UCs have complex dependencies and should be set up\r\n // separately to avoid circular dependencies during factory initialization\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the Apps system\r\n */\r\n setupPMs(): void {\r\n // App Repository PMs\r\n makeAppsListPM(this.appObject);\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for apps\r\n }\r\n}\r\n"]}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * fetchAssetFile.ts
3
+ *
4
+ * This controller function retrieves an asset file as a File object,
5
+ * handling caching and error management for file access operations.
6
+ *
7
+ * Key Concepts:
8
+ * - Retrieves asset files as File objects for download or processing
9
+ * - Uses GetAssetFileUC to handle caching and file retrieval logic
10
+ * - Provides error handling for missing components
11
+ * - Coordinates with asset file management workflows
12
+ *
13
+ * Usage Patterns:
14
+ * - Called from UI components when users need asset file access
15
+ * - Used in asset management workflows for file processing
16
+ * - Integrated with download and preview functionality
17
+ */
18
+ import { GetAssetFileUC } from "../UCs/GetAssetFileUC";
19
+ /**
20
+ * Retrieves an asset file as a File object.
21
+ *
22
+ * This function provides a controller-level interface for asset file retrieval.
23
+ * It handles the complete file access workflow including caching optimization,
24
+ * error handling, and returns a File object ready for use in web applications.
25
+ *
26
+ * @param assetID - The unique identifier of the asset whose file should be retrieved
27
+ * @param appObjects - Repository for accessing asset-related app objects and components
28
+ * @returns Promise<File> - A promise that resolves to the File object for the asset,
29
+ * or undefined if the operation cannot be completed
30
+ */
31
+ export function fetchAssetFile(assetID, appObjects) {
32
+ const uc = GetAssetFileUC.get(appObjects);
33
+ if (!uc) {
34
+ appObjects.submitWarning("fetchAssetFile", "Unable to find GetAssetFileUC");
35
+ return;
36
+ }
37
+ return uc.getAssetFile(assetID);
38
+ }
39
+ //# sourceMappingURL=fetchAssetFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchAssetFile.js","sourceRoot":"","sources":["../../../../src/Assets/Controllers/fetchAssetFile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAe,EACf,UAAyB;IAEzB,MAAM,EAAE,GAAG,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC1C,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,UAAU,CAAC,aAAa,CAAC,gBAAgB,EAAE,+BAA+B,CAAC,CAAC;QAC5E,OAAO;IACT,CAAC;IAED,OAAO,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC","sourcesContent":["/**\r\n * fetchAssetFile.ts\r\n *\r\n * This controller function retrieves an asset file as a File object,\r\n * handling caching and error management for file access operations.\r\n *\r\n * Key Concepts:\r\n * - Retrieves asset files as File objects for download or processing\r\n * - Uses GetAssetFileUC to handle caching and file retrieval logic\r\n * - Provides error handling for missing components\r\n * - Coordinates with asset file management workflows\r\n *\r\n * Usage Patterns:\r\n * - Called from UI components when users need asset file access\r\n * - Used in asset management workflows for file processing\r\n * - Integrated with download and preview functionality\r\n */\r\n\r\nimport { AppObjectRepo } from \"@vived/core\";\r\nimport { GetAssetFileUC } from \"../UCs/GetAssetFileUC\";\r\n\r\n/**\r\n * Retrieves an asset file as a File object.\r\n *\r\n * This function provides a controller-level interface for asset file retrieval.\r\n * It handles the complete file access workflow including caching optimization,\r\n * error handling, and returns a File object ready for use in web applications.\r\n *\r\n * @param assetID - The unique identifier of the asset whose file should be retrieved\r\n * @param appObjects - Repository for accessing asset-related app objects and components\r\n * @returns Promise<File> - A promise that resolves to the File object for the asset,\r\n * or undefined if the operation cannot be completed\r\n */\r\nexport function fetchAssetFile(\r\n assetID: string,\r\n appObjects: AppObjectRepo\r\n): Promise<File> | undefined {\r\n const uc = GetAssetFileUC.get(appObjects);\r\n if (!uc) {\r\n appObjects.submitWarning(\"fetchAssetFile\", \"Unable to find GetAssetFileUC\");\r\n return;\r\n }\r\n\r\n return uc.getAssetFile(assetID);\r\n}\r\n"]}
@@ -21,6 +21,7 @@ export * from "./archiveAsset";
21
21
  export * from "./deleteAsset";
22
22
  export * from "./downloadAssetFile";
23
23
  export * from "./editAppAsset";
24
+ export * from "./fetchAssetFile";
24
25
  export * from "./getAppAssets";
25
26
  export * from "./newAppAsset";
26
27
  export * from "./toggleShowArchivedAssets";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Assets/Controllers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC","sourcesContent":["/**\r\n * Assets Controllers Index\r\n *\r\n * This module exports all controller functions for the Assets feature.\r\n * Controllers provide simple, stateless functions that serve as entry points\r\n * for asset-related operations from UI components and external systems.\r\n *\r\n * Key Concepts:\r\n * - Controllers act as the interface layer between UI components and business logic\r\n * - Each controller function handles a specific asset operation\r\n * - Controllers delegate to Use Cases (UCs) for actual business logic implementation\r\n * - Error handling and validation are performed at the controller level\r\n *\r\n * Available Operations:\r\n * - Asset lifecycle: create, edit, delete, archive\r\n * - File management: upload, download, update\r\n * - Collection management: get app assets, toggle archived visibility\r\n * - Metadata management: update asset information\r\n */\r\n\r\nexport * from \"./archiveAsset\";\r\nexport * from \"./deleteAsset\";\r\nexport * from \"./downloadAssetFile\";\r\nexport * from \"./editAppAsset\";\r\nexport * from \"./getAppAssets\";\r\nexport * from \"./newAppAsset\";\r\nexport * from \"./toggleShowArchivedAssets\";\r\nexport * from \"./updateAppAssetMeta\";\r\nexport * from \"./updateAssetFile\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Assets/Controllers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC","sourcesContent":["/**\r\n * Assets Controllers Index\r\n *\r\n * This module exports all controller functions for the Assets feature.\r\n * Controllers provide simple, stateless functions that serve as entry points\r\n * for asset-related operations from UI components and external systems.\r\n *\r\n * Key Concepts:\r\n * - Controllers act as the interface layer between UI components and business logic\r\n * - Each controller function handles a specific asset operation\r\n * - Controllers delegate to Use Cases (UCs) for actual business logic implementation\r\n * - Error handling and validation are performed at the controller level\r\n *\r\n * Available Operations:\r\n * - Asset lifecycle: create, edit, delete, archive\r\n * - File management: upload, download, update\r\n * - Collection management: get app assets, toggle archived visibility\r\n * - Metadata management: update asset information\r\n */\r\n\r\nexport * from \"./archiveAsset\";\r\nexport * from \"./deleteAsset\";\r\nexport * from \"./downloadAssetFile\";\r\nexport * from \"./editAppAsset\";\r\nexport * from \"./fetchAssetFile\";\r\nexport * from \"./getAppAssets\";\r\nexport * from \"./newAppAsset\";\r\nexport * from \"./toggleShowArchivedAssets\";\r\nexport * from \"./updateAppAssetMeta\";\r\nexport * from \"./updateAssetFile\";\r\n"]}
@@ -1,7 +1,7 @@
1
1
  import { DomainFactory } from "@vived/core";
2
- import { makeAppAssets, makeAssetEntity, makeAssetRepo } from "../Entities";
3
- import { makeAppAssetListPM, makeAssetFilePM, makeAssetPM, makeEditingAppAssetPM, makeShowArchivedAppAssetPM } from "../PMs";
4
- import { makeArchiveAssetUC, makeDeleteAssetUC, makeDownloadAssetFileUC, makeEditAppAsset, makeGetAppAssetUC, makeGetAssetBlobURLUC, makeGetAssetFileUC, makeGetAssetUC, makeNewAppAssetUC, makeNewAssetUC, makePrefetchAssets, makeUpdateAppAssetMetaUC, makeUpdateAssetFileUC } from "../UCs";
2
+ import { makeAssetEntity, makeAssetRepo } from "../Entities";
3
+ import { makeAssetFilePM, makeAssetPM } from "../PMs";
4
+ import { makeArchiveAssetUC, makeDeleteAssetUC, makeDownloadAssetFileUC, makeGetAssetBlobURLUC, makeGetAssetFileUC, makeGetAssetUC, makeNewAssetUC, makePrefetchAssets, makeUpdateAssetFileUC } from "../UCs";
5
5
  /**
6
6
  * Factory responsible for setting up the Assets domain components.
7
7
  * This factory initializes all entities, use cases, and presentation models
@@ -17,12 +17,9 @@ export class AssetsFactory extends DomainFactory {
17
17
  * Sets up all entities required for the Assets system
18
18
  */
19
19
  setupEntities() {
20
- this.assetRepoAO = this.appObjects.getOrCreate("Asset Repository");
21
- this.appAssetsAO = this.appObjects.getOrCreate("App Assets");
22
20
  // Initialize entities
23
- this.assetRepo = makeAssetRepo(this.assetRepoAO);
24
- this.assetRepo.assetFactory = this.makeAssetFactory();
25
- makeAppAssets(this.appAssetsAO);
21
+ const assetRepo = makeAssetRepo(this.appObject);
22
+ assetRepo.assetFactory = this.makeAssetFactory();
26
23
  }
27
24
  /**
28
25
  * Creates an asset factory function that properly initializes assets with all required components
@@ -37,7 +34,6 @@ export class AssetsFactory extends DomainFactory {
37
34
  makeDeleteAssetUC(ao);
38
35
  makeDownloadAssetFileUC(ao);
39
36
  makeUpdateAssetFileUC(ao);
40
- makeUpdateAppAssetMetaUC(ao);
41
37
  // PMs for each asset
42
38
  makeAssetPM(ao);
43
39
  makeAssetFilePM(ao);
@@ -49,24 +45,17 @@ export class AssetsFactory extends DomainFactory {
49
45
  */
50
46
  setupUCs() {
51
47
  // Repository UCs
52
- makeEditAppAsset(this.assetRepoAO);
53
- makeGetAssetBlobURLUC(this.assetRepoAO);
54
- makeGetAssetFileUC(this.assetRepoAO);
55
- makeGetAssetUC(this.assetRepoAO);
56
- makePrefetchAssets(this.assetRepoAO);
57
- makeNewAssetUC(this.assetRepoAO);
58
- // App Assets UCs
59
- makeNewAppAssetUC(this.appAssetsAO);
60
- makeGetAppAssetUC(this.appAssetsAO);
48
+ makeGetAssetBlobURLUC(this.appObject);
49
+ makeGetAssetFileUC(this.appObject);
50
+ makeGetAssetUC(this.appObject);
51
+ makePrefetchAssets(this.appObject);
52
+ makeNewAssetUC(this.appObject);
61
53
  }
62
54
  /**
63
55
  * Sets up all presentation managers for the Assets system
64
56
  */
65
57
  setupPMs() {
66
- // App Assets PMs
67
- makeAppAssetListPM(this.appAssetsAO);
68
- makeShowArchivedAppAssetPM(this.appAssetsAO);
69
- makeEditingAppAssetPM(this.appAssetsAO);
58
+ // No PMs needed for core asset functionality
70
59
  }
71
60
  /**
72
61
  * Performs any final setup operations after all components are initialized
@@ -1 +1 @@
1
- {"version":3,"file":"AssetsFactory.js","sourceRoot":"","sources":["../../../../src/Assets/Factories/AssetsFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,aAAa,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAEL,aAAa,EACb,eAAe,EACf,aAAa,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,QAAQ,CAAC;AAEhB;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAS9C,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QATnB,+BAA+B;QACtB,gBAAW,GAAG,eAAe,CAAC;IASvC,CAAC;IAED;;OAEG;IACH,aAAa;QACX,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;QACnE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAE7D,sBAAsB;QACtB,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjD,IAAI,CAAC,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtD,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACK,gBAAgB;QACtB,OAAO,CAAC,EAAU,EAAe,EAAE;YACjC,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YAE3C,WAAW;YACX,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;YAEnC,qBAAqB;YACrB,kBAAkB,CAAC,EAAE,CAAC,CAAC;YACvB,iBAAiB,CAAC,EAAE,CAAC,CAAC;YACtB,uBAAuB,CAAC,EAAE,CAAC,CAAC;YAC5B,qBAAqB,CAAC,EAAE,CAAC,CAAC;YAC1B,wBAAwB,CAAC,EAAE,CAAC,CAAC;YAE7B,qBAAqB;YACrB,WAAW,CAAC,EAAE,CAAC,CAAC;YAChB,eAAe,CAAC,EAAE,CAAC,CAAC;YAEpB,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,iBAAiB;QACjB,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACnC,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACxC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEjC,iBAAiB;QACjB,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACpC,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,iBAAiB;QACjB,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrC,0BAA0B,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC7C,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,UAAU;QACR,0CAA0C;IAC5C,CAAC;CACF","sourcesContent":["import { AppObject, AppObjectRepo, DomainFactory } from \"@vived/core\";\r\nimport {\r\n AssetEntity,\r\n makeAppAssets,\r\n makeAssetEntity,\r\n makeAssetRepo\r\n} from \"../Entities\";\r\nimport {\r\n makeAppAssetListPM,\r\n makeAssetFilePM,\r\n makeAssetPM,\r\n makeEditingAppAssetPM,\r\n makeShowArchivedAppAssetPM\r\n} from \"../PMs\";\r\nimport {\r\n makeArchiveAssetUC,\r\n makeDeleteAssetUC,\r\n makeDownloadAssetFileUC,\r\n makeEditAppAsset,\r\n makeGetAppAssetUC,\r\n makeGetAssetBlobURLUC,\r\n makeGetAssetFileUC,\r\n makeGetAssetUC,\r\n makeNewAppAssetUC,\r\n makeNewAssetUC,\r\n makePrefetchAssets,\r\n makeUpdateAppAssetMetaUC,\r\n makeUpdateAssetFileUC\r\n} from \"../UCs\";\r\n\r\n/**\r\n * Factory responsible for setting up the Assets domain components.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the Assets functionality.\r\n */\r\nexport class AssetsFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"AssetsFactory\";\r\n\r\n // Store references to key AppObjects needed across setup phases\r\n private assetRepoAO!: AppObject;\r\n private appAssetsAO!: AppObject;\r\n private assetRepo: any; // This will hold the asset repository\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the Assets system\r\n */\r\n setupEntities(): void {\r\n this.assetRepoAO = this.appObjects.getOrCreate(\"Asset Repository\");\r\n this.appAssetsAO = this.appObjects.getOrCreate(\"App Assets\");\r\n\r\n // Initialize entities\r\n this.assetRepo = makeAssetRepo(this.assetRepoAO);\r\n this.assetRepo.assetFactory = this.makeAssetFactory();\r\n makeAppAssets(this.appAssetsAO);\r\n }\r\n\r\n /**\r\n * Creates an asset factory function that properly initializes assets with all required components\r\n */\r\n private makeAssetFactory() {\r\n return (id: string): AssetEntity => {\r\n const ao = this.appObjects.getOrCreate(id);\r\n\r\n // Entities\r\n const entity = makeAssetEntity(ao);\r\n\r\n // UCs for each asset\r\n makeArchiveAssetUC(ao);\r\n makeDeleteAssetUC(ao);\r\n makeDownloadAssetFileUC(ao);\r\n makeUpdateAssetFileUC(ao);\r\n makeUpdateAppAssetMetaUC(ao);\r\n\r\n // PMs for each asset\r\n makeAssetPM(ao);\r\n makeAssetFilePM(ao);\r\n\r\n return entity;\r\n };\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the Assets system\r\n */\r\n setupUCs(): void {\r\n // Repository UCs\r\n makeEditAppAsset(this.assetRepoAO);\r\n makeGetAssetBlobURLUC(this.assetRepoAO);\r\n makeGetAssetFileUC(this.assetRepoAO);\r\n makeGetAssetUC(this.assetRepoAO);\r\n makePrefetchAssets(this.assetRepoAO);\r\n makeNewAssetUC(this.assetRepoAO);\r\n\r\n // App Assets UCs\r\n makeNewAppAssetUC(this.appAssetsAO);\r\n makeGetAppAssetUC(this.appAssetsAO);\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the Assets system\r\n */\r\n setupPMs(): void {\r\n // App Assets PMs\r\n makeAppAssetListPM(this.appAssetsAO);\r\n makeShowArchivedAppAssetPM(this.appAssetsAO);\r\n makeEditingAppAssetPM(this.appAssetsAO);\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for assets\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"AssetsFactory.js","sourceRoot":"","sources":["../../../../src/Assets/Factories/AssetsFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,aAAa,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAEL,eAAe,EACf,aAAa,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,eAAe,EACf,WAAW,EACZ,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,QAAQ,CAAC;AAEhB;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAI9C,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJnB,+BAA+B;QACtB,gBAAW,GAAG,eAAe,CAAC;IAIvC,CAAC;IAED;;OAEG;IACH,aAAa;QACX,sBAAsB;QACtB,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChD,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACnD,CAAC;IAED;;OAEG;IACK,gBAAgB;QACtB,OAAO,CAAC,EAAU,EAAe,EAAE;YACjC,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YAE3C,WAAW;YACX,MAAM,MAAM,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;YAEnC,qBAAqB;YACrB,kBAAkB,CAAC,EAAE,CAAC,CAAC;YACvB,iBAAiB,CAAC,EAAE,CAAC,CAAC;YACtB,uBAAuB,CAAC,EAAE,CAAC,CAAC;YAC5B,qBAAqB,CAAC,EAAE,CAAC,CAAC;YAE1B,qBAAqB;YACrB,WAAW,CAAC,EAAE,CAAC,CAAC;YAChB,eAAe,CAAC,EAAE,CAAC,CAAC;YAEpB,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,iBAAiB;QACjB,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtC,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/B,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,6CAA6C;IAC/C,CAAC;IAED;;OAEG;IACH,UAAU;QACR,0CAA0C;IAC5C,CAAC;CACF","sourcesContent":["import { AppObject, AppObjectRepo, DomainFactory } from \"@vived/core\";\r\nimport {\r\n AssetEntity,\r\n makeAssetEntity,\r\n makeAssetRepo\r\n} from \"../Entities\";\r\nimport {\r\n makeAssetFilePM,\r\n makeAssetPM\r\n} from \"../PMs\";\r\nimport {\r\n makeArchiveAssetUC,\r\n makeDeleteAssetUC,\r\n makeDownloadAssetFileUC,\r\n makeGetAssetBlobURLUC,\r\n makeGetAssetFileUC,\r\n makeGetAssetUC,\r\n makeNewAssetUC,\r\n makePrefetchAssets,\r\n makeUpdateAssetFileUC\r\n} from \"../UCs\";\r\n\r\n/**\r\n * Factory responsible for setting up the Assets domain components.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the Assets functionality.\r\n */\r\nexport class AssetsFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"AssetsFactory\";\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the Assets system\r\n */\r\n setupEntities(): void {\r\n // Initialize entities\r\n const assetRepo = makeAssetRepo(this.appObject);\r\n assetRepo.assetFactory = this.makeAssetFactory();\r\n }\r\n\r\n /**\r\n * Creates an asset factory function that properly initializes assets with all required components\r\n */\r\n private makeAssetFactory() {\r\n return (id: string): AssetEntity => {\r\n const ao = this.appObjects.getOrCreate(id);\r\n\r\n // Entities\r\n const entity = makeAssetEntity(ao);\r\n\r\n // UCs for each asset\r\n makeArchiveAssetUC(ao);\r\n makeDeleteAssetUC(ao);\r\n makeDownloadAssetFileUC(ao);\r\n makeUpdateAssetFileUC(ao);\r\n\r\n // PMs for each asset\r\n makeAssetPM(ao);\r\n makeAssetFilePM(ao);\r\n\r\n return entity;\r\n };\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the Assets system\r\n */\r\n setupUCs(): void {\r\n // Repository UCs\r\n makeGetAssetBlobURLUC(this.appObject);\r\n makeGetAssetFileUC(this.appObject);\r\n makeGetAssetUC(this.appObject);\r\n makePrefetchAssets(this.appObject);\r\n makeNewAssetUC(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the Assets system\r\n */\r\n setupPMs(): void {\r\n // No PMs needed for core asset functionality\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for assets\r\n }\r\n}\r\n"]}
@@ -0,0 +1,47 @@
1
+ import { DomainFactory } from "@vived/core";
2
+ import { makeCacheEntity, makeAssetCacheEntity, makeScriptCacheEntity } from "../Entities";
3
+ import { makeGetAssetFromCacheUC, makeGetScriptFromCacheUC, makeStoreAssetInCacheUC, makeStoreScriptInCacheUC } from "../UCs";
4
+ /**
5
+ * Factory responsible for setting up the Cache domain components.
6
+ * This factory initializes all entities, use cases, and presentation models
7
+ * required for the Cache functionality.
8
+ */
9
+ export class CacheFeatureFactory extends DomainFactory {
10
+ constructor(appObject) {
11
+ super(appObject);
12
+ // Unique name for this factory
13
+ this.factoryName = "CacheFeatureFactory";
14
+ }
15
+ /**
16
+ * Sets up all entities required for the Cache system
17
+ */
18
+ setupEntities() {
19
+ // Initialize entities
20
+ makeCacheEntity(this.appObject);
21
+ makeScriptCacheEntity(this.appObject);
22
+ makeAssetCacheEntity(this.appObject);
23
+ }
24
+ /**
25
+ * Sets up all use cases for the Cache system
26
+ */
27
+ setupUCs() {
28
+ // Cache use cases
29
+ makeGetScriptFromCacheUC(this.appObject);
30
+ makeStoreScriptInCacheUC(this.appObject);
31
+ makeGetAssetFromCacheUC(this.appObject);
32
+ makeStoreAssetInCacheUC(this.appObject);
33
+ }
34
+ /**
35
+ * Sets up all presentation managers for the Cache system
36
+ */
37
+ setupPMs() {
38
+ // No presentation managers exist for the Cache system
39
+ }
40
+ /**
41
+ * Performs any final setup operations after all components are initialized
42
+ */
43
+ finalSetup() {
44
+ // No additional setup required for cache
45
+ }
46
+ }
47
+ //# sourceMappingURL=CacheFeatureFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CacheFeatureFactory.js","sourceRoot":"","sources":["../../../../src/Cache/Factories/CacheFeatureFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,QAAQ,CAAC;AAEhB;;;;GAIG;AACH,MAAM,OAAO,mBAAoB,SAAQ,aAAa;IAIpD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJnB,+BAA+B;QACtB,gBAAW,GAAG,qBAAqB,CAAC;IAI7C,CAAC;IAED;;OAEG;IACH,aAAa;QACX,sBAAsB;QACtB,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChC,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtC,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,kBAAkB;QAClB,wBAAwB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzC,wBAAwB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzC,uBAAuB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxC,uBAAuB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,sDAAsD;IACxD,CAAC;IAED;;OAEG;IACH,UAAU;QACR,yCAAyC;IAC3C,CAAC;CACF","sourcesContent":["import { AppObject, DomainFactory } from \"@vived/core\";\r\nimport {\r\n makeCacheEntity,\r\n makeAssetCacheEntity,\r\n makeScriptCacheEntity\r\n} from \"../Entities\";\r\nimport {\r\n makeGetAssetFromCacheUC,\r\n makeGetScriptFromCacheUC,\r\n makeStoreAssetInCacheUC,\r\n makeStoreScriptInCacheUC\r\n} from \"../UCs\";\r\n\r\n/**\r\n * Factory responsible for setting up the Cache domain components.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the Cache functionality.\r\n */\r\nexport class CacheFeatureFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"CacheFeatureFactory\";\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the Cache system\r\n */\r\n setupEntities(): void {\r\n // Initialize entities\r\n makeCacheEntity(this.appObject);\r\n makeScriptCacheEntity(this.appObject);\r\n makeAssetCacheEntity(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the Cache system\r\n */\r\n setupUCs(): void {\r\n // Cache use cases\r\n makeGetScriptFromCacheUC(this.appObject);\r\n makeStoreScriptInCacheUC(this.appObject);\r\n makeGetAssetFromCacheUC(this.appObject);\r\n makeStoreAssetInCacheUC(this.appObject);\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the Cache system\r\n */\r\n setupPMs(): void {\r\n // No presentation managers exist for the Cache system\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for cache\r\n }\r\n}\r\n"]}
@@ -1,2 +1,3 @@
1
1
  export * from "./setupCache";
2
+ export * from "./CacheFeatureFactory";
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Cache/Factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC","sourcesContent":["export * from \"./setupCache\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Cache/Factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC","sourcesContent":["export * from \"./setupCache\";\r\nexport * from \"./CacheFeatureFactory\";\r\n"]}
@@ -6,7 +6,6 @@ import { AppObject, DomainFactory } from "@vived/core";
6
6
  */
7
7
  export declare class AppsFeatureFactory extends DomainFactory {
8
8
  readonly factoryName = "AppsFeatureFactory";
9
- private appRepoAO;
10
9
  constructor(appObject: AppObject);
11
10
  /**
12
11
  * Sets up all entities required for the Apps system
@@ -1 +1 @@
1
- {"version":3,"file":"AppsFeatureFactory.d.ts","sourceRoot":"","sources":["../../../../src/Apps/Factories/AppsFeatureFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIvD;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;IAEnD,QAAQ,CAAC,WAAW,wBAAwB;IAG5C,OAAO,CAAC,SAAS,CAAa;gBAElB,SAAS,EAAE,SAAS;IAIhC;;OAEG;IACH,aAAa,IAAI,IAAI;IAOrB;;OAEG;IACH,QAAQ,IAAI,IAAI;IAKhB;;OAEG;IACH,QAAQ,IAAI,IAAI;IAKhB;;OAEG;IACH,UAAU,IAAI,IAAI;CAGnB"}
1
+ {"version":3,"file":"AppsFeatureFactory.d.ts","sourceRoot":"","sources":["../../../../src/Apps/Factories/AppsFeatureFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIvD;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;IAEnD,QAAQ,CAAC,WAAW,wBAAwB;gBAEhC,SAAS,EAAE,SAAS;IAIhC;;OAEG;IACH,aAAa,IAAI,IAAI;IAKrB;;OAEG;IACH,QAAQ,IAAI,IAAI;IAKhB;;OAEG;IACH,QAAQ,IAAI,IAAI;IAKhB;;OAEG;IACH,UAAU,IAAI,IAAI;CAGnB"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * fetchAssetFile.ts
3
+ *
4
+ * This controller function retrieves an asset file as a File object,
5
+ * handling caching and error management for file access operations.
6
+ *
7
+ * Key Concepts:
8
+ * - Retrieves asset files as File objects for download or processing
9
+ * - Uses GetAssetFileUC to handle caching and file retrieval logic
10
+ * - Provides error handling for missing components
11
+ * - Coordinates with asset file management workflows
12
+ *
13
+ * Usage Patterns:
14
+ * - Called from UI components when users need asset file access
15
+ * - Used in asset management workflows for file processing
16
+ * - Integrated with download and preview functionality
17
+ */
18
+ import { AppObjectRepo } from "@vived/core";
19
+ /**
20
+ * Retrieves an asset file as a File object.
21
+ *
22
+ * This function provides a controller-level interface for asset file retrieval.
23
+ * It handles the complete file access workflow including caching optimization,
24
+ * error handling, and returns a File object ready for use in web applications.
25
+ *
26
+ * @param assetID - The unique identifier of the asset whose file should be retrieved
27
+ * @param appObjects - Repository for accessing asset-related app objects and components
28
+ * @returns Promise<File> - A promise that resolves to the File object for the asset,
29
+ * or undefined if the operation cannot be completed
30
+ */
31
+ export declare function fetchAssetFile(assetID: string, appObjects: AppObjectRepo): Promise<File> | undefined;
32
+ //# sourceMappingURL=fetchAssetFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchAssetFile.d.ts","sourceRoot":"","sources":["../../../../src/Assets/Controllers/fetchAssetFile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,aAAa,GACxB,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAQ3B"}
@@ -21,6 +21,7 @@ export * from "./archiveAsset";
21
21
  export * from "./deleteAsset";
22
22
  export * from "./downloadAssetFile";
23
23
  export * from "./editAppAsset";
24
+ export * from "./fetchAssetFile";
24
25
  export * from "./getAppAssets";
25
26
  export * from "./newAppAsset";
26
27
  export * from "./toggleShowArchivedAssets";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Assets/Controllers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Assets/Controllers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
@@ -6,9 +6,6 @@ import { AppObject, DomainFactory } from "@vived/core";
6
6
  */
7
7
  export declare class AssetsFactory extends DomainFactory {
8
8
  readonly factoryName = "AssetsFactory";
9
- private assetRepoAO;
10
- private appAssetsAO;
11
- private assetRepo;
12
9
  constructor(appObject: AppObject);
13
10
  /**
14
11
  * Sets up all entities required for the Assets system
@@ -1 +1 @@
1
- {"version":3,"file":"AssetsFactory.d.ts","sourceRoot":"","sources":["../../../../src/Assets/Factories/AssetsFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiB,aAAa,EAAE,MAAM,aAAa,CAAC;AA8BtE;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,aAAa;IAE9C,QAAQ,CAAC,WAAW,mBAAmB;IAGvC,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,SAAS,CAAM;gBAEX,SAAS,EAAE,SAAS;IAIhC;;OAEG;IACH,aAAa,IAAI,IAAI;IAUrB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAsBxB;;OAEG;IACH,QAAQ,IAAI,IAAI;IAchB;;OAEG;IACH,QAAQ,IAAI,IAAI;IAOhB;;OAEG;IACH,UAAU,IAAI,IAAI;CAGnB"}
1
+ {"version":3,"file":"AssetsFactory.d.ts","sourceRoot":"","sources":["../../../../src/Assets/Factories/AssetsFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiB,aAAa,EAAE,MAAM,aAAa,CAAC;AAsBtE;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,aAAa;IAE9C,QAAQ,CAAC,WAAW,mBAAmB;gBAE3B,SAAS,EAAE,SAAS;IAIhC;;OAEG;IACH,aAAa,IAAI,IAAI;IAMrB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAqBxB;;OAEG;IACH,QAAQ,IAAI,IAAI;IAShB;;OAEG;IACH,QAAQ,IAAI,IAAI;IAIhB;;OAEG;IACH,UAAU,IAAI,IAAI;CAGnB"}
@@ -0,0 +1,27 @@
1
+ import { AppObject, DomainFactory } from "@vived/core";
2
+ /**
3
+ * Factory responsible for setting up the Cache domain components.
4
+ * This factory initializes all entities, use cases, and presentation models
5
+ * required for the Cache functionality.
6
+ */
7
+ export declare class CacheFeatureFactory extends DomainFactory {
8
+ readonly factoryName = "CacheFeatureFactory";
9
+ constructor(appObject: AppObject);
10
+ /**
11
+ * Sets up all entities required for the Cache system
12
+ */
13
+ setupEntities(): void;
14
+ /**
15
+ * Sets up all use cases for the Cache system
16
+ */
17
+ setupUCs(): void;
18
+ /**
19
+ * Sets up all presentation managers for the Cache system
20
+ */
21
+ setupPMs(): void;
22
+ /**
23
+ * Performs any final setup operations after all components are initialized
24
+ */
25
+ finalSetup(): void;
26
+ }
27
+ //# sourceMappingURL=CacheFeatureFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CacheFeatureFactory.d.ts","sourceRoot":"","sources":["../../../../src/Cache/Factories/CacheFeatureFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAavD;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,aAAa;IAEpD,QAAQ,CAAC,WAAW,yBAAyB;gBAEjC,SAAS,EAAE,SAAS;IAIhC;;OAEG;IACH,aAAa,IAAI,IAAI;IAOrB;;OAEG;IACH,QAAQ,IAAI,IAAI;IAQhB;;OAEG;IACH,QAAQ,IAAI,IAAI;IAIhB;;OAEG;IACH,UAAU,IAAI,IAAI;CAGnB"}
@@ -1,2 +1,3 @@
1
1
  export * from "./setupCache";
2
+ export * from "./CacheFeatureFactory";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Cache/Factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Cache/Factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vived/host",
3
- "version": "4.11.2",
3
+ "version": "4.12.0",
4
4
  "description": "Public Host package for the VIVED Learning App system",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",