@vived/host 4.11.0 → 4.11.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.
- package/dist/cjs/Apps/Entities/AppEntity.js +75 -14
- package/dist/cjs/Apps/Entities/AppEntity.js.map +1 -1
- package/dist/cjs/Apps/Factories/AppsFeatureFactory.js +48 -0
- package/dist/cjs/Apps/Factories/AppsFeatureFactory.js.map +1 -0
- package/dist/cjs/Apps/Factories/index.js +18 -0
- package/dist/cjs/Apps/Factories/index.js.map +1 -0
- package/dist/cjs/Apps/index.js +1 -0
- package/dist/cjs/Apps/index.js.map +1 -1
- package/dist/cjs/Assets/UCs/GetAssetBlobURLUC.js +8 -1
- package/dist/cjs/Assets/UCs/GetAssetBlobURLUC.js.map +1 -1
- package/dist/cjs/VivedAPI/Adapters/apiStageAdapter.js.map +1 -1
- package/dist/cjs/VivedAPI/Adapters/index.js.map +1 -1
- package/dist/cjs/VivedAPI/Adapters/userTokenAdapter.js.map +1 -1
- package/dist/cjs/VivedAPI/Controllers/index.js.map +1 -1
- package/dist/cjs/VivedAPI/Controllers/loginUser.js.map +1 -1
- package/dist/cjs/VivedAPI/Controllers/logoutUser.js.map +1 -1
- package/dist/cjs/VivedAPI/Controllers/setApiStage.js.map +1 -1
- package/dist/cjs/VivedAPI/Entities/VivedAPIEntity.js.map +1 -1
- package/dist/cjs/VivedAPI/Entities/index.js.map +1 -1
- package/dist/cjs/VivedAPI/Factories/index.js.map +1 -1
- package/dist/cjs/VivedAPI/Factories/setupVivedAPIForSandbox.js.map +1 -1
- package/dist/cjs/VivedAPI/Mocks/MockJsonRequestUC.js.map +1 -1
- package/dist/cjs/VivedAPI/Mocks/index.js.map +1 -1
- package/dist/cjs/VivedAPI/PMs/ApiStagePM.js.map +1 -1
- package/dist/cjs/VivedAPI/PMs/UserTokenPM.js.map +1 -1
- package/dist/cjs/VivedAPI/PMs/index.js.map +1 -1
- package/dist/cjs/VivedAPI/UCs/BasicFetchUC.js.map +1 -1
- package/dist/cjs/VivedAPI/UCs/BlobRequestUC.js.map +1 -1
- package/dist/cjs/VivedAPI/UCs/DeleteAssetOnAPIUC.js.map +1 -1
- package/dist/cjs/VivedAPI/UCs/FileUploadUC.js.map +1 -1
- package/dist/cjs/VivedAPI/UCs/JsonRequestUC.js.map +1 -1
- package/dist/cjs/VivedAPI/UCs/PostNewAssetUC.js.map +1 -1
- package/dist/cjs/VivedAPI/UCs/SignedAuthTokenUC.js.map +1 -1
- package/dist/cjs/VivedAPI/UCs/UserAuthUC.js.map +1 -1
- package/dist/cjs/VivedAPI/UCs/index.js.map +1 -1
- package/dist/cjs/VivedAPI/index.js.map +1 -1
- package/dist/esm/Apps/Entities/AppEntity.js +75 -14
- package/dist/esm/Apps/Entities/AppEntity.js.map +1 -1
- package/dist/esm/Apps/Factories/AppsFeatureFactory.js +44 -0
- package/dist/esm/Apps/Factories/AppsFeatureFactory.js.map +1 -0
- package/dist/esm/Apps/Factories/index.js +2 -0
- package/dist/esm/Apps/Factories/index.js.map +1 -0
- package/dist/esm/Apps/index.js +1 -0
- package/dist/esm/Apps/index.js.map +1 -1
- package/dist/esm/Assets/UCs/GetAssetBlobURLUC.js +8 -1
- package/dist/esm/Assets/UCs/GetAssetBlobURLUC.js.map +1 -1
- package/dist/esm/VivedAPI/Adapters/apiStageAdapter.js.map +1 -1
- package/dist/esm/VivedAPI/Adapters/index.js.map +1 -1
- package/dist/esm/VivedAPI/Adapters/userTokenAdapter.js.map +1 -1
- package/dist/esm/VivedAPI/Controllers/index.js.map +1 -1
- package/dist/esm/VivedAPI/Controllers/loginUser.js.map +1 -1
- package/dist/esm/VivedAPI/Controllers/logoutUser.js.map +1 -1
- package/dist/esm/VivedAPI/Controllers/setApiStage.js.map +1 -1
- package/dist/esm/VivedAPI/Entities/VivedAPIEntity.js.map +1 -1
- package/dist/esm/VivedAPI/Entities/index.js.map +1 -1
- package/dist/esm/VivedAPI/Factories/index.js.map +1 -1
- package/dist/esm/VivedAPI/Factories/setupVivedAPIForSandbox.js.map +1 -1
- package/dist/esm/VivedAPI/Mocks/MockJsonRequestUC.js.map +1 -1
- package/dist/esm/VivedAPI/Mocks/index.js.map +1 -1
- package/dist/esm/VivedAPI/PMs/ApiStagePM.js.map +1 -1
- package/dist/esm/VivedAPI/PMs/UserTokenPM.js.map +1 -1
- package/dist/esm/VivedAPI/PMs/index.js.map +1 -1
- package/dist/esm/VivedAPI/UCs/BasicFetchUC.js.map +1 -1
- package/dist/esm/VivedAPI/UCs/BlobRequestUC.js.map +1 -1
- package/dist/esm/VivedAPI/UCs/DeleteAssetOnAPIUC.js.map +1 -1
- package/dist/esm/VivedAPI/UCs/FileUploadUC.js.map +1 -1
- package/dist/esm/VivedAPI/UCs/JsonRequestUC.js.map +1 -1
- package/dist/esm/VivedAPI/UCs/PostNewAssetUC.js.map +1 -1
- package/dist/esm/VivedAPI/UCs/SignedAuthTokenUC.js.map +1 -1
- package/dist/esm/VivedAPI/UCs/UserAuthUC.js.map +1 -1
- package/dist/esm/VivedAPI/UCs/index.js.map +1 -1
- package/dist/esm/VivedAPI/index.js.map +1 -1
- package/dist/types/Apps/Entities/AppEntity.d.ts +40 -1
- package/dist/types/Apps/Entities/AppEntity.d.ts.map +1 -1
- package/dist/types/Apps/Factories/AppsFeatureFactory.d.ts +28 -0
- package/dist/types/Apps/Factories/AppsFeatureFactory.d.ts.map +1 -0
- package/dist/types/Apps/Factories/index.d.ts +2 -0
- package/dist/types/Apps/Factories/index.d.ts.map +1 -0
- package/dist/types/Apps/index.d.ts +1 -0
- package/dist/types/Apps/index.d.ts.map +1 -1
- package/dist/types/Assets/UCs/GetAssetBlobURLUC.d.ts +2 -1
- package/dist/types/Assets/UCs/GetAssetBlobURLUC.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiStagePM.js","sourceRoot":"","sources":["../../../../src/VivedAPI/PMs/ApiStagePM.ts"],"names":[],"mappings":";AAAA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esContent":["/**\r\n * ApiStagePM.ts\r\n *\r\n * This file defines the Presentation Manager for API stage configuration.\r\n * ApiStagePM bridges the VivedAPIEntity domain logic with UI components,\r\n * managing the display and interaction of API environment settings.\r\n *\r\n * Key concepts:\r\n * - PM extends AppObjectPM and manages view model state for API stage\r\n * - Observes VivedAPIEntity changes and updates UI accordingly\r\n * - Provides value comparison logic for efficient view updates\r\n * - Implements singleton pattern for system-wide stage management\r\n * - Handles API stage transitions and notifications\r\n *\r\n * Usage pattern:\r\n * 1. Get the singleton PM using ApiStagePM.get(appObjects)\r\n * 2. Connect to UI components that display/edit API stage\r\n * 3. PM automatically updates views when entity state changes\r\n * 4. Use with adapters to bind to specific UI frameworks\r\n */\r\n\r\nimport {\r\n getSingletonComponent,\r\n AppObject,\r\n AppObjectPM,\r\n AppObjectRepo\r\n} from \"@vived/core\";\r\nimport { APIStage, VivedAPIEntity } from \"../Entities\";\r\n\r\n/**\r\n * ApiStagePM provides presentation logic for API stage configuration.\r\n * Abstract class that manages the view model for API environment settings.\r\n */\r\nexport abstract class ApiStagePM extends AppObjectPM<APIStage> {\r\n /** Unique type identifier for this component */\r\n static type = \"ApiStagePM\";\r\n\r\n /**\r\n * Retrieves the singleton ApiStagePM from the app objects repository\r\n * @param appObjects The AppObjectRepo to get the singleton from\r\n * @returns The ApiStagePM singleton or undefined if not found\r\n */\r\n static get(appObjects: AppObjectRepo) {\r\n return getSingletonComponent<ApiStagePM>(ApiStagePM.type, appObjects);\r\n }\r\n}\r\n\r\n/**\r\n * Factory function to create a new ApiStagePM instance\r\n * @param appObject The AppObject to attach the PM to\r\n * @returns A new ApiStagePM instance\r\n */\r\nexport function makeApiStagePM(appObject: AppObject): ApiStagePM {\r\n return new ApiStagePMImp(appObject);\r\n}\r\n\r\n/**\r\n * Concrete implementation of ApiStagePM\r\n * This private class handles the actual presentation logic for API stage management\r\n */\r\nclass ApiStagePMImp extends ApiStagePM {\r\n /**\r\n * Gets the VivedAPIEntity from the same app objects repository\r\n * Uses cached singleton access for efficient repeated access\r\n */\r\n private get api() {\r\n return this.getCachedSingleton<VivedAPIEntity>(VivedAPIEntity.type);\r\n }\r\n\r\n /**\r\n * Compares two APIStage values for equality to determine if view updates are needed\r\n * @param a First APIStage value to compare\r\n * @param b Second APIStage value to compare\r\n * @returns True if the values are equal, false otherwise\r\n */\r\n vmsAreEqual(a: APIStage, b: APIStage): boolean {\r\n return a === b;\r\n }\r\n\r\n /**\r\n * Handles entity change notifications and updates the view\r\n * Called when the VivedAPIEntity's API stage changes\r\n */\r\n onEntityChange = () => {\r\n if (!this.api) return;\r\n\r\n this.doUpdateView(this.api.apiStage);\r\n };\r\n\r\n /**\r\n * Constructs a new ApiStagePMImp and sets up entity observation\r\n * @param appObject The AppObject this PM belongs to\r\n */\r\n constructor(appObject: AppObject) {\r\n super(appObject, ApiStagePM.type);\r\n this.appObjects.registerSingleton(this);\r\n\r\n this.api?.addChangeObserver(this.onEntityChange);\r\n this.onEntityChange();\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserTokenPM.js","sourceRoot":"","sources":["../../../../src/VivedAPI/PMs/UserTokenPM.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAiCH,0CAEC;AAjCD,sCAKqB;AACrB,0CAA6C;AAE7C;;;GAGG;AACH,MAAsB,WAAY,SAAQ,kBAAmB;IAI3D;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAc,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC1E,CAAC;;AAXH,kCAYC;AAXC,gDAAgD;AACzC,gBAAI,GAAG,aAAa,CAAC;AAY9B;;;;GAIG;AACH,SAAgB,eAAe,CAAC,SAAoB;IAClD,OAAO,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,cAAe,SAAQ,WAAW;IAC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C;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,cAAe,SAAQ,WAAW;IACtC;;;OAGG;IACH,IAAY,OAAO;QACjB,OAAO,IAAI,CAAC,kBAAkB,CAAiB,yBAAc,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,CAAS,EAAE,CAAS;QAC9B,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAYD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QAXrC;;;WAGG;QACH,mBAAc,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,IAAI,CAAC,OAAO;gBAAE,OAAO;YAE1B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC5C,CAAC,CAAC;QAIA,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAExC,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACrD,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;CACF","sourcesContent":["/**\r\n * UserTokenPM.ts\r\n *\r\n * This file defines the Presentation Manager for user authentication token display.\r\n * UserTokenPM bridges the VivedAPIEntity token state with UI components,\r\n * managing the display and interaction of user authentication tokens.\r\n *\r\n * Key concepts:\r\n * - PM extends AppObjectPM and manages view model state for user tokens\r\n * - Observes VivedAPIEntity token changes and updates UI accordingly\r\n * - Provides value comparison logic for efficient view updates\r\n * - Implements singleton pattern for system-wide token display management\r\n * - Handles token state transitions and notifications\r\n *\r\n * Usage pattern:\r\n * 1. Get the singleton PM using UserTokenPM.get(appObjects)\r\n * 2. Connect to UI components that display user authentication tokens\r\n * 3. PM automatically updates views when entity token state changes\r\n * 4. Use with adapters to bind to specific UI frameworks\r\n */\r\n\r\nimport {\r\n getSingletonComponent,\r\n AppObject,\r\n AppObjectPM,\r\n AppObjectRepo\r\n} from \"@vived/core\";\r\nimport { VivedAPIEntity } from \"../Entities\";\r\n\r\n/**\r\n * UserTokenPM provides presentation logic for user authentication token display.\r\n * Abstract class that manages the view model for user token information.\r\n */\r\nexport abstract class UserTokenPM extends AppObjectPM<string> {\r\n /** Unique type identifier for this component */\r\n static type = \"UserTokenPM\";\r\n\r\n /**\r\n * Retrieves the singleton UserTokenPM from the app objects repository\r\n * @param appObjects The AppObjectRepo to get the singleton from\r\n * @returns The UserTokenPM singleton or undefined if not found\r\n */\r\n static get(appObjects: AppObjectRepo) {\r\n return getSingletonComponent<UserTokenPM>(UserTokenPM.type, appObjects);\r\n }\r\n}\r\n\r\n/**\r\n * Factory function to create a new UserTokenPM instance\r\n * @param appObject The AppObject to attach the PM to\r\n * @returns A new UserTokenPM instance\r\n */\r\nexport function makeUserTokenPM(appObject: AppObject): UserTokenPM {\r\n return new UserTokenPMImp(appObject);\r\n}\r\n\r\n/**\r\n * Concrete implementation of UserTokenPM\r\n * This private class handles the actual presentation logic for user token management\r\n */\r\nclass UserTokenPMImp extends UserTokenPM {\r\n /**\r\n * Gets the VivedAPIEntity from the same app objects repository\r\n * Uses cached singleton access for efficient repeated access\r\n */\r\n private get sandbox() {\r\n return this.getCachedSingleton<VivedAPIEntity>(VivedAPIEntity.type);\r\n }\r\n\r\n /**\r\n * Compares two token string values for equality to determine if view updates are needed\r\n * @param a First token string to compare\r\n * @param b Second token string to compare\r\n * @returns True if the token values are equal, false otherwise\r\n */\r\n vmsAreEqual(a: string, b: string): boolean {\r\n return a === b;\r\n }\r\n\r\n /**\r\n * Handles entity change notifications and updates the view\r\n * Called when the VivedAPIEntity's user token changes\r\n */\r\n onEntityChange = () => {\r\n if (!this.sandbox) return;\r\n\r\n this.doUpdateView(this.sandbox.userToken);\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, UserTokenPM.type);\r\n this.appObjects.registerSingleton(this);\r\n\r\n this.sandbox?.addChangeObserver(this.onEntityChange);\r\n this.onEntityChange();\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/PMs/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;AAEH,+CAA6B;AAC7B,gDAA8B","sourcesContent":["/**\r\n * VivedAPI Presentation Managers Index\r\n
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/PMs/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;AAEH,+CAA6B;AAC7B,gDAA8B","sourcesContent":["/**\r\n * VivedAPI Presentation Managers Index\r\n *\r\n * This module exports all presentation manager classes for the VivedAPI feature.\r\n * Presentation managers bridge the gap between domain entities and user interface\r\n * components, providing view model management and change notification systems.\r\n *\r\n * Key Concepts:\r\n * - PMs extend AppObjectPM and manage view state for specific domain concepts\r\n * - They observe entity changes and update connected UI components\r\n * - PMs provide value comparison logic for efficient view update optimization\r\n * - They handle the conversion between domain models and view models\r\n * - PMs implement observer patterns for reactive UI updates\r\n *\r\n * Available Presentation Managers:\r\n * - ApiStagePM: Manages view state for API environment configuration\r\n * - UserTokenPM: Manages view state for user authentication token display\r\n */\r\n\r\nexport * from \"./ApiStagePM\";\r\nexport * from \"./UserTokenPM\";\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasicFetchUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/BasicFetchUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,sCAKqB;AAgBrB;;;GAGG;AACH,MAAsB,YAAa,SAAQ,kBAAW;IAYpD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAC,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;;AAnBH,oCAoBC;AAnBC,gDAAgD;AACzC,iBAAI,GAAG,cAAc,CAAC","sourcesContent":["/**\r\n * BasicFetchUC.ts\r\n
|
|
1
|
+
{"version":3,"file":"BasicFetchUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/BasicFetchUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,sCAKqB;AAgBrB;;;GAGG;AACH,MAAsB,YAAa,SAAQ,kBAAW;IAYpD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAC,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;;AAnBH,oCAoBC;AAnBC,gDAAgD;AACzC,iBAAI,GAAG,cAAc,CAAC","sourcesContent":["/**\r\n * BasicFetchUC.ts\r\n *\r\n * This file defines the core Use Case for making basic HTTP fetch requests.\r\n * BasicFetchUC provides a standardized interface for HTTP operations that return\r\n * raw Response objects rather than parsed JSON data.\r\n *\r\n * Key concepts:\r\n * - Abstract UC defining the interface for basic HTTP fetch operations\r\n * - Supports all standard HTTP methods (GET, POST, PUT, PATCH, DELETE)\r\n * - Returns raw Response objects for flexible response handling\r\n * - Handles request headers, parameters, and body data\r\n * - Implements singleton pattern for system-wide request handling\r\n *\r\n * Usage pattern:\r\n * 1. Get the singleton UC using BasicFetchUC.get(appObjects)\r\n * 2. Call doRequest with URL and request options\r\n * 3. Handle the returned Promise with raw Response object\r\n * 4. Process response data according to content type and needs\r\n */\r\n\r\nimport {\r\n getSingletonComponent,\r\n AppObject,\r\n AppObjectRepo,\r\n AppObjectUC\r\n} from \"@vived/core\";\r\n\r\n/**\r\n * Configuration options for basic HTTP fetch requests\r\n */\r\nexport interface BasicFetchOptions {\r\n /** HTTP headers to include in the request */\r\n headers?: any;\r\n /** HTTP method for the request */\r\n method: \"GET\" | \"PATCH\" | \"POST\" | \"PUT\" | \"DELETE\" | undefined;\r\n /** URL parameters to include in the request */\r\n params?: any;\r\n /** Request body data for POST/PUT/PATCH requests */\r\n body?: any;\r\n}\r\n\r\n/**\r\n * BasicFetchUC provides functionality for making basic HTTP fetch requests.\r\n * Abstract class that defines the interface for HTTP operations returning raw Response objects.\r\n */\r\nexport abstract class BasicFetchUC extends AppObjectUC {\r\n /** Unique type identifier for this component */\r\n static type = \"BasicFetchUC\";\r\n\r\n /**\r\n * Performs a basic HTTP fetch request to the specified URL\r\n * @param url The target URL for the request\r\n * @param options Optional configuration for the request\r\n * @returns Promise resolving to the raw Response object\r\n */\r\n abstract doRequest(url: URL, options?: BasicFetchOptions): Promise<Response>;\r\n\r\n /**\r\n * Retrieves the singleton BasicFetchUC from the app objects repository\r\n * @param appObjects The AppObjectRepo to get the singleton from\r\n * @returns The BasicFetchUC singleton or undefined if not found\r\n */\r\n static get(appObjects: AppObjectRepo): BasicFetchUC | undefined {\r\n return getSingletonComponent(BasicFetchUC.type, appObjects);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlobRequestUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/BlobRequestUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,sCAKqB;AAgBrB;;;GAGG;AACH,MAAsB,aAAc,SAAQ,kBAAW;IAYrD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;;AAnBH,sCAoBC;AAnBC,gDAAgD;AACzC,kBAAI,GAAG,eAAe,CAAC","sourcesContent":["/**\r\n * BlobRequestUC.ts\r\n
|
|
1
|
+
{"version":3,"file":"BlobRequestUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/BlobRequestUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,sCAKqB;AAgBrB;;;GAGG;AACH,MAAsB,aAAc,SAAQ,kBAAW;IAYrD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;;AAnBH,sCAoBC;AAnBC,gDAAgD;AACzC,kBAAI,GAAG,eAAe,CAAC","sourcesContent":["/**\r\n * BlobRequestUC.ts\r\n *\r\n * This file defines the Use Case for making HTTP requests that return binary data as Blobs.\r\n * BlobRequestUC provides functionality for downloading files, images, and other binary\r\n * content from API endpoints, returning the data as Blob objects for further processing.\r\n *\r\n * Key concepts:\r\n * - Abstract UC defining the interface for binary data HTTP requests\r\n * - Supports all standard HTTP methods for blob retrieval\r\n * - Returns Blob objects suitable for file downloads or binary processing\r\n * - Handles request headers, parameters, and body data\r\n * - Implements singleton pattern for system-wide blob request handling\r\n *\r\n * Usage pattern:\r\n * 1. Get the singleton UC using BlobRequestUC.get(appObjects)\r\n * 2. Call doRequest with URL and request options\r\n * 3. Handle the returned Promise with Blob object\r\n * 4. Process blob data for downloads, display, or further operations\r\n */\r\n\r\nimport {\r\n getSingletonComponent,\r\n AppObject,\r\n AppObjectRepo,\r\n AppObjectUC\r\n} from \"@vived/core\";\r\n\r\n/**\r\n * Configuration options for binary blob HTTP requests\r\n */\r\nexport interface RequestBlobOptions {\r\n /** HTTP headers to include in the request */\r\n headers?: any;\r\n /** HTTP method for the request */\r\n method: \"GET\" | \"PATCH\" | \"POST\" | \"PUT\" | \"DELETE\" | undefined;\r\n /** URL parameters to include in the request */\r\n params?: any;\r\n /** Request body data for POST/PUT/PATCH requests */\r\n body?: any;\r\n}\r\n\r\n/**\r\n * BlobRequestUC provides functionality for making HTTP requests that return binary data.\r\n * Abstract class that defines the interface for blob/binary data retrieval operations.\r\n */\r\nexport abstract class BlobRequestUC extends AppObjectUC {\r\n /** Unique type identifier for this component */\r\n static type = \"BlobRequestUC\";\r\n\r\n /**\r\n * Performs an HTTP request that returns binary data as a Blob\r\n * @param url The target URL for the request\r\n * @param options Optional configuration for the request\r\n * @returns Promise resolving to the response data as a Blob\r\n */\r\n abstract doRequest(url: URL, options?: RequestBlobOptions): Promise<Blob>;\r\n\r\n /**\r\n * Retrieves the singleton BlobRequestUC from the app objects repository\r\n * @param appObjects The AppObjectRepo to get the singleton from\r\n * @returns The BlobRequestUC singleton or undefined if not found\r\n */\r\n static get(appObjects: AppObjectRepo): BlobRequestUC | undefined {\r\n return getSingletonComponent(BlobRequestUC.type, appObjects);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteAssetOnAPIUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/DeleteAssetOnAPIUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AA0CH,wDAIC;AA5CD,sCAKqB;AACrB,+DAA4D;AAC5D,mDAAoE;AACpE,2DAAwD;AAExD;;;GAGG;AACH,MAAsB,kBAAmB,SAAQ,kBAAW;IAW1D;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAC,kBAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACpE,CAAC;;AAlBH,gDAmBC;AAlBC,gDAAgD;AACzC,uBAAI,GAAG,oBAAoB,CAAC;AAmBrC;;;;GAIG;AACH,SAAgB,sBAAsB,CACpC,SAAoB;IAEpB,OAAO,IAAI,gBAAgB,CAAC,SAAS,CAAC,CAAC;AACzC,CAAC;AAED;;;GAGG;AACH,MAAM,gBAAiB,SAAQ,kBAAkB;IAC/C,IAAY,aAAa;QACvB,OAAO,IAAI,CAAC,kBAAkB,CAAgB,6BAAa,CAAC,IAAI,CAAC;YAC/D,EAAE,SAAS,CAAC;IAChB,CAAC;IAED,IAAY,YAAY;QACtB,OAAO,IAAI,C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G,CAAC,OAAe,EAAiB,EAAE;YAC5C,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC/B,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;YAEzC,IAAI,CAAC,YAAY,IAAI,CAAC,QAAQ,IAAI,CAAC,aAAa,EAAE,CAAC;gBACjD,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC;YAC1B,CAAC;YAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBACrC,YAAY,EAAE;qBACX,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;oBACd,MAAM,OAAO,GAAG,QAAQ,CAAC,cAAc,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;oBAE7D,MAAM,OAAO,GAAuB;wBAClC,MAAM,EAAE,QAAQ;wBAChB,OAAO,EAAE;4BACP,aAAa,EAAE,SAAS,GAAG,KAAK;yBACjC;qBACF,CAAC;oBAEF,OAAO,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBACzC,CAAC,CAAC;qBACD,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;oBACV,OAAO,EAAE,CAAC;gBACZ,CAAC,CAAC;qBACD,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;oBACX,MAAM,CAAC,CAAC,CAAC,CAAC;oBACV,OAAO;gBACT,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAIA,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["/**\r\n * DeleteAssetOnAPIUC.ts\r\n *\r\n * This file defines the Use Case for deleting assets via the VIVED API.\r\n * DeleteAssetOnAPIUC handles the workflow of removing asset records from\r\n * the backend storage system through authenticated API requests.\r\n *\r\n * Key concepts:\r\n * - Orchestrates asset deletion through API endpoints\r\n * - Manages authentication tokens for authorized deletion requests\r\n * - Coordinates between JsonRequestUC and SignedAuthTokenUC\r\n * - Handles error cases and provides feedback for deletion operations\r\n * - Ensures proper cleanup of asset data and metadata\r\n *\r\n * Usage pattern:\r\n * 1. Get a UC instance using DeleteAssetOnAPIUC.get(appObjects) or makeDeleteAssetOnAPIUC\r\n * 2. Call doDelete with the asset ID to remove\r\n * 3. Handle the returned Promise for deletion completion\r\n * 4. UC manages authentication and API communication details\r\n */\r\n\r\nimport {\r\n getSingletonComponent,\r\n AppObject,\r\n AppObjectRepo,\r\n AppObjectUC\r\n} from \"@vived/core\";\r\nimport { VivedAPIEntity } from \"../Entities/VivedAPIEntity\";\r\nimport { JsonRequestUC, RequestJSONOptions } from \"./JsonRequestUC\";\r\nimport { SignedAuthTokenUC } from \"./SignedAuthTokenUC\";\r\n\r\n/**\r\n * DeleteAssetOnAPIUC provides functionality for deleting assets via API.\r\n * Abstract class that defines the interface for asset deletion operations.\r\n */\r\nexport abstract class DeleteAssetOnAPIUC extends AppObjectUC {\r\n /** Unique type identifier for this component */\r\n static type = \"DeleteAssetOnAPIUC\";\r\n\r\n /**\r\n * Deletes an asset from the API by its ID\r\n * @param assetID The unique identifier of the asset to delete\r\n * @returns Promise that resolves when deletion is complete\r\n */\r\n abstract doDelete(assetID: string): Promise<void>;\r\n\r\n /**\r\n * Retrieves a DeleteAssetOnAPIUC component from an AppObject\r\n * @param appObjects The AppObjectRepo to get the component from\r\n * @returns The DeleteAssetOnAPIUC component or undefined if not found\r\n */\r\n static get(appObjects: AppObjectRepo): DeleteAssetOnAPIUC | undefined {\r\n return getSingletonComponent(DeleteAssetOnAPIUC.type, appObjects);\r\n }\r\n}\r\n\r\n/**\r\n * Factory function to create a new DeleteAssetOnAPIUC instance\r\n * @param appObject The AppObject to attach the UC to\r\n * @returns A new DeleteAssetOnAPIUC instance\r\n */\r\nexport function makeDeleteAssetOnAPIUC(\r\n appObject: AppObject\r\n): DeleteAssetOnAPIUC {\r\n return new DeleteAssetUCImp(appObject);\r\n}\r\n\r\n/**\r\n * Concrete implementation of DeleteAssetOnAPIUC\r\n * This private class handles the actual asset deletion workflow\r\n */\r\nclass DeleteAssetUCImp extends DeleteAssetOnAPIUC {\r\n private get jsonRequester() {\r\n return this.getCachedSingleton<JsonRequestUC>(JsonRequestUC.type)\r\n ?.doRequest;\r\n }\r\n\r\n private get getAuthToken() {\r\n return this.getCachedSingleton<SignedAuthTokenUC>(SignedAuthTokenUC.type)\r\n ?.getAuthToken;\r\n }\r\n\r\n private get vivedAPI() {\r\n return this.getCachedSingleton<VivedAPIEntity>(VivedAPIEntity.type);\r\n }\r\n\r\n doDelete = (assetID: string): Promise<void> => {\r\n const getAuthToken = this.getAuthToken;\r\n const vivedAPI = this.vivedAPI;\r\n const jsonRequester = this.jsonRequester;\r\n\r\n if (!getAuthToken || !vivedAPI || !jsonRequester) {\r\n return Promise.reject();\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n getAuthToken()\r\n .then((token) => {\r\n const postURL = vivedAPI.getEndpointURL(`assets/${assetID}`);\r\n\r\n const options: RequestJSONOptions = {\r\n method: \"DELETE\",\r\n headers: {\r\n Authorization: \"Bearer \" + token\r\n }\r\n };\r\n\r\n return jsonRequester(postURL, options);\r\n })\r\n .then((_) => {\r\n resolve();\r\n })\r\n .catch((e) => {\r\n reject(e);\r\n return;\r\n });\r\n });\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, DeleteAssetOnAPIUC.type);\r\n this.appObjects.registerSingleton(this);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploadUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/FileUploadUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AA0CH,4CAEC;AA1CD,sCAKqB;AACrB,+DAA4D;AAC5D,iDAAiE;AACjE,mDAAgD;AAEhD;;;GAGG;AACH,MAAsB,YAAa,S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C,6BAA6B,IAAI,CAAC,IAAI,EAAE,CACzC,CAAC;gBAEF,WAAW,CAAC,YAAY,CAAC;qBACtB,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE;oBAClB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,SAAmB,CAAC,CAAC;oBACzC,MAAM,OAAO,GAAsB;wBACjC,MAAM,EAAE,KAAK;wBACb,IAAI,EAAE,IAAI;qBACX,CAAC;oBAEF,OAAO,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;gBAClC,CAAC,CAAC;qBACD,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;oBACV,OAAO,EAAE,CAAC;gBACZ,CAAC,CAAC;qBACD,KAAK,CAAC,CAAC,CAAQ,EAAE,EAAE;oBAClB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;oBACrB,MAAM,CAAC,CAAC,CAAC,CAAC;gBACZ,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAIA,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["/**\r\n * FileUploadUC.ts\r\n
|
|
1
|
+
{"version":3,"file":"FileUploadUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/FileUploadUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AA0CH,4CAEC;AA1CD,sCAKqB;AACrB,+DAA4D;AAC5D,iDAAiE;AACjE,mDAAgD;AAEhD;;;GAGG;AACH,MAAsB,YAAa,SAAQ,kBAAW;IAWpD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAC,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;;AAlBH,oCAmBC;AAlBC,gDAAgD;AACzC,iBAAI,GAAG,cAAc,CAAC;AAmB/B;;;;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KAAK;wBACb,IAAI,EAAE,IAAI;qBACX,CAAC;oBAEF,OAAO,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;gBAClC,CAAC,CAAC;qBACD,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;oBACV,OAAO,EAAE,CAAC;gBACZ,CAAC,CAAC;qBACD,KAAK,CAAC,CAAC,CAAQ,EAAE,EAAE;oBAClB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;oBACrB,MAAM,CAAC,CAAC,CAAC,CAAC;gBACZ,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAIA,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["/**\r\n * FileUploadUC.ts\r\n *\r\n * This file defines the Use Case for uploading files to the VIVED API.\r\n * FileUploadUC handles the process of uploading file data to storage endpoints,\r\n * managing multipart form data and upload progress.\r\n *\r\n * Key concepts:\r\n * - Abstract UC defining the interface for file upload operations\r\n * - Handles file upload workflows with progress tracking\r\n * - Coordinates with BasicFetchUC for HTTP transport\r\n * - Manages multipart form data encoding and transmission\r\n * - Provides error handling for upload failures\r\n *\r\n * Usage pattern:\r\n * 1. Get a UC instance using FileUploadUC.get(appObjects) or makeFileUploadUC\r\n * 2. Call doUpload with File object to upload\r\n * 3. Handle the returned Promise for upload completion\r\n * 4. UC manages the HTTP upload mechanics and error handling\r\n */\r\n\r\nimport {\r\n getSingletonComponent,\r\n AppObject,\r\n AppObjectRepo,\r\n AppObjectUC\r\n} from \"@vived/core\";\r\nimport { VivedAPIEntity } from \"../Entities/VivedAPIEntity\";\r\nimport { BasicFetchOptions, BasicFetchUC } from \"./BasicFetchUC\";\r\nimport { JsonRequestUC } from \"./JsonRequestUC\";\r\n\r\n/**\r\n * FileUploadUC provides functionality for uploading files to APIs.\r\n * Abstract class that defines the interface for file upload operations.\r\n */\r\nexport abstract class FileUploadUC extends AppObjectUC {\r\n /** Unique type identifier for this component */\r\n static type = \"FileUploadUC\";\r\n\r\n /**\r\n * Uploads a file to the configured API endpoint\r\n * @param file The File object to upload\r\n * @returns Promise that resolves when upload is complete\r\n */\r\n abstract doUpload(file: File): Promise<void>;\r\n\r\n /**\r\n * Retrieves a FileUploadUC component from an AppObject\r\n * @param appObjects The AppObjectRepo to get the component from\r\n * @returns The FileUploadUC component or undefined if not found\r\n */\r\n static get(appObjects: AppObjectRepo): FileUploadUC | undefined {\r\n return getSingletonComponent(FileUploadUC.type, appObjects);\r\n }\r\n}\r\n\r\n/**\r\n * Factory function to create a new FileUploadUC instance\r\n * @param appObject The AppObject to attach the UC to\r\n * @returns A new FileUploadUC instance\r\n */\r\nexport function makeFileUploadUC(appObject: AppObject): FileUploadUC {\r\n return new FileUploadUCImp(appObject);\r\n}\r\n\r\n/**\r\n * Concrete implementation of FileUploadUC\r\n * This private class handles the actual file upload mechanics\r\n */\r\nclass FileUploadUCImp extends FileUploadUC {\r\n private get vivedAPI(): VivedAPIEntity | undefined {\r\n return this.getCachedSingleton<VivedAPIEntity>(VivedAPIEntity.type);\r\n }\r\n\r\n private get requestJSON() {\r\n return this.getCachedSingleton<JsonRequestUC>(JsonRequestUC.type)\r\n ?.doRequest;\r\n }\r\n\r\n private get basicFetch() {\r\n return this.getCachedSingleton<BasicFetchUC>(BasicFetchUC.type)?.doRequest;\r\n }\r\n\r\n doUpload = (file: File): Promise<void> => {\r\n const vivedAPI = this.vivedAPI;\r\n const requestJSON = this.requestJSON;\r\n const basicFetch = this.basicFetch;\r\n\r\n if (!vivedAPI || !requestJSON || !basicFetch) {\r\n return Promise.reject();\r\n }\r\n return new Promise<void>((resolve, reject) => {\r\n const getUploadURL = vivedAPI.getEndpointURL(\r\n `upload/large/DataVariants/${file.name}`\r\n );\r\n\r\n requestJSON(getUploadURL)\r\n .then((uploadURL) => {\r\n const url = new URL(uploadURL as string);\r\n const options: BasicFetchOptions = {\r\n method: \"PUT\",\r\n body: file\r\n };\r\n\r\n return basicFetch(url, options);\r\n })\r\n .then((_) => {\r\n resolve();\r\n })\r\n .catch((e: Error) => {\r\n this.warn(e.message);\r\n reject(e);\r\n });\r\n });\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, FileUploadUC.type);\r\n this.appObjects.registerSingleton(this);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonRequestUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/JsonRequestUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,sCAKqB;AAgBrB;;;GAGG;AACH,MAAsB,aAAc,SAAQ,kBAAW;IAYrD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;;AAnBH,sCAoBC;AAnBC,gDAAgD;AACzC,kBAAI,GAAG,eAAe,CAAC","sourcesContent":["/**\r\n * JsonRequestUC.ts\r\n
|
|
1
|
+
{"version":3,"file":"JsonRequestUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/JsonRequestUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,sCAKqB;AAgBrB;;;GAGG;AACH,MAAsB,aAAc,SAAQ,kBAAW;IAYrD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;;AAnBH,sCAoBC;AAnBC,gDAAgD;AACzC,kBAAI,GAAG,eAAe,CAAC","sourcesContent":["/**\r\n * JsonRequestUC.ts\r\n *\r\n * This file defines the core Use Case for making JSON HTTP requests to APIs.\r\n * JsonRequestUC provides a standardized interface for HTTP operations with JSON payloads,\r\n * supporting various HTTP methods and request configurations.\r\n *\r\n * Key concepts:\r\n * - Abstract UC defining the interface for JSON HTTP requests\r\n * - Supports GET, POST, PUT, PATCH, DELETE HTTP methods\r\n * - Handles request headers, parameters, and body data\r\n * - Returns Promise-based responses for async operations\r\n * - Implements singleton pattern for system-wide request handling\r\n *\r\n * Usage pattern:\r\n * 1. Get the singleton UC using JsonRequestUC.get(appObjects)\r\n * 2. Call doRequest with URL and request options\r\n * 3. Handle the returned Promise with response data or errors\r\n * 4. Use with VivedAPIEntity to construct endpoint URLs\r\n */\r\n\r\nimport {\r\n getSingletonComponent,\r\n AppObject,\r\n AppObjectRepo,\r\n AppObjectUC\r\n} from \"@vived/core\";\r\n\r\n/**\r\n * Configuration options for JSON HTTP requests\r\n */\r\nexport interface RequestJSONOptions {\r\n /** HTTP headers to include in the request */\r\n headers?: any;\r\n /** HTTP method for the request */\r\n method: \"GET\" | \"PATCH\" | \"POST\" | \"PUT\" | \"DELETE\" | undefined;\r\n /** URL parameters to include in the request */\r\n params?: any;\r\n /** Request body data for POST/PUT/PATCH requests */\r\n body?: any;\r\n}\r\n\r\n/**\r\n * JsonRequestUC provides functionality for making JSON HTTP requests.\r\n * Abstract class that defines the interface for HTTP operations with JSON payloads.\r\n */\r\nexport abstract class JsonRequestUC extends AppObjectUC {\r\n /** Unique type identifier for this component */\r\n static type = \"JsonRequestUC\";\r\n\r\n /**\r\n * Performs a JSON HTTP request to the specified URL\r\n * @param url The target URL for the request\r\n * @param options Optional configuration for the request\r\n * @returns Promise resolving to the response data\r\n */\r\n abstract doRequest(url: URL, options?: RequestJSONOptions): Promise<any>;\r\n\r\n /**\r\n * Retrieves the singleton JsonRequestUC from the app objects repository\r\n * @param appObjects The AppObjectRepo to get the singleton from\r\n * @returns The JsonRequestUC singleton or undefined if not found\r\n */\r\n static get(appObjects: AppObjectRepo): JsonRequestUC | undefined {\r\n return getSingletonComponent(JsonRequestUC.type, appObjects);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +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W;wBACX,QAAQ;qBACT,CAAC;oBAEF,MAAM,OAAO,GAAuB;wBAClC,MAAM,EAAE,MAAM;wBACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;wBAC1B,OAAO,EAAE;4BACP,aAAa,EAAE,SAAS,GAAG,KAAK;yBACjC;qBACF,CAAC;oBAEF,OAAO,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBACzC,CAAC,CAAC;qBACD,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;oBACf,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;oBACzB,OAAO,CAAC;wBACN,EAAE,EAAE,OAAO;wBACX,QAAQ;qBACT,CAAC,CAAC;gBACL,CAAC,CAAC;qBACD,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;oBACX,MAAM,CAAC,CAAC,CAAC,CAAC;oBACV,OAAO;gBACT,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAIA,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["/**\r\n * PostNewAssetUC.ts\r\n
|
|
1
|
+
{"version":3,"file":"PostNewAssetUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/PostNewAssetUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAoEH,gDAEC;AApED,sCAMqB;AACrB,+DAA4D;AAC5D,iDAA8C;AAC9C,mDAAoE;AACpE,2DAAwD;AA0BxD;;;GAGG;AACH,MAAsB,cAAe,SAAQ,kBAAW;IAWtD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAC,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAChE,CAAC;;AAlBH,wCAmBC;AAlBC,gDAAgD;AACzC,mBAAI,GAAG,gBAAgB,CAAC;AAmBjC;;;;G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X,MAAM,CAAC,CAAC,CAAC,CAAC;oBACV,OAAO;gBACT,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAIA,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["/**\r\n * PostNewAssetUC.ts\r\n *\r\n * This file defines the Use Case for creating new assets via the VIVED API.\r\n * PostNewAssetUC handles the complete workflow of uploading asset files and\r\n * creating asset metadata records through API requests.\r\n *\r\n * Key concepts:\r\n * - Orchestrates file upload and metadata creation for new assets\r\n * - Handles multipart file uploads with asset information\r\n * - Manages authentication tokens and API endpoints\r\n * - Coordinates between multiple UCs (JsonRequest, FileUpload, SignedAuthToken)\r\n * - Returns asset creation response with generated IDs\r\n *\r\n * Usage pattern:\r\n * 1. Get a UC instance using PostNewAssetUC.get(appObjects) or makePostNewAssetUC\r\n * 2. Call doPost with asset data including file and metadata\r\n * 3. Handle the returned Promise with asset creation response\r\n * 4. UC will coordinate authentication, file upload, and API requests\r\n */\r\n\r\nimport {\r\n AppObject,\r\n AppObjectRepo,\r\n AppObjectUC,\r\n generateUniqueID,\r\n getSingletonComponent\r\n} from \"@vived/core\";\r\nimport { VivedAPIEntity } from \"../Entities/VivedAPIEntity\";\r\nimport { FileUploadUC } from \"./FileUploadUC\";\r\nimport { JsonRequestUC, RequestJSONOptions } from \"./JsonRequestUC\";\r\nimport { SignedAuthTokenUC } from \"./SignedAuthTokenUC\";\r\n\r\n/**\r\n * Data transfer object for new asset creation requests\r\n */\r\nexport interface NewAssetApiDto {\r\n /** Display name for the new asset */\r\n name: string;\r\n /** Description text for the asset */\r\n description: string;\r\n /** ID of the user who will own this asset */\r\n ownerID: string;\r\n /** File object containing the asset data */\r\n file: File;\r\n}\r\n\r\n/**\r\n * Response data transfer object for successful asset creation\r\n */\r\nexport interface NewAssetResponseDTO {\r\n /** Unique identifier assigned to the new asset */\r\n id: string;\r\n /** Final filename used for the stored asset file */\r\n filename: string;\r\n}\r\n\r\n/**\r\n * PostNewAssetUC provides functionality for creating new assets via API.\r\n * Abstract class that defines the interface for asset creation operations.\r\n */\r\nexport abstract class PostNewAssetUC extends AppObjectUC {\r\n /** Unique type identifier for this component */\r\n static type = \"PostNewAssetUC\";\r\n\r\n /**\r\n * Creates a new asset by uploading file and metadata to the API\r\n * @param data The asset creation data including file and metadata\r\n * @returns Promise resolving to the new asset response with ID and filename\r\n */\r\n abstract doPost(data: NewAssetApiDto): Promise<NewAssetResponseDTO>;\r\n\r\n /**\r\n * Retrieves a PostNewAssetUC component from an AppObject\r\n * @param appObjects The AppObjectRepo to get the component from\r\n * @returns The PostNewAssetUC component or undefined if not found\r\n */\r\n static get(appObjects: AppObjectRepo): PostNewAssetUC | undefined {\r\n return getSingletonComponent(PostNewAssetUC.type, appObjects);\r\n }\r\n}\r\n\r\n/**\r\n * Factory function to create a new PostNewAssetUC instance\r\n * @param appObject The AppObject to attach the UC to\r\n * @returns A new PostNewAssetUC instance\r\n */\r\nexport function makePostNewAssetUC(appObject: AppObject): PostNewAssetUC {\r\n return new PostNewAssetUCImp(appObject);\r\n}\r\n\r\n/**\r\n * Concrete implementation of PostNewAssetUC\r\n * This private class handles the actual asset creation workflow\r\n */\r\nclass PostNewAssetUCImp extends PostNewAssetUC {\r\n private get jsonRequester() {\r\n return this.getCachedSingleton<JsonRequestUC>(JsonRequestUC.type)\r\n ?.doRequest;\r\n }\r\n\r\n private get getPlayerAuthToken() {\r\n return this.getCachedSingleton<SignedAuthTokenUC>(SignedAuthTokenUC.type)\r\n ?.getAuthToken;\r\n }\r\n\r\n private get fileUploader() {\r\n return this.getCachedSingleton<FileUploadUC>(FileUploadUC.type)?.doUpload;\r\n }\r\n\r\n private get vivedAPI() {\r\n return this.getCachedSingleton<VivedAPIEntity>(VivedAPIEntity.type);\r\n }\r\n\r\n doPost = (data: NewAssetApiDto): Promise<NewAssetResponseDTO> => {\r\n const fileUploader = this.fileUploader;\r\n const getPlayerAuthToken = this.getPlayerAuthToken;\r\n const vivedAPI = this.vivedAPI;\r\n const jsonRequester = this.jsonRequester;\r\n\r\n if (!fileUploader || !getPlayerAuthToken || !vivedAPI || !jsonRequester) {\r\n return Promise.reject();\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const { description, file, name, ownerID } = data;\r\n let assetId: string;\r\n\r\n const nameSplits = file.name.split(\".\");\r\n const extension = nameSplits[nameSplits.length - 1];\r\n const filename = `${generateUniqueID()}.${extension}`;\r\n const assetFile = new File([file], filename, {\r\n lastModified: Date.now()\r\n });\r\n\r\n fileUploader(assetFile)\r\n .then((_) => {\r\n return getPlayerAuthToken();\r\n })\r\n .then((token) => {\r\n const postURL = vivedAPI.getEndpointURL(\"assets\");\r\n\r\n const body = {\r\n ownerId: ownerID,\r\n name,\r\n description,\r\n filename\r\n };\r\n\r\n const options: RequestJSONOptions = {\r\n method: \"POST\",\r\n body: JSON.stringify(body),\r\n headers: {\r\n Authorization: \"Bearer \" + token\r\n }\r\n };\r\n\r\n return jsonRequester(postURL, options);\r\n })\r\n .then((result) => {\r\n assetId = result.assetId;\r\n resolve({\r\n id: assetId,\r\n filename\r\n });\r\n })\r\n .catch((e) => {\r\n reject(e);\r\n return;\r\n });\r\n });\r\n };\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, PostNewAssetUC.type);\r\n this.appObjects.registerSingleton(this);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignedAuthTokenUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/SignedAuthTokenUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,sCAAgF;AAEhF;;;GAGG;AACH,MAAsB,iBAAkB,SAAQ,kBAAW;IAUzD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAC,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACnE,CAAC;;AAjBH,8CAkBC;AAjBC,gDAAgD;AACzC,sBAAI,GAAG,mBAAmB,CAAC","sourcesContent":["/**\r\n * SignedAuthTokenUC.ts\r\n
|
|
1
|
+
{"version":3,"file":"SignedAuthTokenUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/SignedAuthTokenUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,sCAAgF;AAEhF;;;GAGG;AACH,MAAsB,iBAAkB,SAAQ,kBAAW;IAUzD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAC,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACnE,CAAC;;AAjBH,8CAkBC;AAjBC,gDAAgD;AACzC,sBAAI,GAAG,mBAAmB,CAAC","sourcesContent":["/**\r\n * SignedAuthTokenUC.ts\r\n *\r\n * This file defines the Use Case for retrieving signed authentication tokens.\r\n * SignedAuthTokenUC provides functionality for obtaining JWT or signed tokens\r\n * used to authenticate API requests with the VIVED backend services.\r\n *\r\n * Key concepts:\r\n * - Abstract UC defining the interface for authentication token retrieval\r\n * - Handles token generation, validation, and renewal workflows\r\n * - Provides secure access to authentication credentials\r\n * - Implements singleton pattern for system-wide token management\r\n * - Returns promises for async token operations\r\n *\r\n * Usage pattern:\r\n * 1. Get the singleton UC using SignedAuthTokenUC.get(appObjects)\r\n * 2. Call getAuthToken to retrieve current valid authentication token\r\n * 3. Handle the returned Promise with token string or errors\r\n * 4. Use token for authorizing subsequent API requests\r\n */\r\n\r\nimport { AppObjectRepo, AppObjectUC, getSingletonComponent } from \"@vived/core\";\r\n\r\n/**\r\n * SignedAuthTokenUC provides functionality for retrieving authentication tokens.\r\n * Abstract class that defines the interface for authentication token operations.\r\n */\r\nexport abstract class SignedAuthTokenUC extends AppObjectUC {\r\n /** Unique type identifier for this component */\r\n static type = \"SignedAuthTokenUC\";\r\n\r\n /**\r\n * Retrieves a valid signed authentication token\r\n * @returns Promise resolving to the authentication token string\r\n */\r\n abstract getAuthToken(): Promise<string>;\r\n\r\n /**\r\n * Retrieves the singleton SignedAuthTokenUC from the app objects repository\r\n * @param appObjects The AppObjectRepo to get the singleton from\r\n * @returns The SignedAuthTokenUC singleton or undefined if not found\r\n */\r\n static get(appObjects: AppObjectRepo): SignedAuthTokenUC | undefined {\r\n return getSingletonComponent(SignedAuthTokenUC.type, appObjects);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAuthUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/UserAuthUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,sCAAgF;AAEhF;;;GAGG;AACH,MAAsB,UAAW,SAAQ,kBAAW;IAwBlD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC5D,CAAC;;AA/BH,gCAgCC;AA/BC,gDAAgD;AACzC,eAAI,GAAG,YAAY,CAAC","sourcesContent":["/**\r\n * UserAuthUC.ts\r\n
|
|
1
|
+
{"version":3,"file":"UserAuthUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/UserAuthUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,sCAAgF;AAEhF;;;GAGG;AACH,MAAsB,UAAW,SAAQ,kBAAW;IAwBlD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC5D,CAAC;;AA/BH,gCAgCC;AA/BC,gDAAgD;AACzC,eAAI,GAAG,YAAY,CAAC","sourcesContent":["/**\r\n * UserAuthUC.ts\r\n *\r\n * This file defines the Use Case for user authentication operations.\r\n * UserAuthUC provides functionality for managing user login, logout, and\r\n * authentication refresh workflows with the VIVED API services.\r\n *\r\n * Key concepts:\r\n * - Abstract UC defining the interface for user authentication operations\r\n * - Handles login with username/password credentials\r\n * - Manages logout and session termination\r\n * - Provides authentication refresh for token renewal\r\n * - Implements singleton pattern for system-wide authentication management\r\n * - Coordinates with VivedAPIEntity for token storage\r\n *\r\n * Usage pattern:\r\n * 1. Get the singleton UC using UserAuthUC.get(appObjects)\r\n * 2. Call login with user credentials for authentication\r\n * 3. Use logout to terminate user sessions\r\n * 4. Call refreshAuthenticatedUser to renew authentication tokens\r\n */\r\n\r\nimport { getSingletonComponent, AppObjectRepo, AppObjectUC } from \"@vived/core\";\r\n\r\n/**\r\n * UserAuthUC provides functionality for user authentication operations.\r\n * Abstract class that defines the interface for login, logout, and token refresh operations.\r\n */\r\nexport abstract class UserAuthUC extends AppObjectUC {\r\n /** Unique type identifier for this component */\r\n static type = \"UserAuthUC\";\r\n\r\n /**\r\n * Authenticates a user with username and password credentials\r\n * @param username The user's login username\r\n * @param password The user's login password\r\n * @returns Promise that resolves when login is complete\r\n */\r\n abstract login(username: string, password: string): Promise<void>;\r\n\r\n /**\r\n * Logs out the current user and terminates the session\r\n * @returns Promise that resolves when logout is complete\r\n */\r\n abstract logout(): Promise<void>;\r\n\r\n /**\r\n * Refreshes the current user's authentication token\r\n * @returns Promise that resolves when token refresh is complete\r\n */\r\n abstract refreshAuthenticatedUser(): Promise<void>;\r\n\r\n /**\r\n * Retrieves the singleton UserAuthUC from the app objects repository\r\n * @param appObjects The AppObjectRepo to get the singleton from\r\n * @returns The UserAuthUC singleton or undefined if not found\r\n */\r\n static get(appObjects: AppObjectRepo): UserAuthUC | undefined {\r\n return getSingletonComponent(UserAuthUC.type, appObjects);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;AAEH,iDAA+B;AAC/B,kDAAgC;AAChC,uDAAqC;AACrC,4DAA0C;AAC1C,4DAA0C;AAC1C,iDAA+B;AAC/B,oDAAkC;AAClC,+DAA6C;AAC7C,kDAAgC;AAChC,qDAAmC;AACnC,2DAAyC;AACzC,qDAAmC;AACnC,iDAA+B;AAC/B,mDAAiC;AACjC,sDAAoC;AACpC,+CAA6B","sourcesContent":["/**\r\n * VivedAPI Use Cases Index\r\n
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;AAEH,iDAA+B;AAC/B,kDAAgC;AAChC,uDAAqC;AACrC,4DAA0C;AAC1C,4DAA0C;AAC1C,iDAA+B;AAC/B,oDAAkC;AAClC,+DAA6C;AAC7C,kDAAgC;AAChC,qDAAmC;AACnC,2DAAyC;AACzC,qDAAmC;AACnC,iDAA+B;AAC/B,mDAAiC;AACjC,sDAAoC;AACpC,+CAA6B","sourcesContent":["/**\r\n * VivedAPI Use Cases Index\r\n *\r\n * This module exports all use case classes for the VivedAPI feature.\r\n * Use cases contain the business logic for API operations and coordinate\r\n * between entities, external services, and user interface components.\r\n *\r\n * Key Concepts:\r\n * - Use cases implement specific API operations and workflows\r\n * - They coordinate between entities, HTTP requests, and authentication\r\n * - Each UC handles validation, error management, and API communication\r\n * - Some UCs manage singleton operations, others handle per-request workflows\r\n * - UCs provide clean interfaces for controllers and other components\r\n *\r\n * Available Use Cases:\r\n * - HTTP Operations: BasicFetchUC, JsonRequestUC, BlobRequestUC\r\n * - Authentication: SignedAuthTokenUC, UserAuthUC\r\n * - File Management: FileUploadUC, FetchAssetFileFromAPIUC, PatchAssetFileUC\r\n * - Asset Operations: PostNewAssetUC, DeleteAssetOnAPIUC, GetAssetsForOwnerFromAPIUC\r\n * - Asset Metadata: FetchAssetMetaFromAPIUC, PatchAssetMetaUC, PatchAssetIsArchivedUC\r\n * - App Management: GetAppFromAPIUC\r\n * - Asset Updates: PatchAssetUC\r\n */\r\n\r\nexport * from \"./BasicFetchUC\";\r\nexport * from \"./BlobRequestUC\";\r\nexport * from \"./DeleteAssetOnAPIUC\";\r\nexport * from \"./FetchAssetFileFromAPIUC\";\r\nexport * from \"./FetchAssetMetaFromAPIUC\";\r\nexport * from \"./FileUploadUC\";\r\nexport * from \"./GetAppFromAPIUC\";\r\nexport * from \"./GetAssetsForOwnerFromAPIUC\";\r\nexport * from \"./JsonRequestUC\";\r\nexport * from \"./PatchAssetFileUC\";\r\nexport * from \"./PatchAssetIsArchivedUC\";\r\nexport * from \"./PatchAssetMetaUC\";\r\nexport * from \"./PatchAssetUC\";\r\nexport * from \"./PostNewAssetUC\";\r\nexport * from \"./SignedAuthTokenUC\";\r\nexport * from \"./UserAuthUC\";\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/VivedAPI/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;;;;;;;;;;;;;;AAEH,6CAA2B;AAC3B,gDAA8B;AAC9B,6CAA2B;AAC3B,8CAA4B;AAC5B,0CAAwB;AACxB,wCAAsB;AACtB,wCAAsB","sourcesContent":["/**\r\n * VivedAPI Feature Index\r\n
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/VivedAPI/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;;;;;;;;;;;;;;AAEH,6CAA2B;AAC3B,gDAA8B;AAC9B,6CAA2B;AAC3B,8CAA4B;AAC5B,0CAAwB;AACxB,wCAAsB;AACtB,wCAAsB","sourcesContent":["/**\r\n * VivedAPI Feature Index\r\n *\r\n * This module serves as the main entry point for the VivedAPI feature, providing\r\n * centralized access to all API-related components and functionality.\r\n *\r\n * The VivedAPI feature handles communication with VIVED backend services,\r\n * including authentication, asset management, and application data synchronization.\r\n *\r\n * Key Concepts:\r\n * - Provides unified API communication infrastructure for the host application\r\n * - Manages authentication tokens and user sessions\r\n * - Handles file uploads, downloads, and asset operations\r\n * - Supports multiple API environments (Production, Staging, Development, Local)\r\n * - Implements clean architecture patterns with separation of concerns\r\n *\r\n * Architecture Components:\r\n * - Entities: Core business objects for API configuration and state management\r\n * - Use Cases: Business logic for API operations and workflows\r\n * - Presentation Managers: Bridge between domain logic and UI components\r\n * - Controllers: Handle user inputs and coordinate feature operations\r\n * - Adapters: Interface with external UI frameworks and libraries\r\n * - Factories: Component creation and feature setup utilities\r\n * - Mocks: Test doubles for development and testing scenarios\r\n */\r\n\r\nexport * from \"./Adapters\";\r\nexport * from \"./Controllers\";\r\nexport * from \"./Entities\";\r\nexport * from \"./Factories\";\r\nexport * from \"./Mocks\";\r\nexport * from \"./PMs\";\r\nexport * from \"./UCs\";\r\n"]}
|
|
@@ -24,14 +24,75 @@ export var AppState;
|
|
|
24
24
|
* @extends AppObjectEntity from @vived/core
|
|
25
25
|
*/
|
|
26
26
|
export class AppEntity extends AppObjectEntity {
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Retrieves an AppEntity from a specific AppObject
|
|
29
|
+
* @param appObj - The AppObject to retrieve the AppEntity from
|
|
30
|
+
* @returns The AppEntity instance if found, undefined otherwise
|
|
31
|
+
* @throws Error if appObj is null or undefined
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const appObject = appObjects.getOrCreate("myApp");
|
|
35
|
+
* const appEntity = AppEntity.get(appObject);
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
static get(appObj) {
|
|
39
|
+
if (!appObj) {
|
|
40
|
+
throw new Error("AppObject cannot be null or undefined");
|
|
41
|
+
}
|
|
42
|
+
return appObj.getComponent(AppEntity.type);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Retrieves an AppEntity by ID from the AppObjectRepo
|
|
46
|
+
* @param id - The unique identifier of the app
|
|
47
|
+
* @param appObjects - The AppObjectRepo to search within
|
|
48
|
+
* @returns The AppEntity instance if found, undefined otherwise
|
|
49
|
+
* @throws Error if id is empty or appObjects is null
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const appEntity = AppEntity.getById("myAppId", appObjects);
|
|
53
|
+
* if (appEntity) {
|
|
54
|
+
* console.log(`Found app: ${appEntity.name}`);
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
static getById(id, appObjects) {
|
|
59
|
+
if (!id) {
|
|
60
|
+
throw new Error("ID cannot be empty");
|
|
61
|
+
}
|
|
62
|
+
if (!appObjects) {
|
|
63
|
+
throw new Error("AppObjectRepo cannot be null or undefined");
|
|
64
|
+
}
|
|
28
65
|
const ao = appObjects.get(id);
|
|
29
66
|
if (!ao) {
|
|
30
|
-
appObjects.submitWarning("AppEntity.
|
|
67
|
+
appObjects.submitWarning("AppEntity.getById", `Unable to find app object by ID: ${id}`);
|
|
31
68
|
return;
|
|
32
69
|
}
|
|
33
70
|
return ao.getComponent(AppEntity.type);
|
|
34
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Safely creates an AppEntity if it doesn't already exist on the AppObject
|
|
74
|
+
* @param appObject - The AppObject to add the AppEntity to
|
|
75
|
+
* @returns The AppEntity instance (existing or newly created)
|
|
76
|
+
* @throws Error if appObject is null or undefined
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* const appObject = appObjects.getOrCreate("newApp");
|
|
80
|
+
* const appEntity = AppEntity.addIfMissing(appObject);
|
|
81
|
+
* // appEntity is guaranteed to exist
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
static addIfMissing(appObject) {
|
|
85
|
+
if (!appObject) {
|
|
86
|
+
throw new Error("AppObject cannot be null or undefined");
|
|
87
|
+
}
|
|
88
|
+
// Check if AppEntity already exists
|
|
89
|
+
const existingEntity = appObject.getComponent(AppEntity.type);
|
|
90
|
+
if (existingEntity) {
|
|
91
|
+
return existingEntity;
|
|
92
|
+
}
|
|
93
|
+
// Create new AppEntity if it doesn't exist
|
|
94
|
+
return makeAppEntity(appObject);
|
|
95
|
+
}
|
|
35
96
|
}
|
|
36
97
|
/** Type identifier for the AppEntity component */
|
|
37
98
|
AppEntity.type = "AppEntity";
|
|
@@ -49,29 +110,29 @@ class AppEntityImp extends AppEntity {
|
|
|
49
110
|
return this.appObject.id;
|
|
50
111
|
}
|
|
51
112
|
get name() {
|
|
52
|
-
return this.
|
|
113
|
+
return this.memoizedName.val;
|
|
53
114
|
}
|
|
54
115
|
set name(val) {
|
|
55
|
-
this.
|
|
116
|
+
this.memoizedName.val = val;
|
|
56
117
|
}
|
|
57
118
|
get description() {
|
|
58
|
-
return this.
|
|
119
|
+
return this.memoizedDescription.val;
|
|
59
120
|
}
|
|
60
121
|
set description(val) {
|
|
61
|
-
this.
|
|
122
|
+
this.memoizedDescription.val = val;
|
|
62
123
|
}
|
|
63
124
|
get image_url() {
|
|
64
|
-
return this.
|
|
125
|
+
return this.memoizedImageUrl.val;
|
|
65
126
|
}
|
|
66
127
|
set image_url(val) {
|
|
67
|
-
this.
|
|
128
|
+
this.memoizedImageUrl.val = val;
|
|
68
129
|
}
|
|
69
130
|
get imageAssetId() {
|
|
70
|
-
const value = this.
|
|
131
|
+
const value = this.memoizedImageAssetId.val;
|
|
71
132
|
return value === "" ? undefined : value;
|
|
72
133
|
}
|
|
73
134
|
set imageAssetId(val) {
|
|
74
|
-
this.
|
|
135
|
+
this.memoizedImageAssetId.val = val ?? "";
|
|
75
136
|
}
|
|
76
137
|
get latestVersion() {
|
|
77
138
|
return Version.GetLatest(this.versions);
|
|
@@ -125,10 +186,10 @@ class AppEntityImp extends AppEntity {
|
|
|
125
186
|
}
|
|
126
187
|
constructor(appObject) {
|
|
127
188
|
super(appObject, AppEntity.type);
|
|
128
|
-
this.
|
|
129
|
-
this.
|
|
130
|
-
this.
|
|
131
|
-
this.
|
|
189
|
+
this.memoizedName = new MemoizedString("", this.notifyOnChange);
|
|
190
|
+
this.memoizedDescription = new MemoizedString("", this.notifyOnChange);
|
|
191
|
+
this.memoizedImageUrl = new MemoizedString("", this.notifyOnChange);
|
|
192
|
+
this.memoizedImageAssetId = new MemoizedString("", this.notifyOnChange);
|
|
132
193
|
this.versions = [];
|
|
133
194
|
this._state = AppState.INIT;
|
|
134
195
|
this._assignedToOwner = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppEntity.js","sourceRoot":"","sources":["../../../../src/Apps/Entities/AppEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEf,OAAO,EACP,cAAc,EACf,MAAM,aAAa,CAAC;AAErB;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,+BAAmB,CAAA;IACnB,2BAAe,CAAA;IACf,2BAAe,CAAA;AACjB,CAAC,EALW,QAAQ,KAAR,QAAQ,QAKnB;AAED;;;;;;;GAOG;AACH,MAAM,OAAgB,SAAU,SAAQ,eAAe;IAIrD,MAAM,CAAC,GAAG,CAAC,EAAU,EAAE,UAAyB;QAC9C,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,aAAa,CACtB,eAAe,EACf,oCAAoC,EAAE,EAAE,CACzC,CAAC;YACF,OAAO;QACT,CAAC;QAED,OAAO,EAAE,CAAC,YAAY,CAAY,SAAS,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;;AAdD,kDAAkD;AAC3C,cAAI,GAAG,WAAW,CAAC;AAkC5B;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,SAAoB;IAChD,OAAO,IAAI,YAAY,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rD,CAAC;IAED,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QApH3B,kBAAa,GAAmB,IAAI,cAAc,CACxD,EAAE,EACF,IAAI,CAAC,cAAc,CACpB,CAAC;QAUM,yBAAoB,GAAmB,IAAI,cAAc,CAC/D,EAAE,EACF,IAAI,CAAC,cAAc,CACpB,CAAC;QAUM,sBAAiB,GAAmB,IAAI,cAAc,CAC5D,EAAE,EACF,IAAI,CAAC,cAAc,CACpB,CAAC;QAUM,0BAAqB,GAAG,IAAI,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAW5E,aAAQ,GAAc,EAAE,CAAC;QA0BjB,WAAM,GAAa,QAAQ,CAAC,IAAI,CAAC;QASjC,qBAAgB,GAAY,KAAK,CAAC;QAa1C,WAAM,GAAa,EAAE,CAAC;IAmBtB,CAAC;CACF","sourcesContent":["import {\n AppObject,\n AppObjectEntity,\n AppObjectRepo,\n Version,\n MemoizedString\n} from \"@vived/core\";\n\n/**\n * Enum representing the possible states of an application\n *\n * @enum {string}\n * @property {string} INIT - Initial state before app loading starts\n * @property {string} LOADING - App is currently loading resources\n * @property {string} READY - App is loaded and ready to use\n * @property {string} ERROR - App encountered an error during loading\n */\nexport enum AppState {\n INIT = \"INIT\",\n LOADING = \"LOADING\",\n READY = \"READY\",\n ERROR = \"ERROR\"\n}\n\n/**\n * AppEntity - Core entity representing an application in the system\n *\n * This abstract class defines the properties and behaviors of an application.\n * It manages app state, versioning, mounting status, and error handling.\n *\n * @extends AppObjectEntity from @vived/core\n */\nexport abstract class AppEntity extends AppObjectEntity {\n /** Type identifier for the AppEntity component */\n static type = \"AppEntity\";\n\n static get(id: string, appObjects: AppObjectRepo) {\n const ao = appObjects.get(id);\n if (!ao) {\n appObjects.submitWarning(\n \"AppEntity.get\",\n `Unable to find app object by ID: ${id}`\n );\n return;\n }\n\n return ao.getComponent<AppEntity>(AppEntity.type);\n }\n\n abstract get id(): string;\n abstract name: string;\n abstract description: string;\n abstract image_url: string;\n abstract imageAssetId: string | undefined;\n abstract versions: Version[];\n abstract get latestVersion(): Version | undefined;\n abstract errorMessage?: string;\n abstract get hasError(): boolean;\n abstract state: AppState;\n abstract assignedToOwner: boolean;\n\n abstract get isMounted(): boolean;\n abstract appAssetFolderURL?: string;\n abstract get updateIsAvailable(): boolean | undefined;\n abstract styles: string[];\n abstract mountedVersion: Version | undefined;\n}\n\n/**\n * Factory function to create a new AppEntity instance\n *\n * @param appObject - The app object to attach the entity to\n * @returns A concrete implementation of AppEntity\n */\nexport function makeAppEntity(appObject: AppObject): AppEntity {\n return new AppEntityImp(appObject);\n}\n\nclass AppEntityImp extends AppEntity {\n get id() {\n return this.appObject.id;\n }\n\n private _memoizedName: MemoizedString = new MemoizedString(\n \"\",\n this.notifyOnChange\n );\n\n get name(): string {\n return this._memoizedName.val;\n }\n\n set name(val: string) {\n this._memoizedName.val = val;\n }\n\n private _memoizedDescription: MemoizedString = new MemoizedString(\n \"\",\n this.notifyOnChange\n );\n\n get description(): string {\n return this._memoizedDescription.val;\n }\n\n set description(val: string) {\n this._memoizedDescription.val = val;\n }\n\n private _memoizedImageUrl: MemoizedString = new MemoizedString(\n \"\",\n this.notifyOnChange\n );\n\n get image_url(): string {\n return this._memoizedImageUrl.val;\n }\n\n set image_url(val: string) {\n this._memoizedImageUrl.val = val;\n }\n\n private _memoizedImageAssetId = new MemoizedString(\"\", this.notifyOnChange);\n\n get imageAssetId(): string | undefined {\n const value = this._memoizedImageAssetId.val;\n return value === \"\" ? undefined : value;\n }\n\n set imageAssetId(val: string | undefined) {\n this._memoizedImageAssetId.val = val ?? \"\";\n }\n\n versions: Version[] = [];\n\n get latestVersion(): Version | undefined {\n return Version.GetLatest(this.versions);\n }\n\n private _mountedVersion: Version | undefined;\n get mountedVersion() {\n return this._mountedVersion;\n }\n set mountedVersion(val: Version | undefined) {\n if (this._mountedVersion === val) return;\n\n this._mountedVersion = val;\n this.notifyOnChange();\n }\n\n get updateIsAvailable(): boolean | undefined {\n if (this._mountedVersion === undefined) return undefined;\n if (this.latestVersion === undefined) return undefined;\n\n return Version.AreEqual(this._mountedVersion, this.latestVersion)\n ? false\n : true;\n }\n\n private _state: AppState = AppState.INIT;\n get state() {\n return this._state;\n }\n set state(val: AppState) {\n this._state = val;\n this.notifyOnChange();\n }\n\n private _assignedToOwner: boolean = false;\n get assignedToOwner(): boolean {\n return this._assignedToOwner;\n }\n set assignedToOwner(val: boolean) {\n this._assignedToOwner = val;\n this.notifyOnChange();\n }\n\n get isMounted(): boolean {\n return this._mountedVersion === undefined ? false : true;\n }\n\n styles: string[] = [];\n appAssetFolderURL: string | undefined;\n\n private _errorMsg?: string;\n get errorMessage() {\n return this._errorMsg;\n }\n set errorMessage(val: string | undefined) {\n if (this._errorMsg === val) return;\n\n this._errorMsg = val;\n this.notifyOnChange();\n }\n get hasError(): boolean {\n return this._errorMsg === undefined ? false : true;\n }\n\n constructor(appObject: AppObject) {\n super(appObject, AppEntity.type);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AppEntity.js","sourceRoot":"","sources":["../../../../src/Apps/Entities/AppEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEf,OAAO,EACP,cAAc,EACf,MAAM,aAAa,CAAC;AAErB;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,+BAAmB,CAAA;IACnB,2BAAe,CAAA;IACf,2BAAe,CAAA;AACjB,CAAC,EALW,QAAQ,KAAR,QAAQ,QAKnB;AAED;;;;;;;GAOG;AACH,MAAM,OAAgB,SAAU,SAAQ,eAAe;IAIrD;;;;;;;;;;OAUG;IACH,MAAM,CAAC,GAAG,CAAC,MAAiB;QAC1B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QACD,OA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GAAmB,IAAI,cAAc,CACvD,EAAE,EACF,IAAI,CAAC,cAAc,CACpB,CAAC;QAUM,wBAAmB,GAAmB,IAAI,cAAc,CAC9D,EAAE,EACF,IAAI,CAAC,cAAc,CACpB,CAAC;QAUM,qBAAgB,GAAmB,IAAI,cAAc,CAC3D,EAAE,EACF,IAAI,CAAC,cAAc,CACpB,CAAC;QAUM,yBAAoB,GAAG,IAAI,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAW3E,aAAQ,GAAc,EAAE,CAAC;QA0BjB,WAAM,GAAa,QAAQ,CAAC,IAAI,CAAC;QASjC,qBAAgB,GAAY,KAAK,CAAC;QAa1C,WAAM,GAAa,EAAE,CAAC;IAmBtB,CAAC;CACF","sourcesContent":["import {\r\n AppObject,\r\n AppObjectEntity,\r\n AppObjectRepo,\r\n Version,\r\n MemoizedString\r\n} from \"@vived/core\";\r\n\r\n/**\r\n * Enum representing the possible states of an application\r\n *\r\n * @enum {string}\r\n * @property {string} INIT - Initial state before app loading starts\r\n * @property {string} LOADING - App is currently loading resources\r\n * @property {string} READY - App is loaded and ready to use\r\n * @property {string} ERROR - App encountered an error during loading\r\n */\r\nexport enum AppState {\r\n INIT = \"INIT\",\r\n LOADING = \"LOADING\",\r\n READY = \"READY\",\r\n ERROR = \"ERROR\"\r\n}\r\n\r\n/**\r\n * AppEntity - Core entity representing an application in the system\r\n *\r\n * This abstract class defines the properties and behaviors of an application.\r\n * It manages app state, versioning, mounting status, and error handling.\r\n *\r\n * @extends AppObjectEntity from @vived/core\r\n */\r\nexport abstract class AppEntity extends AppObjectEntity {\r\n /** Type identifier for the AppEntity component */\r\n static type = \"AppEntity\";\r\n\r\n /**\r\n * Retrieves an AppEntity from a specific AppObject\r\n * @param appObj - The AppObject to retrieve the AppEntity from\r\n * @returns The AppEntity instance if found, undefined otherwise\r\n * @throws Error if appObj is null or undefined\r\n * @example\r\n * ```typescript\r\n * const appObject = appObjects.getOrCreate(\"myApp\");\r\n * const appEntity = AppEntity.get(appObject);\r\n * ```\r\n */\r\n static get(appObj: AppObject): AppEntity | undefined {\r\n if (!appObj) {\r\n throw new Error(\"AppObject cannot be null or undefined\");\r\n }\r\n return appObj.getComponent<AppEntity>(AppEntity.type);\r\n }\r\n\r\n /**\r\n * Retrieves an AppEntity by ID from the AppObjectRepo\r\n * @param id - The unique identifier of the app\r\n * @param appObjects - The AppObjectRepo to search within\r\n * @returns The AppEntity instance if found, undefined otherwise\r\n * @throws Error if id is empty or appObjects is null\r\n * @example\r\n * ```typescript\r\n * const appEntity = AppEntity.getById(\"myAppId\", appObjects);\r\n * if (appEntity) {\r\n * console.log(`Found app: ${appEntity.name}`);\r\n * }\r\n * ```\r\n */\r\n static getById(id: string, appObjects: AppObjectRepo): AppEntity | undefined {\r\n if (!id) {\r\n throw new Error(\"ID cannot be empty\");\r\n }\r\n if (!appObjects) {\r\n throw new Error(\"AppObjectRepo cannot be null or undefined\");\r\n }\r\n\r\n const ao = appObjects.get(id);\r\n if (!ao) {\r\n appObjects.submitWarning(\r\n \"AppEntity.getById\",\r\n `Unable to find app object by ID: ${id}`\r\n );\r\n return;\r\n }\r\n\r\n return ao.getComponent<AppEntity>(AppEntity.type);\r\n }\r\n\r\n /**\r\n * Safely creates an AppEntity if it doesn't already exist on the AppObject\r\n * @param appObject - The AppObject to add the AppEntity to\r\n * @returns The AppEntity instance (existing or newly created)\r\n * @throws Error if appObject is null or undefined\r\n * @example\r\n * ```typescript\r\n * const appObject = appObjects.getOrCreate(\"newApp\");\r\n * const appEntity = AppEntity.addIfMissing(appObject);\r\n * // appEntity is guaranteed to exist\r\n * ```\r\n */\r\n static addIfMissing(appObject: AppObject): AppEntity {\r\n if (!appObject) {\r\n throw new Error(\"AppObject cannot be null or undefined\");\r\n }\r\n\r\n // Check if AppEntity already exists\r\n const existingEntity = appObject.getComponent<AppEntity>(AppEntity.type);\r\n if (existingEntity) {\r\n return existingEntity;\r\n }\r\n\r\n // Create new AppEntity if it doesn't exist\r\n return makeAppEntity(appObject);\r\n }\r\n\r\n abstract get id(): string;\r\n abstract name: string;\r\n abstract description: string;\r\n abstract image_url: string;\r\n abstract imageAssetId: string | undefined;\r\n abstract versions: Version[];\r\n abstract get latestVersion(): Version | undefined;\r\n abstract errorMessage?: string;\r\n abstract get hasError(): boolean;\r\n abstract state: AppState;\r\n abstract assignedToOwner: boolean;\r\n\r\n abstract get isMounted(): boolean;\r\n abstract appAssetFolderURL?: string;\r\n abstract get updateIsAvailable(): boolean | undefined;\r\n abstract styles: string[];\r\n abstract mountedVersion: Version | undefined;\r\n}\r\n\r\n/**\r\n * Factory function to create a new AppEntity instance\r\n *\r\n * @param appObject - The app object to attach the entity to\r\n * @returns A concrete implementation of AppEntity\r\n */\r\nexport function makeAppEntity(appObject: AppObject): AppEntity {\r\n return new AppEntityImp(appObject);\r\n}\r\n\r\nclass AppEntityImp extends AppEntity {\r\n get id() {\r\n return this.appObject.id;\r\n }\r\n\r\n private memoizedName: MemoizedString = new MemoizedString(\r\n \"\",\r\n this.notifyOnChange\r\n );\r\n\r\n get name(): string {\r\n return this.memoizedName.val;\r\n }\r\n\r\n set name(val: string) {\r\n this.memoizedName.val = val;\r\n }\r\n\r\n private memoizedDescription: MemoizedString = new MemoizedString(\r\n \"\",\r\n this.notifyOnChange\r\n );\r\n\r\n get description(): string {\r\n return this.memoizedDescription.val;\r\n }\r\n\r\n set description(val: string) {\r\n this.memoizedDescription.val = val;\r\n }\r\n\r\n private memoizedImageUrl: MemoizedString = new MemoizedString(\r\n \"\",\r\n this.notifyOnChange\r\n );\r\n\r\n get image_url(): string {\r\n return this.memoizedImageUrl.val;\r\n }\r\n\r\n set image_url(val: string) {\r\n this.memoizedImageUrl.val = val;\r\n }\r\n\r\n private memoizedImageAssetId = new MemoizedString(\"\", this.notifyOnChange);\r\n\r\n get imageAssetId(): string | undefined {\r\n const value = this.memoizedImageAssetId.val;\r\n return value === \"\" ? undefined : value;\r\n }\r\n\r\n set imageAssetId(val: string | undefined) {\r\n this.memoizedImageAssetId.val = val ?? \"\";\r\n }\r\n\r\n versions: Version[] = [];\r\n\r\n get latestVersion(): Version | undefined {\r\n return Version.GetLatest(this.versions);\r\n }\r\n\r\n private _mountedVersion: Version | undefined;\r\n get mountedVersion() {\r\n return this._mountedVersion;\r\n }\r\n set mountedVersion(val: Version | undefined) {\r\n if (this._mountedVersion === val) return;\r\n\r\n this._mountedVersion = val;\r\n this.notifyOnChange();\r\n }\r\n\r\n get updateIsAvailable(): boolean | undefined {\r\n if (this._mountedVersion === undefined) return undefined;\r\n if (this.latestVersion === undefined) return undefined;\r\n\r\n return Version.AreEqual(this._mountedVersion, this.latestVersion)\r\n ? false\r\n : true;\r\n }\r\n\r\n private _state: AppState = AppState.INIT;\r\n get state() {\r\n return this._state;\r\n }\r\n set state(val: AppState) {\r\n this._state = val;\r\n this.notifyOnChange();\r\n }\r\n\r\n private _assignedToOwner: boolean = false;\r\n get assignedToOwner(): boolean {\r\n return this._assignedToOwner;\r\n }\r\n set assignedToOwner(val: boolean) {\r\n this._assignedToOwner = val;\r\n this.notifyOnChange();\r\n }\r\n\r\n get isMounted(): boolean {\r\n return this._mountedVersion === undefined ? false : true;\r\n }\r\n\r\n styles: string[] = [];\r\n appAssetFolderURL: string | undefined;\r\n\r\n private _errorMsg?: string;\r\n get errorMessage() {\r\n return this._errorMsg;\r\n }\r\n set errorMessage(val: string | undefined) {\r\n if (this._errorMsg === val) return;\r\n\r\n this._errorMsg = val;\r\n this.notifyOnChange();\r\n }\r\n get hasError(): boolean {\r\n return this._errorMsg === undefined ? false : true;\r\n }\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject, AppEntity.type);\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DomainFactory } from "@vived/core";
|
|
2
|
+
import { makeAppRepo } from "../Entities";
|
|
3
|
+
import { makeAppsListPM } from "../PMs";
|
|
4
|
+
/**
|
|
5
|
+
* Factory responsible for setting up the Apps domain components.
|
|
6
|
+
* This factory initializes all entities, use cases, and presentation models
|
|
7
|
+
* required for the Apps functionality.
|
|
8
|
+
*/
|
|
9
|
+
export class AppsFeatureFactory extends DomainFactory {
|
|
10
|
+
constructor(appObject) {
|
|
11
|
+
super(appObject);
|
|
12
|
+
// Unique name for this factory
|
|
13
|
+
this.factoryName = "AppsFeatureFactory";
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Sets up all entities required for the Apps system
|
|
17
|
+
*/
|
|
18
|
+
setupEntities() {
|
|
19
|
+
this.appRepoAO = this.appObjects.getOrCreate("App Repository");
|
|
20
|
+
// Initialize entities
|
|
21
|
+
makeAppRepo(this.appRepoAO);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Sets up all use cases for the Apps system
|
|
25
|
+
*/
|
|
26
|
+
setupUCs() {
|
|
27
|
+
// Note: App UCs have complex dependencies and should be set up
|
|
28
|
+
// separately to avoid circular dependencies during factory initialization
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Sets up all presentation managers for the Apps system
|
|
32
|
+
*/
|
|
33
|
+
setupPMs() {
|
|
34
|
+
// App Repository PMs
|
|
35
|
+
makeAppsListPM(this.appRepoAO);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Performs any final setup operations after all components are initialized
|
|
39
|
+
*/
|
|
40
|
+
finalSetup() {
|
|
41
|
+
// No additional setup required for apps
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=AppsFeatureFactory.js.map
|
|
@@ -0,0 +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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Apps/Factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC","sourcesContent":["export * from \"./AppsFeatureFactory\";\r\n"]}
|
package/dist/esm/Apps/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Apps/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC","sourcesContent":["/**\n * Apps Module - Core module for managing application lifecycle in the VIVED Learning platform\n *\n * This module handles app loading, mounting, starting, stopping, and state management.\n * It follows a clean architecture pattern with the following layers:\n *\n * - Entities: Core domain models (AppEntity, AppRepo)\n * - PMs (Presentation Models): Business logic and state management\n * - UCs (Use Cases): Implementation of specific operations\n * - Adapters: Connect PMs to UI components\n * - Controllers: Entry points for UI interactions\n *\n * To use this module, typically you would:\n * 1. Load an app using the AppEntity\n * 2. Mount the app using MounterUC\n * 3. Start the app using StartAppUC\n * 4. Manage app state via the AppPM or ActiveAppPM\n * 5. Stop the app using StopAppUC when done\n */\n\nexport * from \"./Adapters\";\nexport * from \"./Controllers\";\nexport * from \"./Entities\";\nexport * from \"./Mocks\";\nexport * from \"./PMs\";\nexport * from \"./UCs\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Apps/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC","sourcesContent":["/**\r\n * Apps Module - Core module for managing application lifecycle in the VIVED Learning platform\r\n *\r\n * This module handles app loading, mounting, starting, stopping, and state management.\r\n * It follows a clean architecture pattern with the following layers:\r\n *\r\n * - Entities: Core domain models (AppEntity, AppRepo)\r\n * - PMs (Presentation Models): Business logic and state management\r\n * - UCs (Use Cases): Implementation of specific operations\r\n * - Adapters: Connect PMs to UI components\r\n * - Controllers: Entry points for UI interactions\r\n *\r\n * To use this module, typically you would:\r\n * 1. Load an app using the AppEntity\r\n * 2. Mount the app using MounterUC\r\n * 3. Start the app using StartAppUC\r\n * 4. Manage app state via the AppPM or ActiveAppPM\r\n * 5. Stop the app using StopAppUC when done\r\n */\r\n\r\nexport * from \"./Adapters\";\r\nexport * from \"./Controllers\";\r\nexport * from \"./Entities\";\r\nexport * from \"./Factories\";\r\nexport * from \"./Mocks\";\r\nexport * from \"./PMs\";\r\nexport * from \"./UCs\";\r\n"]}
|
|
@@ -102,9 +102,10 @@ class GetAssetBlobURLUCImp extends GetAssetBlobURLUC {
|
|
|
102
102
|
* population of higher-level caches for future access optimization.
|
|
103
103
|
*
|
|
104
104
|
* @param assetID - The unique identifier of the asset
|
|
105
|
+
* @param useCache - Optional flag to control caching behavior (defaults to true)
|
|
105
106
|
* @returns Promise resolving to a blob URL for the asset file
|
|
106
107
|
*/
|
|
107
|
-
this.getAssetBlobURL = (assetID) => {
|
|
108
|
+
this.getAssetBlobURL = (assetID, useCache = true) => {
|
|
108
109
|
const assetRepo = this.assetRepo;
|
|
109
110
|
const getAsset = this.getAsset;
|
|
110
111
|
const fetchAssetFile = this.fetchAssetFile;
|
|
@@ -113,6 +114,12 @@ class GetAssetBlobURLUCImp extends GetAssetBlobURLUC {
|
|
|
113
114
|
if (!assetRepo || !getAsset || !fetchAssetFile) {
|
|
114
115
|
return Promise.reject();
|
|
115
116
|
}
|
|
117
|
+
// If cache is disabled, skip all cache checks and go directly to API
|
|
118
|
+
if (!useCache) {
|
|
119
|
+
return new Promise((resolve, reject) => {
|
|
120
|
+
this.fetchAssetNormally(assetID, resolve, reject);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
116
123
|
// Level 1: Check memory cache (existing entities with blob URLs)
|
|
117
124
|
const existing = assetRepo.get(assetID);
|
|
118
125
|
if (existing && existing.blobURL) {
|