@vived/host 4.11.0 → 4.11.1
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/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/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/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Entities/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,kBAAkB,CAAC","sourcesContent":["/**\r\n * VivedAPI Entities Index\r\n
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Entities/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,kBAAkB,CAAC","sourcesContent":["/**\r\n * VivedAPI Entities Index\r\n *\r\n * This module exports all entity classes for the VivedAPI feature.\r\n * Entities represent the core business objects and data models that store state,\r\n * track changes, and notify observers when modifications occur.\r\n *\r\n * Key Concepts:\r\n * - Entities extend AppObjectEntity and manage domain-specific data\r\n * - They use Memoized types to track changes and trigger notifications\r\n * - Singleton entities provide system-wide access to shared configuration\r\n * - Entities form the foundation for API communication and authentication\r\n *\r\n * Available Entities:\r\n * - VivedAPIEntity: Manages API configuration, authentication, and environment settings\r\n */\r\n\r\nexport * from \"./VivedAPIEntity\";\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Factories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC","sourcesContent":["/**\r\n * VivedAPI Factories Index\r\n
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Factories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC","sourcesContent":["/**\r\n * VivedAPI Factories Index\r\n *\r\n * This module exports all factory functions for the VivedAPI feature.\r\n * Factory functions provide centralized component creation and feature setup,\r\n * ensuring proper initialization and component wiring for different environments.\r\n *\r\n * Key Concepts:\r\n * - Factory functions encapsulate complex component creation workflows\r\n * - They establish proper dependencies and relationships between components\r\n * - Factories provide environment-specific setup (sandbox, production, testing)\r\n * - They ensure singleton registration and component availability\r\n * - Factory functions serve as entry points for feature initialization\r\n *\r\n * Available Factories:\r\n * - setupVivedAPIForSandbox: Complete feature setup for sandbox environments\r\n */\r\n\r\nexport * from \"./setupVivedAPIForSandbox\";\r\nexport * from \"./VivedAPIFactory\";\r\nexport * from \"./setupAPI\";\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupVivedAPIForSandbox.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Factories/setupVivedAPIForSandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,gBAAgB,EAChB,mBAAmB,EACnB,8BAA8B,EAC9B,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,QAAQ,CAAC;AAEhB;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,UAAyB;IAC/D,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAE/C,WAAW;IACX,IAAI,cAAc,CAAC,EAAE,CAAC,CAAC;IAEvB,MAAM;IACN,sBAAsB,CAAC,EAAE,CAAC,CAAC;IAC3B,2BAA2B,CAAC,EAAE,CAAC,CAAC;IAChC,2BAA2B,CAAC,EAAE,CAAC,CAAC;IAChC,gBAAgB,CAAC,EAAE,CAAC,CAAC;IACrB,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACxB,8BAA8B,CAAC,EAAE,CAAC,CAAC;IACnC,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACzB,0BAA0B,CAAC,EAAE,CAAC,CAAC;IAC/B,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACzB,gBAAgB,CAAC,EAAE,CAAC,CAAC;IACrB,kBAAkB,CAAC,EAAE,CAAC,CAAC;IAEvB,MAAM;IACN,eAAe,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC","sourcesContent":["/**\r\n * setupVivedAPIForSandbox.ts\r\n
|
|
1
|
+
{"version":3,"file":"setupVivedAPIForSandbox.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Factories/setupVivedAPIForSandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,gBAAgB,EAChB,mBAAmB,EACnB,8BAA8B,EAC9B,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,QAAQ,CAAC;AAEhB;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,UAAyB;IAC/D,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAE/C,WAAW;IACX,IAAI,cAAc,CAAC,EAAE,CAAC,CAAC;IAEvB,MAAM;IACN,sBAAsB,CAAC,EAAE,CAAC,CAAC;IAC3B,2BAA2B,CAAC,EAAE,CAAC,CAAC;IAChC,2BAA2B,CAAC,EAAE,CAAC,CAAC;IAChC,gBAAgB,CAAC,EAAE,CAAC,CAAC;IACrB,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACxB,8BAA8B,CAAC,EAAE,CAAC,CAAC;IACnC,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACzB,0BAA0B,CAAC,EAAE,CAAC,CAAC;IAC/B,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACzB,gBAAgB,CAAC,EAAE,CAAC,CAAC;IACrB,kBAAkB,CAAC,EAAE,CAAC,CAAC;IAEvB,MAAM;IACN,eAAe,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC","sourcesContent":["/**\r\n * setupVivedAPIForSandbox.ts\r\n *\r\n * This file defines the factory function for setting up the complete VivedAPI feature\r\n * in a sandbox environment. It initializes all necessary components including entities,\r\n * use cases, and presentation managers required for API communication.\r\n *\r\n * Key concepts:\r\n * - Factory function creates and wires up all VivedAPI components\r\n * - Creates a dedicated AppObject for organizing API-related components\r\n * - Initializes singleton entities for API configuration management\r\n * - Sets up all use cases for various API operations (assets, apps, auth)\r\n * - Establishes presentation managers for UI integration\r\n * - Provides a single entry point for complete feature setup\r\n *\r\n * Usage pattern:\r\n * 1. Call setupVivedAPIForSandbox with AppObjectRepo during initialization\r\n * 2. Function creates all necessary components and registers them\r\n * 3. Components become available through standard AppObject retrieval methods\r\n * 4. Use in sandbox environments for development and testing\r\n */\r\n\r\nimport { AppObjectRepo } from \"@vived/core\";\r\nimport { VivedAPIEntity } from \"../Entities\";\r\nimport { makeUserTokenPM } from \"../PMs\";\r\nimport {\r\n makeDeleteAssetOnAPIUC,\r\n makeFetchAssetFileFromAPIUC,\r\n makeFetchAssetMetaFromAPIUC,\r\n makeFileUploadUC,\r\n makeGetAppFromAPIUC,\r\n makeGetAssetsForOwnerFromAPIUC,\r\n makePatchAssetFileUC,\r\n makePatchAssetIsArchivedUC,\r\n makePatchAssetMetaUC,\r\n makePatchAssetUC,\r\n makePostNewAssetUC\r\n} from \"../UCs\";\r\n\r\n/**\r\n * Sets up the complete VivedAPI feature for sandbox environments\r\n * @param appObjects The AppObjectRepo to register all VivedAPI components in\r\n */\r\nexport function setupVivedAPIForSandbox(appObjects: AppObjectRepo) {\r\n const ao = appObjects.getOrCreate(\"VIVED API\");\r\n\r\n // Entities\r\n new VivedAPIEntity(ao);\r\n\r\n // UCs\r\n makeDeleteAssetOnAPIUC(ao);\r\n makeFetchAssetFileFromAPIUC(ao);\r\n makeFetchAssetMetaFromAPIUC(ao);\r\n makeFileUploadUC(ao);\r\n makeGetAppFromAPIUC(ao);\r\n makeGetAssetsForOwnerFromAPIUC(ao);\r\n makePatchAssetFileUC(ao);\r\n makePatchAssetIsArchivedUC(ao);\r\n makePatchAssetMetaUC(ao);\r\n makePatchAssetUC(ao);\r\n makePostNewAssetUC(ao);\r\n\r\n // PMs\r\n makeUserTokenPM(ao);\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MockJsonRequestUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Mocks/MockJsonRequestUC.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,aAAa;IAIlD;;;OAGG;IACH,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;QARvC,kDAAkD;QAClD,cAAS,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAQtB,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAyB;IAC7D,OAAO,IAAI,iBAAiB,CAAC,UAAU,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["/**\r\n * MockJsonRequestUC.ts\r\n
|
|
1
|
+
{"version":3,"file":"MockJsonRequestUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Mocks/MockJsonRequestUC.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,aAAa;IAIlD;;;OAGG;IACH,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;QARvC,kDAAkD;QAClD,cAAS,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAQtB,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAyB;IAC7D,OAAO,IAAI,iBAAiB,CAAC,UAAU,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["/**\r\n * MockJsonRequestUC.ts\r\n *\r\n * This file provides a mock implementation of JsonRequestUC for testing and development.\r\n * MockJsonRequestUC replaces real HTTP request functionality with Jest mock functions,\r\n * enabling controlled testing scenarios and development without live API dependencies.\r\n *\r\n * Key concepts:\r\n * - Mock extends the real JsonRequestUC class to maintain interface compatibility\r\n * - Uses Jest mock functions to provide controllable request behavior\r\n * - Enables testing of components that depend on JSON HTTP requests\r\n * - Allows simulation of various response scenarios (success, failure, delays)\r\n * - Supports isolated unit testing without external API dependencies\r\n *\r\n * Usage pattern:\r\n * 1. Use makeMockJsonRequestUC to create and register the mock\r\n * 2. Configure mock behavior using Jest mock function methods\r\n * 3. Test components can verify request calls and control responses\r\n * 4. Replace with real implementation for integration testing\r\n */\r\n\r\nimport { AppObject, AppObjectRepo } from \"@vived/core\";\r\nimport { JsonRequestUC } from \"../UCs/JsonRequestUC\";\r\n\r\n/**\r\n * Mock implementation of JsonRequestUC for testing and development\r\n * Provides Jest mock functions instead of real HTTP request functionality\r\n */\r\nexport class MockJsonRequestUC extends JsonRequestUC {\r\n /** Jest mock function for the doRequest method */\r\n doRequest = jest.fn();\r\n\r\n /**\r\n * Constructs a new MockJsonRequestUC\r\n * @param appObject The AppObject this mock UC belongs to\r\n */\r\n constructor(appObject: AppObject) {\r\n super(appObject, JsonRequestUC.type);\r\n }\r\n}\r\n\r\n/**\r\n * Factory function to create and register a MockJsonRequestUC\r\n * @param appObjects The AppObjectRepo to create the mock in\r\n * @returns A new MockJsonRequestUC instance\r\n */\r\nexport function makeMockJsonRequestUC(appObjects: AppObjectRepo) {\r\n return new MockJsonRequestUC(appObjects.getOrCreate(\"MockJsonRequestUC\"));\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Mocks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC","sourcesContent":["/**\r\n * VivedAPI Mocks Index\r\n
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Mocks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC","sourcesContent":["/**\r\n * VivedAPI Mocks Index\r\n *\r\n * This module exports all mock implementations for the VivedAPI feature.\r\n * Mocks provide test doubles and stub implementations for development and testing\r\n * scenarios where real API communication is not desired or available.\r\n *\r\n * Key Concepts:\r\n * - Mocks implement the same interfaces as production components\r\n * - They provide predictable, controllable behavior for testing\r\n * - Mocks can simulate various success and failure scenarios\r\n * - They enable development without requiring live API connections\r\n * - Mock implementations support isolated unit testing\r\n *\r\n * Available Mock Components:\r\n * - Presentation Manager Mocks: ApiStagePMMock, UserTokenPMMock\r\n * - HTTP Request Mocks: MockBasicFetchUC, MockJsonRequestUC, MockBlobRequestUC\r\n * - Authentication Mocks: MockSignedAuthToken, MockUserLoginUC\r\n * - File Operation Mocks: MockFileUpload, MockFetchAssetFileFromAPIUC, MockPatchAssetFileUC\r\n * - Asset Management Mocks: MockPostNewAssetUC, MockDeleteAssetOnAPIUC, MockGetAssetsForOwnerUC\r\n * - Asset Metadata Mocks: MockFetchAssetMetaFromAPIUC, MockPatchAssetMetaUC, MockPatchAssetIsArchivedUC\r\n * - App Management Mocks: MockGetAppFromAPIUC\r\n * - Asset Update Mocks: MockPatchAssetUC\r\n */\r\n\r\nexport * from \"./ApiStagePMMock\";\r\nexport * from \"./MockBasicFetchUC\";\r\nexport * from \"./MockBlobRequestUC\";\r\nexport * from \"./MockDeleteAssetOnAPIUC\";\r\nexport * from \"./MockFetchAssetFileFromAPIUC\";\r\nexport * from \"./MockFetchAssetMetaFromAPIUC\";\r\nexport * from \"./MockFileUpload\";\r\nexport * from \"./MockGetAppFromAPIUC\";\r\nexport * from \"./MockGetAssetsForOwnerUC\";\r\nexport * from \"./MockJsonRequestUC\";\r\nexport * from \"./MockPatchAssetFileUC\";\r\nexport * from \"./MockPatchAssetIsArchivedUC\";\r\nexport * from \"./MockPatchAssetMetaUC\";\r\nexport * from \"./MockPatchAssetUC\";\r\nexport * from \"./MockPostNewAssetUC\";\r\nexport * from \"./MockSignedAuthToken\";\r\nexport * from \"./MockUserLoginUC\";\r\nexport * from \"./UserTokenPMMock\";\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiStagePM.js","sourceRoot":"","sources":["../../../../src/VivedAPI/PMs/ApiStagePM.ts"],"names":[],"mappings":"AAAA;;;;;;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AAiB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACjD,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;CACF","sourcesContent":["/**\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;AAEH,OAAO,EACL,qBAAqB,EAErB,WAAW,EAEZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;;GAGG;AACH,MAAM,OAAgB,WAAY,SAAQ,WAAmB;IAI3D;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAc,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC1E,CAAC;;AAVD,gDAAgD;AACzC,gBAAI,GAAG,aAAa,CAAC;AAY9B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AAc,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC1E,CAAC;;AAVD,gDAAgD;AACzC,gBAAI,GAAG,aAAa,CAAC;AAY9B;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,SAAoB;IAClD,OAAO,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,MAAM,cAAe,SAAQ,WAAW;IACtC;;;OAGG;IACH,IAAY,OAAO;QACjB,OAAO,IAAI,CAAC,kBAAkB,CAAiB,cAAc,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,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC","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,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC","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,OAAO,EACL,qBAAqB,EAGrB,WAAW,EACZ,MAAM,aAAa,CAAC;AAgBrB;;;GAGG;AACH,MAAM,OAAgB,YAAa,SAAQ,WAAW;IAYpD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAC,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;;AAlBD,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,OAAO,EACL,qBAAqB,EAGrB,WAAW,EACZ,MAAM,aAAa,CAAC;AAgBrB;;;GAGG;AACH,MAAM,OAAgB,YAAa,SAAQ,WAAW;IAYpD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAC,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;;AAlBD,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,OAAO,EACL,qBAAqB,EAGrB,WAAW,EACZ,MAAM,aAAa,CAAC;AAgBrB;;;GAGG;AACH,MAAM,OAAgB,aAAc,SAAQ,WAAW;IAYrD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;;AAlBD,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,OAAO,EACL,qBAAqB,EAGrB,WAAW,EACZ,MAAM,aAAa,CAAC;AAgBrB;;;GAGG;AACH,MAAM,OAAgB,aAAc,SAAQ,WAAW;IAYrD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;;AAlBD,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;AAEH,OAAO,EACL,qBAAqB,EAGrB,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAsB,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;GAGG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,WAAW;IAW1D;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,O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,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
|
|
1
|
+
{"version":3,"file":"DeleteAssetOnAPIUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/DeleteAssetOnAPIUC.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EACL,qBAAqB,EAGrB,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAsB,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;GAGG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,WAAW;IAW1D;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAC,kBAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACpE,CAAC;;AAjBD,gDAAgD;AACzC,uBAAI,GAAG,oBAAoB,CAAC;AAmBrC;;;;GAIG;AACH,MAAM,UAAU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,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;AAEH,OAAO,EACL,qBAAqB,EAGrB,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAqB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,MAAM,OAAgB,YAAa,SAAQ,WAAW;IAWpD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAC,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;;AAjBD,gDAAgD;AACzC,iBAAI,GAAG,cAAc,CAAC;AAmB/B;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAoB;IACnD,OAAO,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC;AAED;;;GAGG;AACH,MAAM,eAAgB,SAAQ,YAAY;IACxC,IAAY,QAAQ;QAClB,OAAO,IAAI,CAAC,kBAAkB,CAAiB,cAAc,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC;IAED,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,kBAAkB,CA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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;AAEH,OAAO,EACL,qBAAqB,EAGrB,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAqB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,MAAM,OAAgB,YAAa,SAAQ,WAAW;IAWpD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAC,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;;AAjBD,gDAAgD;AACzC,iBAAI,GAAG,cAAc,CAAC;AAmB/B;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAoB;IACnD,OAAO,IAAI,eAAe,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC;AAED;;;GAGG;AACH,MAAM,eAAgB,SAAQ,YAAY;IACxC,IAAY,QAAQ;QAClB,OAAO,IAAI,CAAC,kBAAkB,CAAiB,cAAc,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC;IAED,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,kBAAkB,CAAgB,aAAa,CAAC,IAAI,CAAC;YAC/D,EAAE,SAAS,CAAC;IAChB,CAAC;IAED,IAAY,UAAU;QACpB,OAAO,IAAI,CAAC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C;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,OAAO,EACL,qBAAqB,EAGrB,WAAW,EACZ,MAAM,aAAa,CAAC;AAgBrB;;;GAGG;AACH,MAAM,OAAgB,aAAc,SAAQ,WAAW;IAYrD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;;AAlBD,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,OAAO,EACL,qBAAqB,EAGrB,WAAW,EACZ,MAAM,aAAa,CAAC;AAgBrB;;;GAGG;AACH,MAAM,OAAgB,aAAc,SAAQ,WAAW;IAYrD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;;AAlBD,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostNewAssetUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/UCs/PostNewAssetUC.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAGL,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAA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,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;AAEH,OAAO,EAGL,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAsB,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AA0BxD;;;GAGG;AACH,MAAM,OAAgB,cAAe,SAAQ,WAAW;IAWtD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAChE,CAAC;;AAjBD,gDAAgD;AACzC,mBAAI,GAAG,gBAAgB,CAAC;AAmBjC;;;;G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AM,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,OAAO,EAAiB,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEhF;;;GAGG;AACH,MAAM,OAAgB,iBAAkB,SAAQ,WAAW;IAUzD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACnE,CAAC;;AAhBD,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,OAAO,EAAiB,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEhF;;;GAGG;AACH,MAAM,OAAgB,iBAAkB,SAAQ,WAAW;IAUzD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACnE,CAAC;;AAhBD,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,OAAO,EAAE,qBAAqB,EAAiB,WAAW,EAAE,MAAM,aAAa,CAAC;AAEhF;;;GAGG;AACH,MAAM,OAAgB,UAAW,SAAQ,WAAW;IAwBlD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC5D,CAAC;;AA9BD,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,OAAO,EAAE,qBAAqB,EAAiB,WAAW,EAAE,MAAM,aAAa,CAAC;AAEhF;;;GAGG;AACH,MAAM,OAAgB,UAAW,SAAQ,WAAW;IAwBlD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,qBAAqB,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC5D,CAAC;;AA9BD,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,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC","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,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC","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,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 * VivedAPI Feature Index\r\n
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/VivedAPI/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;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 * 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"]}
|
|
@@ -25,7 +25,46 @@ export declare enum AppState {
|
|
|
25
25
|
export declare abstract class AppEntity extends AppObjectEntity {
|
|
26
26
|
/** Type identifier for the AppEntity component */
|
|
27
27
|
static type: string;
|
|
28
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves an AppEntity from a specific AppObject
|
|
30
|
+
* @param appObj - The AppObject to retrieve the AppEntity from
|
|
31
|
+
* @returns The AppEntity instance if found, undefined otherwise
|
|
32
|
+
* @throws Error if appObj is null or undefined
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const appObject = appObjects.getOrCreate("myApp");
|
|
36
|
+
* const appEntity = AppEntity.get(appObject);
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
static get(appObj: AppObject): AppEntity | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves an AppEntity by ID from the AppObjectRepo
|
|
42
|
+
* @param id - The unique identifier of the app
|
|
43
|
+
* @param appObjects - The AppObjectRepo to search within
|
|
44
|
+
* @returns The AppEntity instance if found, undefined otherwise
|
|
45
|
+
* @throws Error if id is empty or appObjects is null
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const appEntity = AppEntity.getById("myAppId", appObjects);
|
|
49
|
+
* if (appEntity) {
|
|
50
|
+
* console.log(`Found app: ${appEntity.name}`);
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
static getById(id: string, appObjects: AppObjectRepo): AppEntity | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Safely creates an AppEntity if it doesn't already exist on the AppObject
|
|
57
|
+
* @param appObject - The AppObject to add the AppEntity to
|
|
58
|
+
* @returns The AppEntity instance (existing or newly created)
|
|
59
|
+
* @throws Error if appObject is null or undefined
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* const appObject = appObjects.getOrCreate("newApp");
|
|
63
|
+
* const appEntity = AppEntity.addIfMissing(appObject);
|
|
64
|
+
* // appEntity is guaranteed to exist
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
static addIfMissing(appObject: AppObject): AppEntity;
|
|
29
68
|
abstract get id(): string;
|
|
30
69
|
abstract name: string;
|
|
31
70
|
abstract description: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppEntity.d.ts","sourceRoot":"","sources":["../../../../src/Apps/Entities/AppEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,OAAO,EAER,MAAM,aAAa,CAAC;AAErB;;;;;;;;GAQG;AACH,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED;;;;;;;GAOG;AACH,8BAAsB,SAAU,SAAQ,eAAe;IACrD,kDAAkD;IAClD,MAAM,CAAC,IAAI,SAAe;IAE1B,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa;
|
|
1
|
+
{"version":3,"file":"AppEntity.d.ts","sourceRoot":"","sources":["../../../../src/Apps/Entities/AppEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,OAAO,EAER,MAAM,aAAa,CAAC;AAErB;;;;;;;;GAQG;AACH,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED;;;;;;;GAOG;AACH,8BAAsB,SAAU,SAAQ,eAAe;IACrD,kDAAkD;IAClD,MAAM,CAAC,IAAI,SAAe;IAE1B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS;IAOpD;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,GAAG,SAAS,GAAG,SAAS;IAoB5E;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS;IAepD,QAAQ,KAAK,EAAE,IAAI,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;IAC7B,QAAQ,KAAK,aAAa,IAAI,OAAO,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,KAAK,QAAQ,IAAI,OAAO,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAElC,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC;IAClC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,KAAK,iBAAiB,IAAI,OAAO,GAAG,SAAS,CAAC;IACtD,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,OAAO,GAAG,SAAS,CAAC;CAC9C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAE7D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AppObject, DomainFactory } from "@vived/core";
|
|
2
|
+
/**
|
|
3
|
+
* Factory responsible for setting up the Apps domain components.
|
|
4
|
+
* This factory initializes all entities, use cases, and presentation models
|
|
5
|
+
* required for the Apps functionality.
|
|
6
|
+
*/
|
|
7
|
+
export declare class AppsFeatureFactory extends DomainFactory {
|
|
8
|
+
readonly factoryName = "AppsFeatureFactory";
|
|
9
|
+
private appRepoAO;
|
|
10
|
+
constructor(appObject: AppObject);
|
|
11
|
+
/**
|
|
12
|
+
* Sets up all entities required for the Apps system
|
|
13
|
+
*/
|
|
14
|
+
setupEntities(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Sets up all use cases for the Apps system
|
|
17
|
+
*/
|
|
18
|
+
setupUCs(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Sets up all presentation managers for the Apps system
|
|
21
|
+
*/
|
|
22
|
+
setupPMs(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Performs any final setup operations after all components are initialized
|
|
25
|
+
*/
|
|
26
|
+
finalSetup(): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=AppsFeatureFactory.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Apps/Factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","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"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","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"}
|