@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.
Files changed (77) hide show
  1. package/dist/cjs/Apps/Entities/AppEntity.js +75 -14
  2. package/dist/cjs/Apps/Entities/AppEntity.js.map +1 -1
  3. package/dist/cjs/Apps/Factories/AppsFeatureFactory.js +48 -0
  4. package/dist/cjs/Apps/Factories/AppsFeatureFactory.js.map +1 -0
  5. package/dist/cjs/Apps/Factories/index.js +18 -0
  6. package/dist/cjs/Apps/Factories/index.js.map +1 -0
  7. package/dist/cjs/Apps/index.js +1 -0
  8. package/dist/cjs/Apps/index.js.map +1 -1
  9. package/dist/cjs/VivedAPI/Adapters/apiStageAdapter.js.map +1 -1
  10. package/dist/cjs/VivedAPI/Adapters/index.js.map +1 -1
  11. package/dist/cjs/VivedAPI/Adapters/userTokenAdapter.js.map +1 -1
  12. package/dist/cjs/VivedAPI/Controllers/index.js.map +1 -1
  13. package/dist/cjs/VivedAPI/Controllers/loginUser.js.map +1 -1
  14. package/dist/cjs/VivedAPI/Controllers/logoutUser.js.map +1 -1
  15. package/dist/cjs/VivedAPI/Controllers/setApiStage.js.map +1 -1
  16. package/dist/cjs/VivedAPI/Entities/VivedAPIEntity.js.map +1 -1
  17. package/dist/cjs/VivedAPI/Entities/index.js.map +1 -1
  18. package/dist/cjs/VivedAPI/Factories/index.js.map +1 -1
  19. package/dist/cjs/VivedAPI/Factories/setupVivedAPIForSandbox.js.map +1 -1
  20. package/dist/cjs/VivedAPI/Mocks/MockJsonRequestUC.js.map +1 -1
  21. package/dist/cjs/VivedAPI/Mocks/index.js.map +1 -1
  22. package/dist/cjs/VivedAPI/PMs/ApiStagePM.js.map +1 -1
  23. package/dist/cjs/VivedAPI/PMs/UserTokenPM.js.map +1 -1
  24. package/dist/cjs/VivedAPI/PMs/index.js.map +1 -1
  25. package/dist/cjs/VivedAPI/UCs/BasicFetchUC.js.map +1 -1
  26. package/dist/cjs/VivedAPI/UCs/BlobRequestUC.js.map +1 -1
  27. package/dist/cjs/VivedAPI/UCs/DeleteAssetOnAPIUC.js.map +1 -1
  28. package/dist/cjs/VivedAPI/UCs/FileUploadUC.js.map +1 -1
  29. package/dist/cjs/VivedAPI/UCs/JsonRequestUC.js.map +1 -1
  30. package/dist/cjs/VivedAPI/UCs/PostNewAssetUC.js.map +1 -1
  31. package/dist/cjs/VivedAPI/UCs/SignedAuthTokenUC.js.map +1 -1
  32. package/dist/cjs/VivedAPI/UCs/UserAuthUC.js.map +1 -1
  33. package/dist/cjs/VivedAPI/UCs/index.js.map +1 -1
  34. package/dist/cjs/VivedAPI/index.js.map +1 -1
  35. package/dist/esm/Apps/Entities/AppEntity.js +75 -14
  36. package/dist/esm/Apps/Entities/AppEntity.js.map +1 -1
  37. package/dist/esm/Apps/Factories/AppsFeatureFactory.js +44 -0
  38. package/dist/esm/Apps/Factories/AppsFeatureFactory.js.map +1 -0
  39. package/dist/esm/Apps/Factories/index.js +2 -0
  40. package/dist/esm/Apps/Factories/index.js.map +1 -0
  41. package/dist/esm/Apps/index.js +1 -0
  42. package/dist/esm/Apps/index.js.map +1 -1
  43. package/dist/esm/VivedAPI/Adapters/apiStageAdapter.js.map +1 -1
  44. package/dist/esm/VivedAPI/Adapters/index.js.map +1 -1
  45. package/dist/esm/VivedAPI/Adapters/userTokenAdapter.js.map +1 -1
  46. package/dist/esm/VivedAPI/Controllers/index.js.map +1 -1
  47. package/dist/esm/VivedAPI/Controllers/loginUser.js.map +1 -1
  48. package/dist/esm/VivedAPI/Controllers/logoutUser.js.map +1 -1
  49. package/dist/esm/VivedAPI/Controllers/setApiStage.js.map +1 -1
  50. package/dist/esm/VivedAPI/Entities/VivedAPIEntity.js.map +1 -1
  51. package/dist/esm/VivedAPI/Entities/index.js.map +1 -1
  52. package/dist/esm/VivedAPI/Factories/index.js.map +1 -1
  53. package/dist/esm/VivedAPI/Factories/setupVivedAPIForSandbox.js.map +1 -1
  54. package/dist/esm/VivedAPI/Mocks/MockJsonRequestUC.js.map +1 -1
  55. package/dist/esm/VivedAPI/Mocks/index.js.map +1 -1
  56. package/dist/esm/VivedAPI/PMs/ApiStagePM.js.map +1 -1
  57. package/dist/esm/VivedAPI/PMs/UserTokenPM.js.map +1 -1
  58. package/dist/esm/VivedAPI/PMs/index.js.map +1 -1
  59. package/dist/esm/VivedAPI/UCs/BasicFetchUC.js.map +1 -1
  60. package/dist/esm/VivedAPI/UCs/BlobRequestUC.js.map +1 -1
  61. package/dist/esm/VivedAPI/UCs/DeleteAssetOnAPIUC.js.map +1 -1
  62. package/dist/esm/VivedAPI/UCs/FileUploadUC.js.map +1 -1
  63. package/dist/esm/VivedAPI/UCs/JsonRequestUC.js.map +1 -1
  64. package/dist/esm/VivedAPI/UCs/PostNewAssetUC.js.map +1 -1
  65. package/dist/esm/VivedAPI/UCs/SignedAuthTokenUC.js.map +1 -1
  66. package/dist/esm/VivedAPI/UCs/UserAuthUC.js.map +1 -1
  67. package/dist/esm/VivedAPI/UCs/index.js.map +1 -1
  68. package/dist/esm/VivedAPI/index.js.map +1 -1
  69. package/dist/types/Apps/Entities/AppEntity.d.ts +40 -1
  70. package/dist/types/Apps/Entities/AppEntity.d.ts.map +1 -1
  71. package/dist/types/Apps/Factories/AppsFeatureFactory.d.ts +28 -0
  72. package/dist/types/Apps/Factories/AppsFeatureFactory.d.ts.map +1 -0
  73. package/dist/types/Apps/Factories/index.d.ts +2 -0
  74. package/dist/types/Apps/Factories/index.d.ts.map +1 -0
  75. package/dist/types/Apps/index.d.ts +1 -0
  76. package/dist/types/Apps/index.d.ts.map +1 -1
  77. package/package.json +1 -1
@@ -28,14 +28,75 @@ var AppState;
28
28
  * @extends AppObjectEntity from @vived/core
29
29
  */
30
30
  class AppEntity extends core_1.AppObjectEntity {
31
- static get(id, appObjects) {
31
+ /**
32
+ * Retrieves an AppEntity from a specific AppObject
33
+ * @param appObj - The AppObject to retrieve the AppEntity from
34
+ * @returns The AppEntity instance if found, undefined otherwise
35
+ * @throws Error if appObj is null or undefined
36
+ * @example
37
+ * ```typescript
38
+ * const appObject = appObjects.getOrCreate("myApp");
39
+ * const appEntity = AppEntity.get(appObject);
40
+ * ```
41
+ */
42
+ static get(appObj) {
43
+ if (!appObj) {
44
+ throw new Error("AppObject cannot be null or undefined");
45
+ }
46
+ return appObj.getComponent(AppEntity.type);
47
+ }
48
+ /**
49
+ * Retrieves an AppEntity by ID from the AppObjectRepo
50
+ * @param id - The unique identifier of the app
51
+ * @param appObjects - The AppObjectRepo to search within
52
+ * @returns The AppEntity instance if found, undefined otherwise
53
+ * @throws Error if id is empty or appObjects is null
54
+ * @example
55
+ * ```typescript
56
+ * const appEntity = AppEntity.getById("myAppId", appObjects);
57
+ * if (appEntity) {
58
+ * console.log(`Found app: ${appEntity.name}`);
59
+ * }
60
+ * ```
61
+ */
62
+ static getById(id, appObjects) {
63
+ if (!id) {
64
+ throw new Error("ID cannot be empty");
65
+ }
66
+ if (!appObjects) {
67
+ throw new Error("AppObjectRepo cannot be null or undefined");
68
+ }
32
69
  const ao = appObjects.get(id);
33
70
  if (!ao) {
34
- appObjects.submitWarning("AppEntity.get", `Unable to find app object by ID: ${id}`);
71
+ appObjects.submitWarning("AppEntity.getById", `Unable to find app object by ID: ${id}`);
35
72
  return;
36
73
  }
37
74
  return ao.getComponent(AppEntity.type);
38
75
  }
76
+ /**
77
+ * Safely creates an AppEntity if it doesn't already exist on the AppObject
78
+ * @param appObject - The AppObject to add the AppEntity to
79
+ * @returns The AppEntity instance (existing or newly created)
80
+ * @throws Error if appObject is null or undefined
81
+ * @example
82
+ * ```typescript
83
+ * const appObject = appObjects.getOrCreate("newApp");
84
+ * const appEntity = AppEntity.addIfMissing(appObject);
85
+ * // appEntity is guaranteed to exist
86
+ * ```
87
+ */
88
+ static addIfMissing(appObject) {
89
+ if (!appObject) {
90
+ throw new Error("AppObject cannot be null or undefined");
91
+ }
92
+ // Check if AppEntity already exists
93
+ const existingEntity = appObject.getComponent(AppEntity.type);
94
+ if (existingEntity) {
95
+ return existingEntity;
96
+ }
97
+ // Create new AppEntity if it doesn't exist
98
+ return makeAppEntity(appObject);
99
+ }
39
100
  }
40
101
  exports.AppEntity = AppEntity;
41
102
  /** Type identifier for the AppEntity component */
@@ -54,29 +115,29 @@ class AppEntityImp extends AppEntity {
54
115
  return this.appObject.id;
55
116
  }
56
117
  get name() {
57
- return this._memoizedName.val;
118
+ return this.memoizedName.val;
58
119
  }
59
120
  set name(val) {
60
- this._memoizedName.val = val;
121
+ this.memoizedName.val = val;
61
122
  }
62
123
  get description() {
63
- return this._memoizedDescription.val;
124
+ return this.memoizedDescription.val;
64
125
  }
65
126
  set description(val) {
66
- this._memoizedDescription.val = val;
127
+ this.memoizedDescription.val = val;
67
128
  }
68
129
  get image_url() {
69
- return this._memoizedImageUrl.val;
130
+ return this.memoizedImageUrl.val;
70
131
  }
71
132
  set image_url(val) {
72
- this._memoizedImageUrl.val = val;
133
+ this.memoizedImageUrl.val = val;
73
134
  }
74
135
  get imageAssetId() {
75
- const value = this._memoizedImageAssetId.val;
136
+ const value = this.memoizedImageAssetId.val;
76
137
  return value === "" ? undefined : value;
77
138
  }
78
139
  set imageAssetId(val) {
79
- this._memoizedImageAssetId.val = val ?? "";
140
+ this.memoizedImageAssetId.val = val ?? "";
80
141
  }
81
142
  get latestVersion() {
82
143
  return core_1.Version.GetLatest(this.versions);
@@ -130,10 +191,10 @@ class AppEntityImp extends AppEntity {
130
191
  }
131
192
  constructor(appObject) {
132
193
  super(appObject, AppEntity.type);
133
- this._memoizedName = new core_1.MemoizedString("", this.notifyOnChange);
134
- this._memoizedDescription = new core_1.MemoizedString("", this.notifyOnChange);
135
- this._memoizedImageUrl = new core_1.MemoizedString("", this.notifyOnChange);
136
- this._memoizedImageAssetId = new core_1.MemoizedString("", this.notifyOnChange);
194
+ this.memoizedName = new core_1.MemoizedString("", this.notifyOnChange);
195
+ this.memoizedDescription = new core_1.MemoizedString("", this.notifyOnChange);
196
+ this.memoizedImageUrl = new core_1.MemoizedString("", this.notifyOnChange);
197
+ this.memoizedImageAssetId = new core_1.MemoizedString("", this.notifyOnChange);
137
198
  this.versions = [];
138
199
  this._state = AppState.INIT;
139
200
  this._assignedToOwner = false;
@@ -1 +1 @@
1
- {"version":3,"file":"AppEntity.js","sourceRoot":"","sources":["../../../../src/Apps/Entities/AppEntity.ts"],"names":[],"mappings":";;;AA0EA,sCAEC;AA5ED,sCAMqB;AAErB;;;;;;;;GAQG;AACH,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,+BAAmB,CAAA;IACnB,2BAAe,CAAA;IACf,2BAAe,CAAA;AACjB,CAAC,EALW,QAAQ,wBAAR,QAAQ,QAKnB;AAED;;;;;;;GAOG;AACH,MAAsB,SAAU,SAAQ,sBAAe;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;;AAfH,8BAkCC;AAjCC,kDAAkD;AAC3C,cAAI,GAAG,WAAW,CAAC;AAkC5B;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,SAAoB;IAChD,OAAO,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,YAAa,SAAQ,SAAS;IAClC,IAAI,EAAE;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;IAC3B,CAAC;IAOD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;IAChC,CAAC;IAED,IAAI,IAAI,CAAC,GAAW;QAClB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UM,sBAAiB,GAAmB,IAAI,qBAAc,CAC5D,EAAE,EACF,IAAI,CAAC,cAAc,CACpB,CAAC;QAUM,0BAAqB,GAAG,IAAI,qBAAc,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":";;;AA4IA,sCAEC;AA9ID,sCAMqB;AAErB;;;;;;;;GAQG;AACH,IAAY,QAKX;AALD,WAAY,QAAQ;IAClB,yBAAa,CAAA;IACb,+BAAmB,CAAA;IACnB,2BAAe,CAAA;IACf,2BAAe,CAAA;AACjB,CAAC,EALW,QAAQ,wBAAR,QAAQ,QAKnB;AAED;;;;;;;GAOG;AACH,MAAsB,SAAU,SAAQ,sBAAe;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,OAAO,MAAM,CAAC,YAAY,CAAY,SAAS,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,OAAO,CAAC,EAAU,EAAE,UAAyB;QAClD,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,2CAA2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c,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,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppsFeatureFactory = void 0;
4
+ const core_1 = require("@vived/core");
5
+ const Entities_1 = require("../Entities");
6
+ const PMs_1 = require("../PMs");
7
+ /**
8
+ * Factory responsible for setting up the Apps domain components.
9
+ * This factory initializes all entities, use cases, and presentation models
10
+ * required for the Apps functionality.
11
+ */
12
+ class AppsFeatureFactory extends core_1.DomainFactory {
13
+ constructor(appObject) {
14
+ super(appObject);
15
+ // Unique name for this factory
16
+ this.factoryName = "AppsFeatureFactory";
17
+ }
18
+ /**
19
+ * Sets up all entities required for the Apps system
20
+ */
21
+ setupEntities() {
22
+ this.appRepoAO = this.appObjects.getOrCreate("App Repository");
23
+ // Initialize entities
24
+ (0, Entities_1.makeAppRepo)(this.appRepoAO);
25
+ }
26
+ /**
27
+ * Sets up all use cases for the Apps system
28
+ */
29
+ setupUCs() {
30
+ // Note: App UCs have complex dependencies and should be set up
31
+ // separately to avoid circular dependencies during factory initialization
32
+ }
33
+ /**
34
+ * Sets up all presentation managers for the Apps system
35
+ */
36
+ setupPMs() {
37
+ // App Repository PMs
38
+ (0, PMs_1.makeAppsListPM)(this.appRepoAO);
39
+ }
40
+ /**
41
+ * Performs any final setup operations after all components are initialized
42
+ */
43
+ finalSetup() {
44
+ // No additional setup required for apps
45
+ }
46
+ }
47
+ exports.AppsFeatureFactory = AppsFeatureFactory;
48
+ //# sourceMappingURL=AppsFeatureFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppsFeatureFactory.js","sourceRoot":"","sources":["../../../../src/Apps/Factories/AppsFeatureFactory.ts"],"names":[],"mappings":";;;AAAA,sCAAuD;AACvD,0CAAyD;AACzD,gCAAmD;AAEnD;;;;GAIG;AACH,MAAa,kBAAmB,SAAQ,oBAAa;IAOnD,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,CAAC,CAAC;QAPnB,+BAA+B;QACtB,gBAAW,GAAG,oBAAoB,CAAC;IAO5C,CAAC;IAED;;OAEG;IACH,aAAa;QACX,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAE/D,sBAAsB;QACtB,IAAA,sBAAW,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,+DAA+D;QAC/D,0EAA0E;IAC5E,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,qBAAqB;QACrB,IAAA,oBAAc,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,UAAU;QACR,wCAAwC;IAC1C,CAAC;CACF;AA3CD,gDA2CC","sourcesContent":["import { AppObject, DomainFactory } from \"@vived/core\";\r\nimport { makeAppEntity, makeAppRepo } from \"../Entities\";\r\nimport { makeAppPM, makeAppsListPM } from \"../PMs\";\r\n\r\n/**\r\n * Factory responsible for setting up the Apps domain components.\r\n * This factory initializes all entities, use cases, and presentation models\r\n * required for the Apps functionality.\r\n */\r\nexport class AppsFeatureFactory extends DomainFactory {\r\n // Unique name for this factory\r\n readonly factoryName = \"AppsFeatureFactory\";\r\n\r\n // Store references to key AppObjects needed across setup phases\r\n private appRepoAO!: AppObject;\r\n\r\n constructor(appObject: AppObject) {\r\n super(appObject);\r\n }\r\n\r\n /**\r\n * Sets up all entities required for the Apps system\r\n */\r\n setupEntities(): void {\r\n this.appRepoAO = this.appObjects.getOrCreate(\"App Repository\");\r\n\r\n // Initialize entities\r\n makeAppRepo(this.appRepoAO);\r\n }\r\n\r\n /**\r\n * Sets up all use cases for the Apps system\r\n */\r\n setupUCs(): void {\r\n // Note: App UCs have complex dependencies and should be set up\r\n // separately to avoid circular dependencies during factory initialization\r\n }\r\n\r\n /**\r\n * Sets up all presentation managers for the Apps system\r\n */\r\n setupPMs(): void {\r\n // App Repository PMs\r\n makeAppsListPM(this.appRepoAO);\r\n }\r\n\r\n /**\r\n * Performs any final setup operations after all components are initialized\r\n */\r\n finalSetup(): void {\r\n // No additional setup required for apps\r\n }\r\n}\r\n"]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./AppsFeatureFactory"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/Apps/Factories/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC","sourcesContent":["export * from \"./AppsFeatureFactory\";\r\n"]}
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  __exportStar(require("./Adapters"), exports);
37
37
  __exportStar(require("./Controllers"), exports);
38
38
  __exportStar(require("./Entities"), exports);
39
+ __exportStar(require("./Factories"), exports);
39
40
  __exportStar(require("./Mocks"), exports);
40
41
  __exportStar(require("./PMs"), exports);
41
42
  __exportStar(require("./UCs"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Apps/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;AAEH,6CAA2B;AAC3B,gDAA8B;AAC9B,6CAA2B;AAC3B,0CAAwB;AACxB,wCAAsB;AACtB,wCAAsB","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,6CAA2B;AAC3B,gDAA8B;AAC9B,6CAA2B;AAC3B,8CAA4B;AAC5B,0CAAwB;AACxB,wCAAsB;AACtB,wCAAsB","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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"apiStageAdapter.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Adapters/apiStageAdapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAGH,0CAAuC;AACvC,kDAA+C;AAE/C;;;GAGG;AACU,QAAA,eAAe,GAAiC;IAC3D,6DAA6D;IAC7D,SAAS,EAAE,mBAAQ,CAAC,UAAU;IAE9B;;;;OAIG;IACH,SAAS,EAAE,CAAC,UAAyB,EAAE,KAA6B,EAAE,EAAE;QACtE,MAAM,EAAE,GAAG,uBAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACtC,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,WAAW,CAAC,iBAAiB,EAAE,2BAA2B,CAAC,CAAC;YACvE,OAAO;QACT,CAAC;QACD,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACH,WAAW,EAAE,CAAC,UAAyB,EAAE,KAA6B,EAAE,EAAE;QACxE,MAAM,EAAE,GAAG,uBAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACtC,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,WAAW,CAAC,iBAAiB,EAAE,2BAA2B,CAAC,CAAC;YACvE,OAAO;QACT,CAAC;QACD,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;CACF,CAAC","sourcesContent":["/**\r\n * apiStageAdapter.ts\r\n * \r\n * This file defines an adapter for connecting API stage presentation logic to UI frameworks.\r\n * The apiStageAdapter provides a standardized interface for binding API stage configuration\r\n * to view components, handling subscriptions and view model updates.\r\n * \r\n * Key concepts:\r\n * - Adapter implements SingletonPmAdapter interface for UI framework integration\r\n * - Manages subscription lifecycle for view components\r\n * - Provides default view model values for initialization\r\n * - Handles error cases when presentation manager is unavailable\r\n * - Enables reactive UI updates when API stage configuration changes\r\n * \r\n * Usage pattern:\r\n * 1. UI frameworks use this adapter to bind to API stage state\r\n * 2. Adapter manages PM subscriptions and view function callbacks\r\n * 3. View components receive API stage updates automatically\r\n * 4. Proper cleanup handled through unsubscribe mechanism\r\n */\r\n\r\nimport { AppObjectRepo, SingletonPmAdapter } from \"@vived/core\";\r\nimport { APIStage } from \"../Entities\";\r\nimport { ApiStagePM } from \"../PMs/ApiStagePM\";\r\n\r\n/**\r\n * Adapter for connecting API stage presentation logic to UI frameworks.\r\n * Implements SingletonPmAdapter to provide standardized view binding for API stage configuration.\r\n */\r\nexport const apiStageAdapter: SingletonPmAdapter<APIStage> = {\r\n /** Default view model value used when PM is not available */\r\n defaultVM: APIStage.PRODUCTION,\r\n \r\n /**\r\n * Subscribes a view function to receive API stage updates\r\n * @param appObjects The AppObjectRepo containing the ApiStagePM\r\n * @param setVM Callback function to update the view with new API stage values\r\n */\r\n subscribe: (appObjects: AppObjectRepo, setVM: (vm: APIStage) => void) => {\r\n const pm = ApiStagePM.get(appObjects);\r\n if (!pm) {\r\n appObjects.submitError(\"apiStageAdapter\", \"Unable to find ApiStagePM\");\r\n return;\r\n }\r\n pm.addView(setVM);\r\n },\r\n \r\n /**\r\n * Unsubscribes a view function from API stage updates\r\n * @param appObjects The AppObjectRepo containing the ApiStagePM\r\n * @param setVM Callback function to remove from view updates\r\n */\r\n unsubscribe: (appObjects: AppObjectRepo, setVM: (vm: APIStage) => void) => {\r\n const pm = ApiStagePM.get(appObjects);\r\n if (!pm) {\r\n appObjects.submitError(\"apiStageAdapter\", \"Unable to find ApiStagePM\");\r\n return;\r\n }\r\n pm.removeView(setVM);\r\n }\r\n};\r\n"]}
1
+ {"version":3,"file":"apiStageAdapter.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Adapters/apiStageAdapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAGH,0CAAuC;AACvC,kDAA+C;AAE/C;;;GAGG;AACU,QAAA,eAAe,GAAiC;IAC3D,6DAA6D;IAC7D,SAAS,EAAE,mBAAQ,CAAC,UAAU;IAE9B;;;;OAIG;IACH,SAAS,EAAE,CAAC,UAAyB,EAAE,KAA6B,EAAE,EAAE;QACtE,MAAM,EAAE,GAAG,uBAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACtC,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,WAAW,CAAC,iBAAiB,EAAE,2BAA2B,CAAC,CAAC;YACvE,OAAO;QACT,CAAC;QACD,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACH,WAAW,EAAE,CAAC,UAAyB,EAAE,KAA6B,EAAE,EAAE;QACxE,MAAM,EAAE,GAAG,uBAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACtC,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,WAAW,CAAC,iBAAiB,EAAE,2BAA2B,CAAC,CAAC;YACvE,OAAO;QACT,CAAC;QACD,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;CACF,CAAC","sourcesContent":["/**\r\n * apiStageAdapter.ts\r\n *\r\n * This file defines an adapter for connecting API stage presentation logic to UI frameworks.\r\n * The apiStageAdapter provides a standardized interface for binding API stage configuration\r\n * to view components, handling subscriptions and view model updates.\r\n *\r\n * Key concepts:\r\n * - Adapter implements SingletonPmAdapter interface for UI framework integration\r\n * - Manages subscription lifecycle for view components\r\n * - Provides default view model values for initialization\r\n * - Handles error cases when presentation manager is unavailable\r\n * - Enables reactive UI updates when API stage configuration changes\r\n *\r\n * Usage pattern:\r\n * 1. UI frameworks use this adapter to bind to API stage state\r\n * 2. Adapter manages PM subscriptions and view function callbacks\r\n * 3. View components receive API stage updates automatically\r\n * 4. Proper cleanup handled through unsubscribe mechanism\r\n */\r\n\r\nimport { AppObjectRepo, SingletonPmAdapter } from \"@vived/core\";\r\nimport { APIStage } from \"../Entities\";\r\nimport { ApiStagePM } from \"../PMs/ApiStagePM\";\r\n\r\n/**\r\n * Adapter for connecting API stage presentation logic to UI frameworks.\r\n * Implements SingletonPmAdapter to provide standardized view binding for API stage configuration.\r\n */\r\nexport const apiStageAdapter: SingletonPmAdapter<APIStage> = {\r\n /** Default view model value used when PM is not available */\r\n defaultVM: APIStage.PRODUCTION,\r\n\r\n /**\r\n * Subscribes a view function to receive API stage updates\r\n * @param appObjects The AppObjectRepo containing the ApiStagePM\r\n * @param setVM Callback function to update the view with new API stage values\r\n */\r\n subscribe: (appObjects: AppObjectRepo, setVM: (vm: APIStage) => void) => {\r\n const pm = ApiStagePM.get(appObjects);\r\n if (!pm) {\r\n appObjects.submitError(\"apiStageAdapter\", \"Unable to find ApiStagePM\");\r\n return;\r\n }\r\n pm.addView(setVM);\r\n },\r\n\r\n /**\r\n * Unsubscribes a view function from API stage updates\r\n * @param appObjects The AppObjectRepo containing the ApiStagePM\r\n * @param setVM Callback function to remove from view updates\r\n */\r\n unsubscribe: (appObjects: AppObjectRepo, setVM: (vm: APIStage) => void) => {\r\n const pm = ApiStagePM.get(appObjects);\r\n if (!pm) {\r\n appObjects.submitError(\"apiStageAdapter\", \"Unable to find ApiStagePM\");\r\n return;\r\n }\r\n pm.removeView(setVM);\r\n }\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Adapters/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;AAEH,oDAAkC;AAClC,qDAAmC","sourcesContent":["/**\r\n * VivedAPI Adapters Index\r\n * \r\n * This module exports all adapter objects for the VivedAPI feature.\r\n * Adapters provide standardized interfaces for connecting presentation managers\r\n * to various UI frameworks and libraries, handling subscription lifecycles\r\n * and view model synchronization.\r\n * \r\n * Key Concepts:\r\n * - Adapters implement framework-specific integration patterns\r\n * - They manage subscription and unsubscription to presentation manager updates\r\n * - Adapters provide default view model values for initialization\r\n * - They handle error cases when presentation managers are unavailable\r\n * - Adapters enable reactive UI updates across different frontend technologies\r\n * \r\n * Available Adapters:\r\n * - apiStageAdapter: Connects API stage configuration to UI components\r\n * - userTokenAdapter: Connects user authentication token state to UI displays\r\n */\r\n\r\nexport * from \"./apiStageAdapter\";\r\nexport * from \"./userTokenAdapter\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Adapters/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;AAEH,oDAAkC;AAClC,qDAAmC","sourcesContent":["/**\r\n * VivedAPI Adapters Index\r\n *\r\n * This module exports all adapter objects for the VivedAPI feature.\r\n * Adapters provide standardized interfaces for connecting presentation managers\r\n * to various UI frameworks and libraries, handling subscription lifecycles\r\n * and view model synchronization.\r\n *\r\n * Key Concepts:\r\n * - Adapters implement framework-specific integration patterns\r\n * - They manage subscription and unsubscription to presentation manager updates\r\n * - Adapters provide default view model values for initialization\r\n * - They handle error cases when presentation managers are unavailable\r\n * - Adapters enable reactive UI updates across different frontend technologies\r\n *\r\n * Available Adapters:\r\n * - apiStageAdapter: Connects API stage configuration to UI components\r\n * - userTokenAdapter: Connects user authentication token state to UI displays\r\n */\r\n\r\nexport * from \"./apiStageAdapter\";\r\nexport * from \"./userTokenAdapter\";\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"userTokenAdapter.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Adapters/userTokenAdapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAGH,oDAAiD;AAEjD;;;GAGG;AACU,QAAA,gBAAgB,GAA+B;IAC1D,6DAA6D;IAC7D,SAAS,EAAE,EAAE;IAEb;;;;OAIG;IACH,SAAS,EAAE,CAAC,UAAyB,EAAE,KAA2B,EAAE,EAAE;QACpE,MAAM,EAAE,GAAG,yBAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACvC,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,WAAW,CAAC,kBAAkB,EAAE,4BAA4B,CAAC,CAAC;YACzE,OAAO;QACT,CAAC;QACD,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACH,WAAW,EAAE,CAAC,UAAyB,EAAE,KAA2B,EAAE,EAAE;QACtE,MAAM,EAAE,GAAG,yBAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACvC,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,WAAW,CAAC,kBAAkB,EAAE,4BAA4B,CAAC,CAAC;YACzE,OAAO;QACT,CAAC;QACD,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;CACF,CAAC","sourcesContent":["/**\r\n * userTokenAdapter.ts\r\n * \r\n * This file defines an adapter for connecting user token presentation logic to UI frameworks.\r\n * The userTokenAdapter provides a standardized interface for binding user authentication\r\n * token state to view components, handling subscriptions and view model updates.\r\n * \r\n * Key concepts:\r\n * - Adapter implements SingletonPmAdapter interface for UI framework integration\r\n * - Manages subscription lifecycle for view components displaying user tokens\r\n * - Provides default view model values for initialization (empty string)\r\n * - Handles error cases when presentation manager is unavailable\r\n * - Enables reactive UI updates when user authentication token changes\r\n * \r\n * Usage pattern:\r\n * 1. UI frameworks use this adapter to bind to user token state\r\n * 2. Adapter manages PM subscriptions and view function callbacks\r\n * 3. View components receive token updates automatically\r\n * 4. Proper cleanup handled through unsubscribe mechanism\r\n */\r\n\r\nimport { AppObjectRepo, SingletonPmAdapter } from \"@vived/core\";\r\nimport { UserTokenPM } from \"../PMs/UserTokenPM\";\r\n\r\n/**\r\n * Adapter for connecting user token presentation logic to UI frameworks.\r\n * Implements SingletonPmAdapter to provide standardized view binding for user authentication tokens.\r\n */\r\nexport const userTokenAdapter: SingletonPmAdapter<string> = {\r\n /** Default view model value used when PM is not available */\r\n defaultVM: \"\",\r\n \r\n /**\r\n * Subscribes a view function to receive user token updates\r\n * @param appObjects The AppObjectRepo containing the UserTokenPM\r\n * @param setVM Callback function to update the view with new token values\r\n */\r\n subscribe: (appObjects: AppObjectRepo, setVM: (vm: string) => void) => {\r\n const pm = UserTokenPM.get(appObjects);\r\n if (!pm) {\r\n appObjects.submitError(\"userTokenAdapter\", \"Unable to find UserTokenPM\");\r\n return;\r\n }\r\n pm.addView(setVM);\r\n },\r\n \r\n /**\r\n * Unsubscribes a view function from user token updates\r\n * @param appObjects The AppObjectRepo containing the UserTokenPM\r\n * @param setVM Callback function to remove from view updates\r\n */\r\n unsubscribe: (appObjects: AppObjectRepo, setVM: (vm: string) => void) => {\r\n const pm = UserTokenPM.get(appObjects);\r\n if (!pm) {\r\n appObjects.submitError(\"userTokenAdapter\", \"Unable to find UserTokenPM\");\r\n return;\r\n }\r\n pm.removeView(setVM);\r\n }\r\n};\r\n"]}
1
+ {"version":3,"file":"userTokenAdapter.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Adapters/userTokenAdapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAGH,oDAAiD;AAEjD;;;GAGG;AACU,QAAA,gBAAgB,GAA+B;IAC1D,6DAA6D;IAC7D,SAAS,EAAE,EAAE;IAEb;;;;OAIG;IACH,SAAS,EAAE,CAAC,UAAyB,EAAE,KAA2B,EAAE,EAAE;QACpE,MAAM,EAAE,GAAG,yBAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACvC,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,WAAW,CAAC,kBAAkB,EAAE,4BAA4B,CAAC,CAAC;YACzE,OAAO;QACT,CAAC;QACD,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACH,WAAW,EAAE,CAAC,UAAyB,EAAE,KAA2B,EAAE,EAAE;QACtE,MAAM,EAAE,GAAG,yBAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACvC,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,UAAU,CAAC,WAAW,CAAC,kBAAkB,EAAE,4BAA4B,CAAC,CAAC;YACzE,OAAO;QACT,CAAC;QACD,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;CACF,CAAC","sourcesContent":["/**\r\n * userTokenAdapter.ts\r\n *\r\n * This file defines an adapter for connecting user token presentation logic to UI frameworks.\r\n * The userTokenAdapter provides a standardized interface for binding user authentication\r\n * token state to view components, handling subscriptions and view model updates.\r\n *\r\n * Key concepts:\r\n * - Adapter implements SingletonPmAdapter interface for UI framework integration\r\n * - Manages subscription lifecycle for view components displaying user tokens\r\n * - Provides default view model values for initialization (empty string)\r\n * - Handles error cases when presentation manager is unavailable\r\n * - Enables reactive UI updates when user authentication token changes\r\n *\r\n * Usage pattern:\r\n * 1. UI frameworks use this adapter to bind to user token state\r\n * 2. Adapter manages PM subscriptions and view function callbacks\r\n * 3. View components receive token updates automatically\r\n * 4. Proper cleanup handled through unsubscribe mechanism\r\n */\r\n\r\nimport { AppObjectRepo, SingletonPmAdapter } from \"@vived/core\";\r\nimport { UserTokenPM } from \"../PMs/UserTokenPM\";\r\n\r\n/**\r\n * Adapter for connecting user token presentation logic to UI frameworks.\r\n * Implements SingletonPmAdapter to provide standardized view binding for user authentication tokens.\r\n */\r\nexport const userTokenAdapter: SingletonPmAdapter<string> = {\r\n /** Default view model value used when PM is not available */\r\n defaultVM: \"\",\r\n\r\n /**\r\n * Subscribes a view function to receive user token updates\r\n * @param appObjects The AppObjectRepo containing the UserTokenPM\r\n * @param setVM Callback function to update the view with new token values\r\n */\r\n subscribe: (appObjects: AppObjectRepo, setVM: (vm: string) => void) => {\r\n const pm = UserTokenPM.get(appObjects);\r\n if (!pm) {\r\n appObjects.submitError(\"userTokenAdapter\", \"Unable to find UserTokenPM\");\r\n return;\r\n }\r\n pm.addView(setVM);\r\n },\r\n\r\n /**\r\n * Unsubscribes a view function from user token updates\r\n * @param appObjects The AppObjectRepo containing the UserTokenPM\r\n * @param setVM Callback function to remove from view updates\r\n */\r\n unsubscribe: (appObjects: AppObjectRepo, setVM: (vm: string) => void) => {\r\n const pm = UserTokenPM.get(appObjects);\r\n if (!pm) {\r\n appObjects.submitError(\"userTokenAdapter\", \"Unable to find UserTokenPM\");\r\n return;\r\n }\r\n pm.removeView(setVM);\r\n }\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Controllers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;AAEH,8CAA4B;AAC5B,+CAA6B;AAC7B,6DAA2C;AAC3C,gDAA8B","sourcesContent":["/**\r\n * VivedAPI Controllers Index\r\n * \r\n * This module exports all controller functions for the VivedAPI feature.\r\n * Controllers handle user input and coordinate operations between UI components\r\n * and the underlying business logic components.\r\n * \r\n * Key Concepts:\r\n * - Controllers provide simple function interfaces for common operations\r\n * - They validate inputs and handle error cases appropriately\r\n * - Controllers coordinate between use cases, entities, and external systems\r\n * - They serve as the primary interface for UI framework integration\r\n * - Error handling and logging are managed at the controller level\r\n * \r\n * Available Controllers:\r\n * - User Authentication: loginUser, logoutUser, refreshAuthenticatedUser\r\n * - API Configuration: setApiStage\r\n */\r\n\r\nexport * from \"./loginUser\";\r\nexport * from \"./logoutUser\";\r\nexport * from \"./refreshAuthenticatedUser\";\r\nexport * from \"./setApiStage\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Controllers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;;;;;;;;;;AAEH,8CAA4B;AAC5B,+CAA6B;AAC7B,6DAA2C;AAC3C,gDAA8B","sourcesContent":["/**\r\n * VivedAPI Controllers Index\r\n *\r\n * This module exports all controller functions for the VivedAPI feature.\r\n * Controllers handle user input and coordinate operations between UI components\r\n * and the underlying business logic components.\r\n *\r\n * Key Concepts:\r\n * - Controllers provide simple function interfaces for common operations\r\n * - They validate inputs and handle error cases appropriately\r\n * - Controllers coordinate between use cases, entities, and external systems\r\n * - They serve as the primary interface for UI framework integration\r\n * - Error handling and logging are managed at the controller level\r\n *\r\n * Available Controllers:\r\n * - User Authentication: loginUser, logoutUser, refreshAuthenticatedUser\r\n * - API Configuration: setApiStage\r\n */\r\n\r\nexport * from \"./loginUser\";\r\nexport * from \"./logoutUser\";\r\nexport * from \"./refreshAuthenticatedUser\";\r\nexport * from \"./setApiStage\";\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"loginUser.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Controllers/loginUser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AAYH,8BAaC;AAtBD,gCAAoC;AAEpC;;;;;;GAMG;AACH,SAAgB,SAAS,CACvB,QAAgB,EAChB,QAAgB,EAChB,UAAyB;IAEzB,MAAM,EAAE,GAAG,gBAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAEtC,IAAI,EAAE,EAAE,CAAC;QACP,OAAO,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,UAAU,CAAC,aAAa,CAAC,WAAW,EAAE,2BAA2B,CAAC,CAAC;QACnE,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;IAChE,CAAC;AACH,CAAC","sourcesContent":["/**\r\n * loginUser.ts\r\n * \r\n * This file defines a controller function for user authentication login operations.\r\n * The loginUser controller provides a simple interface for authenticating users\r\n * with username and password credentials through the VIVED API.\r\n * \r\n * Key concepts:\r\n * - Controller functions handle user input and direct authentication operations\r\n * - Validates UserAuthUC existence before performing login operations\r\n * - Provides error handling and warning messages for missing components\r\n * - Returns promises for async authentication workflows\r\n * - Coordinates with UserAuthUC for actual authentication logic\r\n * \r\n * Usage pattern:\r\n * 1. Call loginUser with credentials and appObjects repository\r\n * 2. Controller validates UC existence and initiates login workflow\r\n * 3. Handle returned Promise for authentication success or failure\r\n * 4. Error handling provides feedback if authentication UC is unavailable\r\n */\r\n\r\nimport { AppObjectRepo } from \"@vived/core\";\r\nimport { UserAuthUC } from \"../UCs\";\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 * @param appObjects The AppObjectRepo containing the UserAuthUC\r\n * @returns Promise that resolves when login is complete or rejects on error\r\n */\r\nexport function loginUser(\r\n userName: string,\r\n password: string,\r\n appObjects: AppObjectRepo\r\n): Promise<void> {\r\n const uc = UserAuthUC.get(appObjects);\r\n\r\n if (uc) {\r\n return uc.login(userName, password);\r\n } else {\r\n appObjects.submitWarning(\"loginUser\", \"Unable to find UserAuthUC\");\r\n return Promise.reject(new Error(\"Unable to find UserAuthUC\"));\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"loginUser.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Controllers/loginUser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AAYH,8BAaC;AAtBD,gCAAoC;AAEpC;;;;;;GAMG;AACH,SAAgB,SAAS,CACvB,QAAgB,EAChB,QAAgB,EAChB,UAAyB;IAEzB,MAAM,EAAE,GAAG,gBAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAEtC,IAAI,EAAE,EAAE,CAAC;QACP,OAAO,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,UAAU,CAAC,aAAa,CAAC,WAAW,EAAE,2BAA2B,CAAC,CAAC;QACnE,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;IAChE,CAAC;AACH,CAAC","sourcesContent":["/**\r\n * loginUser.ts\r\n *\r\n * This file defines a controller function for user authentication login operations.\r\n * The loginUser controller provides a simple interface for authenticating users\r\n * with username and password credentials through the VIVED API.\r\n *\r\n * Key concepts:\r\n * - Controller functions handle user input and direct authentication operations\r\n * - Validates UserAuthUC existence before performing login operations\r\n * - Provides error handling and warning messages for missing components\r\n * - Returns promises for async authentication workflows\r\n * - Coordinates with UserAuthUC for actual authentication logic\r\n *\r\n * Usage pattern:\r\n * 1. Call loginUser with credentials and appObjects repository\r\n * 2. Controller validates UC existence and initiates login workflow\r\n * 3. Handle returned Promise for authentication success or failure\r\n * 4. Error handling provides feedback if authentication UC is unavailable\r\n */\r\n\r\nimport { AppObjectRepo } from \"@vived/core\";\r\nimport { UserAuthUC } from \"../UCs\";\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 * @param appObjects The AppObjectRepo containing the UserAuthUC\r\n * @returns Promise that resolves when login is complete or rejects on error\r\n */\r\nexport function loginUser(\r\n userName: string,\r\n password: string,\r\n appObjects: AppObjectRepo\r\n): Promise<void> {\r\n const uc = UserAuthUC.get(appObjects);\r\n\r\n if (uc) {\r\n return uc.login(userName, password);\r\n } else {\r\n appObjects.submitWarning(\"loginUser\", \"Unable to find UserAuthUC\");\r\n return Promise.reject(new Error(\"Unable to find UserAuthUC\"));\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"logoutUser.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Controllers/logoutUser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AAUH,gCASC;AAhBD,gCAAoC;AAEpC;;;;GAIG;AACH,SAAgB,UAAU,CAAC,UAAyB;IAClD,MAAM,EAAE,GAAG,gBAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAEtC,IAAI,EAAE,EAAE,CAAC;QACP,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,UAAU,CAAC,aAAa,CAAC,YAAY,EAAE,2BAA2B,CAAC,CAAC;QACpE,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;IAChE,CAAC;AACH,CAAC","sourcesContent":["/**\r\n * logoutUser.ts\r\n * \r\n * This file defines a controller function for user logout operations.\r\n * The logoutUser controller provides a simple interface for terminating user\r\n * sessions and clearing authentication state through the VIVED API.\r\n * \r\n * Key concepts:\r\n * - Controller functions handle user input and direct logout operations\r\n * - Validates UserAuthUC existence before performing logout operations\r\n * - Provides error handling and warning messages for missing components\r\n * - Returns promises for async logout workflows\r\n * - Coordinates with UserAuthUC for actual logout logic\r\n * \r\n * Usage pattern:\r\n * 1. Call logoutUser with appObjects repository\r\n * 2. Controller validates UC existence and initiates logout workflow\r\n * 3. Handle returned Promise for logout success or failure\r\n * 4. Error handling provides feedback if authentication UC is unavailable\r\n */\r\n\r\nimport { AppObjectRepo } from \"@vived/core\";\r\nimport { UserAuthUC } from \"../UCs\";\r\n\r\n/**\r\n * Logs out the current user and terminates the session\r\n * @param appObjects The AppObjectRepo containing the UserAuthUC\r\n * @returns Promise that resolves when logout is complete or rejects on error\r\n */\r\nexport function logoutUser(appObjects: AppObjectRepo): Promise<void> {\r\n const uc = UserAuthUC.get(appObjects);\r\n\r\n if (uc) {\r\n return uc.logout();\r\n } else {\r\n appObjects.submitWarning(\"logoutUser\", \"Unable to find UserAuthUC\");\r\n return Promise.reject(new Error(\"Unable to find UserAuthUC\"));\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"logoutUser.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Controllers/logoutUser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AAUH,gCASC;AAhBD,gCAAoC;AAEpC;;;;GAIG;AACH,SAAgB,UAAU,CAAC,UAAyB;IAClD,MAAM,EAAE,GAAG,gBAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAEtC,IAAI,EAAE,EAAE,CAAC;QACP,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,UAAU,CAAC,aAAa,CAAC,YAAY,EAAE,2BAA2B,CAAC,CAAC;QACpE,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;IAChE,CAAC;AACH,CAAC","sourcesContent":["/**\r\n * logoutUser.ts\r\n *\r\n * This file defines a controller function for user logout operations.\r\n * The logoutUser controller provides a simple interface for terminating user\r\n * sessions and clearing authentication state through the VIVED API.\r\n *\r\n * Key concepts:\r\n * - Controller functions handle user input and direct logout operations\r\n * - Validates UserAuthUC existence before performing logout operations\r\n * - Provides error handling and warning messages for missing components\r\n * - Returns promises for async logout workflows\r\n * - Coordinates with UserAuthUC for actual logout logic\r\n *\r\n * Usage pattern:\r\n * 1. Call logoutUser with appObjects repository\r\n * 2. Controller validates UC existence and initiates logout workflow\r\n * 3. Handle returned Promise for logout success or failure\r\n * 4. Error handling provides feedback if authentication UC is unavailable\r\n */\r\n\r\nimport { AppObjectRepo } from \"@vived/core\";\r\nimport { UserAuthUC } from \"../UCs\";\r\n\r\n/**\r\n * Logs out the current user and terminates the session\r\n * @param appObjects The AppObjectRepo containing the UserAuthUC\r\n * @returns Promise that resolves when logout is complete or rejects on error\r\n */\r\nexport function logoutUser(appObjects: AppObjectRepo): Promise<void> {\r\n const uc = UserAuthUC.get(appObjects);\r\n\r\n if (uc) {\r\n return uc.logout();\r\n } else {\r\n appObjects.submitWarning(\"logoutUser\", \"Unable to find UserAuthUC\");\r\n return Promise.reject(new Error(\"Unable to find UserAuthUC\"));\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"setApiStage.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Controllers/setApiStage.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AAUH,kCAOC;AAdD,0CAAuD;AAEvD;;;;GAIG;AACH,SAAgB,WAAW,CAAC,KAAe,EAAE,UAAyB;IACpE,MAAM,OAAO,GAAG,yBAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC/C,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC;IAC3B,CAAC;SAAM,CAAC;QACN,UAAU,CAAC,aAAa,CAAC,aAAa,EAAE,+BAA+B,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC","sourcesContent":["/**\r\n * setApiStage.ts\r\n * \r\n * This file defines a controller function for setting the API stage configuration.\r\n * The setApiStage controller provides a simple interface for changing the API environment\r\n * that the application communicates with.\r\n * \r\n * Key concepts:\r\n * - Controller functions handle user input and direct operations\r\n * - Validates entity existence before performing operations\r\n * - Provides error handling and warning messages for missing components\r\n * - Updates the VivedAPIEntity singleton with new stage configuration\r\n * - Triggers change notifications to update dependent components\r\n * \r\n * Usage pattern:\r\n * 1. Call setApiStage with desired stage and appObjects repository\r\n * 2. Controller validates entity existence and updates configuration\r\n * 3. Change notifications propagate to PMs and UI components\r\n * 4. Error handling provides feedback if entity is not available\r\n */\r\n\r\nimport { AppObjectRepo } from \"@vived/core\";\r\nimport { APIStage, VivedAPIEntity } from \"../Entities\";\r\n\r\n/**\r\n * Sets the API stage configuration for the application\r\n * @param stage The APIStage to set as the current environment\r\n * @param appObjects The AppObjectRepo containing the VivedAPIEntity singleton\r\n */\r\nexport function setApiStage(stage: APIStage, appObjects: AppObjectRepo) {\r\n const sandbox = VivedAPIEntity.get(appObjects);\r\n if (sandbox) {\r\n sandbox.apiStage = stage;\r\n } else {\r\n appObjects.submitWarning(\"setApiStage\", \"Unable to find VivedAPIEntity\");\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"setApiStage.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Controllers/setApiStage.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AAUH,kCAOC;AAdD,0CAAuD;AAEvD;;;;GAIG;AACH,SAAgB,WAAW,CAAC,KAAe,EAAE,UAAyB;IACpE,MAAM,OAAO,GAAG,yBAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC/C,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC;IAC3B,CAAC;SAAM,CAAC;QACN,UAAU,CAAC,aAAa,CAAC,aAAa,EAAE,+BAA+B,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC","sourcesContent":["/**\r\n * setApiStage.ts\r\n *\r\n * This file defines a controller function for setting the API stage configuration.\r\n * The setApiStage controller provides a simple interface for changing the API environment\r\n * that the application communicates with.\r\n *\r\n * Key concepts:\r\n * - Controller functions handle user input and direct operations\r\n * - Validates entity existence before performing operations\r\n * - Provides error handling and warning messages for missing components\r\n * - Updates the VivedAPIEntity singleton with new stage configuration\r\n * - Triggers change notifications to update dependent components\r\n *\r\n * Usage pattern:\r\n * 1. Call setApiStage with desired stage and appObjects repository\r\n * 2. Controller validates entity existence and updates configuration\r\n * 3. Change notifications propagate to PMs and UI components\r\n * 4. Error handling provides feedback if entity is not available\r\n */\r\n\r\nimport { AppObjectRepo } from \"@vived/core\";\r\nimport { APIStage, VivedAPIEntity } from \"../Entities\";\r\n\r\n/**\r\n * Sets the API stage configuration for the application\r\n * @param stage The APIStage to set as the current environment\r\n * @param appObjects The AppObjectRepo containing the VivedAPIEntity singleton\r\n */\r\nexport function setApiStage(stage: APIStage, appObjects: AppObjectRepo) {\r\n const sandbox = VivedAPIEntity.get(appObjects);\r\n if (sandbox) {\r\n sandbox.apiStage = stage;\r\n } else {\r\n appObjects.submitWarning(\"setApiStage\", \"Unable to find VivedAPIEntity\");\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"VivedAPIEntity.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Entities/VivedAPIEntity.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,sCAA6C;AAC7C,sCAKqB;AAErB;;GAEG;AACH,IAAY,QASX;AATD,WAAY,QAAQ;IAClB,4CAA4C;IAC5C,qCAAyB,CAAA;IACzB,qDAAqD;IACrD,+BAAmB,CAAA;IACnB,0CAA0C;IAC1C,uCAA2B,CAAA;IAC3B,oCAAoC;IACpC,2BAAe,CAAA;AACjB,CAAC,EATW,QAAQ,wBAAR,QAAQ,QASnB;AAED;;;;GAIG;AACH,MAAa,cAAe,SAAQ,sBAAe;IAIjD;;;;OAIG;IACH,MAAM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AAuB,CAAC;QAEnC,kDAAkD;QAC1C,qBAAgB,GAAG,IAAI,qBAAc,CAC3C,QAAQ,CAAC,UAAU,EACnB,IAAI,CAAC,cAAc,CACpB,CAAC;QAmCF;;;;WAIG;QACH,mBAAc,GAAG,CAAC,QAAgB,EAAO,EAAE;YACzC,OAAO,IAAI,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC,CAAC;QAEF,kEAAkE;QAC1D,sBAAiB,GAAG,IAAI,qBAAc,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAwBtE,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;;AAhGH,wCAiGC;AAhGC,gDAAgD;AACzC,mBAAI,GAAG,gBAAgB,AAAnB,CAAoB","sourcesContent":["/**\r\n * VivedAPIEntity.ts\r\n * \r\n * This file defines the core entity for managing VIVED API configuration and authentication.\r\n * The VivedAPIEntity acts as a singleton component that centralizes API communication settings,\r\n * including environment-specific base URLs and user authentication tokens.\r\n * \r\n * Key concepts:\r\n * - Manages API stage configuration (Production, Staging, Development, Local)\r\n * - Stores and tracks user authentication tokens\r\n * - Provides environment-specific base URLs for API requests\r\n * - Notifies observers when API settings change\r\n * - Implements singleton pattern for system-wide API configuration\r\n * \r\n * Usage pattern:\r\n * 1. Get the singleton entity using VivedAPIEntity.get(appObjects)\r\n * 2. Configure API stage and user token as needed\r\n * 3. Use baseUrl and getEndpointURL for API requests\r\n * 4. Register change observers to react to configuration updates\r\n */\r\n\r\nimport { MemoizedString } from \"@vived/core\";\r\nimport {\r\n getSingletonComponent,\r\n AppObject,\r\n AppObjectEntity,\r\n AppObjectRepo\r\n} from \"@vived/core\";\r\n\r\n/**\r\n * Enum representing different API environment stages\r\n */\r\nexport enum APIStage {\r\n /** Production environment with live data */\r\n PRODUCTION = \"Production\",\r\n /** Staging environment for pre-production testing */\r\n STAGING = \"Staging\",\r\n /** Development environment for testing */\r\n DEVELOPMENT = \"Development\",\r\n /** Local development environment */\r\n LOCAL = \"LOCAL\"\r\n}\r\n\r\n/**\r\n * VivedAPIEntity manages API configuration and authentication state.\r\n * This singleton entity provides centralized access to API settings including\r\n * environment-specific URLs and user authentication tokens.\r\n */\r\nexport class VivedAPIEntity extends AppObjectEntity {\r\n /** Unique type identifier for this component */\r\n static type = \"VivedAPIEntity\";\r\n\r\n /**\r\n * Retrieves the singleton VivedAPIEntity from the app objects repository\r\n * @param appObjects The AppObjectRepo to get the singleton from\r\n * @returns The VivedAPIEntity singleton or undefined if not found\r\n */\r\n static get(appObjects: AppObjectRepo): VivedAPIEntity | undefined {\r\n return getSingletonComponent(VivedAPIEntity.type, appObjects);\r\n }\r\n\r\n /** Production API base URL */\r\n productionURL = \"https://api.vivedlearning.com\";\r\n /** Staging API base URL */\r\n stagingURL = \"https://api-staging.vivedlearning.com\";\r\n /** Development API base URL */\r\n developmentURL = \"https://api-test.vivedlearning.com\";\r\n /** Local development API base URL */\r\n localURL = \"http://localhost:3001\";\r\n\r\n /** Memoized API stage that notifies on changes */\r\n private memoizedApiState = new MemoizedString(\r\n APIStage.PRODUCTION,\r\n this.notifyOnChange\r\n );\r\n\r\n /**\r\n * Gets the current API stage\r\n * @returns The current APIStage\r\n */\r\n get apiStage() {\r\n return this.memoizedApiState.val as APIStage;\r\n }\r\n \r\n /**\r\n * Sets the API stage and notifies observers of the change\r\n * @param apiState The new APIStage to set\r\n */\r\n set apiStage(apiState: APIStage) {\r\n this.memoizedApiState.val = apiState;\r\n }\r\n\r\n /**\r\n * Gets the base URL for the current API stage\r\n * @returns The base URL string for the current environment\r\n */\r\n get baseUrl(): string {\r\n if (this.memoizedApiState.val === APIStage.PRODUCTION) {\r\n return \"https://api.vivedlearning.com\";\r\n }\r\n if (this.memoizedApiState.val === APIStage.STAGING) {\r\n return \"https://api-staging.vivedlearning.com\";\r\n }\r\n if (this.memoizedApiState.val === APIStage.DEVELOPMENT) {\r\n return \"https://api-test.vivedlearning.com\";\r\n }\r\n return \"http://localhost:3001\";\r\n }\r\n\r\n /**\r\n * Constructs a complete endpoint URL using the current base URL\r\n * @param endpoint The endpoint path to append to the base URL\r\n * @returns A URL object representing the complete endpoint URL\r\n */\r\n getEndpointURL = (endpoint: string): URL => {\r\n return new URL(endpoint, this.baseUrl);\r\n };\r\n\r\n /** Memoized user authentication token that notifies on changes */\r\n private memoizedUserToken = new MemoizedString(\"\", this.notifyOnChange);\r\n \r\n /**\r\n * Gets the current user authentication token\r\n * @returns The current user token string\r\n */\r\n get userToken(): string {\r\n return this.memoizedUserToken.val;\r\n }\r\n \r\n /**\r\n * Sets the user authentication token and notifies observers\r\n * @param val The new user token to set\r\n */\r\n set userToken(val: string) {\r\n this.memoizedUserToken.val = val;\r\n }\r\n\r\n /**\r\n * Constructs a new VivedAPIEntity and registers it as a singleton\r\n * @param appObject The AppObject this entity belongs to\r\n */\r\n constructor(appObject: AppObject) {\r\n super(appObject, VivedAPIEntity.type);\r\n this.appObjects.registerSingleton(this);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"VivedAPIEntity.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Entities/VivedAPIEntity.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,sCAA6C;AAC7C,sCAKqB;AAErB;;GAEG;AACH,IAAY,QASX;AATD,WAAY,QAAQ;IAClB,4CAA4C;IAC5C,qCAAyB,CAAA;IACzB,qDAAqD;IACrD,+BAAmB,CAAA;IACnB,0CAA0C;IAC1C,uCAA2B,CAAA;IAC3B,oCAAoC;IACpC,2BAAe,CAAA;AACjB,CAAC,EATW,QAAQ,wBAAR,QAAQ,QASnB;AAED;;;;GAIG;AACH,MAAa,cAAe,SAAQ,sBAAe;IAIjD;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAC,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,C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AAI,CAAC,cAAc,CACpB,CAAC;QAmCF;;;;WAIG;QACH,mBAAc,GAAG,CAAC,QAAgB,EAAO,EAAE;YACzC,OAAO,IAAI,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC,CAAC;QAEF,kEAAkE;QAC1D,sBAAiB,GAAG,IAAI,qBAAc,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAwBtE,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;;AAhGH,wCAiGC;AAhGC,gDAAgD;AACzC,mBAAI,GAAG,gBAAgB,AAAnB,CAAoB","sourcesContent":["/**\r\n * VivedAPIEntity.ts\r\n *\r\n * This file defines the core entity for managing VIVED API configuration and authentication.\r\n * The VivedAPIEntity acts as a singleton component that centralizes API communication settings,\r\n * including environment-specific base URLs and user authentication tokens.\r\n *\r\n * Key concepts:\r\n * - Manages API stage configuration (Production, Staging, Development, Local)\r\n * - Stores and tracks user authentication tokens\r\n * - Provides environment-specific base URLs for API requests\r\n * - Notifies observers when API settings change\r\n * - Implements singleton pattern for system-wide API configuration\r\n *\r\n * Usage pattern:\r\n * 1. Get the singleton entity using VivedAPIEntity.get(appObjects)\r\n * 2. Configure API stage and user token as needed\r\n * 3. Use baseUrl and getEndpointURL for API requests\r\n * 4. Register change observers to react to configuration updates\r\n */\r\n\r\nimport { MemoizedString } from \"@vived/core\";\r\nimport {\r\n getSingletonComponent,\r\n AppObject,\r\n AppObjectEntity,\r\n AppObjectRepo\r\n} from \"@vived/core\";\r\n\r\n/**\r\n * Enum representing different API environment stages\r\n */\r\nexport enum APIStage {\r\n /** Production environment with live data */\r\n PRODUCTION = \"Production\",\r\n /** Staging environment for pre-production testing */\r\n STAGING = \"Staging\",\r\n /** Development environment for testing */\r\n DEVELOPMENT = \"Development\",\r\n /** Local development environment */\r\n LOCAL = \"LOCAL\"\r\n}\r\n\r\n/**\r\n * VivedAPIEntity manages API configuration and authentication state.\r\n * This singleton entity provides centralized access to API settings including\r\n * environment-specific URLs and user authentication tokens.\r\n */\r\nexport class VivedAPIEntity extends AppObjectEntity {\r\n /** Unique type identifier for this component */\r\n static type = \"VivedAPIEntity\";\r\n\r\n /**\r\n * Retrieves the singleton VivedAPIEntity from the app objects repository\r\n * @param appObjects The AppObjectRepo to get the singleton from\r\n * @returns The VivedAPIEntity singleton or undefined if not found\r\n */\r\n static get(appObjects: AppObjectRepo): VivedAPIEntity | undefined {\r\n return getSingletonComponent(VivedAPIEntity.type, appObjects);\r\n }\r\n\r\n /** Production API base URL */\r\n productionURL = \"https://api.vivedlearning.com\";\r\n /** Staging API base URL */\r\n stagingURL = \"https://api-staging.vivedlearning.com\";\r\n /** Development API base URL */\r\n developmentURL = \"https://api-test.vivedlearning.com\";\r\n /** Local development API base URL */\r\n localURL = \"http://localhost:3001\";\r\n\r\n /** Memoized API stage that notifies on changes */\r\n private memoizedApiState = new MemoizedString(\r\n APIStage.PRODUCTION,\r\n this.notifyOnChange\r\n );\r\n\r\n /**\r\n * Gets the current API stage\r\n * @returns The current APIStage\r\n */\r\n get apiStage() {\r\n return this.memoizedApiState.val as APIStage;\r\n }\r\n\r\n /**\r\n * Sets the API stage and notifies observers of the change\r\n * @param apiState The new APIStage to set\r\n */\r\n set apiStage(apiState: APIStage) {\r\n this.memoizedApiState.val = apiState;\r\n }\r\n\r\n /**\r\n * Gets the base URL for the current API stage\r\n * @returns The base URL string for the current environment\r\n */\r\n get baseUrl(): string {\r\n if (this.memoizedApiState.val === APIStage.PRODUCTION) {\r\n return \"https://api.vivedlearning.com\";\r\n }\r\n if (this.memoizedApiState.val === APIStage.STAGING) {\r\n return \"https://api-staging.vivedlearning.com\";\r\n }\r\n if (this.memoizedApiState.val === APIStage.DEVELOPMENT) {\r\n return \"https://api-test.vivedlearning.com\";\r\n }\r\n return \"http://localhost:3001\";\r\n }\r\n\r\n /**\r\n * Constructs a complete endpoint URL using the current base URL\r\n * @param endpoint The endpoint path to append to the base URL\r\n * @returns A URL object representing the complete endpoint URL\r\n */\r\n getEndpointURL = (endpoint: string): URL => {\r\n return new URL(endpoint, this.baseUrl);\r\n };\r\n\r\n /** Memoized user authentication token that notifies on changes */\r\n private memoizedUserToken = new MemoizedString(\"\", this.notifyOnChange);\r\n\r\n /**\r\n * Gets the current user authentication token\r\n * @returns The current user token string\r\n */\r\n get userToken(): string {\r\n return this.memoizedUserToken.val;\r\n }\r\n\r\n /**\r\n * Sets the user authentication token and notifies observers\r\n * @param val The new user token to set\r\n */\r\n set userToken(val: string) {\r\n this.memoizedUserToken.val = val;\r\n }\r\n\r\n /**\r\n * Constructs a new VivedAPIEntity and registers it as a singleton\r\n * @param appObject The AppObject this entity belongs to\r\n */\r\n constructor(appObject: AppObject) {\r\n super(appObject, VivedAPIEntity.type);\r\n this.appObjects.registerSingleton(this);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Entities/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;AAEH,mDAAiC","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
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Entities/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;AAEH,mDAAiC","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,4DAA0C;AAC1C,oDAAkC;AAClC,6CAA2B","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
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Factories/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;AAEH,4DAA0C;AAC1C,oDAAkC;AAClC,6CAA2B","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;;AAuBH,0DAqBC;AAzCD,0CAA6C;AAC7C,gCAAyC;AACzC,gCAYgB;AAEhB;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,UAAyB;IAC/D,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAE/C,WAAW;IACX,IAAI,yBAAc,CAAC,EAAE,CAAC,CAAC;IAEvB,MAAM;IACN,IAAA,4BAAsB,EAAC,EAAE,CAAC,CAAC;IAC3B,IAAA,iCAA2B,EAAC,EAAE,CAAC,CAAC;IAChC,IAAA,iCAA2B,EAAC,EAAE,CAAC,CAAC;IAChC,IAAA,sBAAgB,EAAC,EAAE,CAAC,CAAC;IACrB,IAAA,yBAAmB,EAAC,EAAE,CAAC,CAAC;IACxB,IAAA,oCAA8B,EAAC,EAAE,CAAC,CAAC;IACnC,IAAA,0BAAoB,EAAC,EAAE,CAAC,CAAC;IACzB,IAAA,gCAA0B,EAAC,EAAE,CAAC,CAAC;IAC/B,IAAA,0BAAoB,EAAC,EAAE,CAAC,CAAC;IACzB,IAAA,sBAAgB,EAAC,EAAE,CAAC,CAAC;IACrB,IAAA,wBAAkB,EAAC,EAAE,CAAC,CAAC;IAEvB,MAAM;IACN,IAAA,qBAAe,EAAC,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
+ {"version":3,"file":"setupVivedAPIForSandbox.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Factories/setupVivedAPIForSandbox.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAuBH,0DAqBC;AAzCD,0CAA6C;AAC7C,gCAAyC;AACzC,gCAYgB;AAEhB;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,UAAyB;IAC/D,MAAM,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAE/C,WAAW;IACX,IAAI,yBAAc,CAAC,EAAE,CAAC,CAAC;IAEvB,MAAM;IACN,IAAA,4BAAsB,EAAC,EAAE,CAAC,CAAC;IAC3B,IAAA,iCAA2B,EAAC,EAAE,CAAC,CAAC;IAChC,IAAA,iCAA2B,EAAC,EAAE,CAAC,CAAC;IAChC,IAAA,sBAAgB,EAAC,EAAE,CAAC,CAAC;IACrB,IAAA,yBAAmB,EAAC,EAAE,CAAC,CAAC;IACxB,IAAA,oCAA8B,EAAC,EAAE,CAAC,CAAC;IACnC,IAAA,0BAAoB,EAAC,EAAE,CAAC,CAAC;IACzB,IAAA,gCAA0B,EAAC,EAAE,CAAC,CAAC;IAC/B,IAAA,0BAAoB,EAAC,EAAE,CAAC,CAAC;IACzB,IAAA,sBAAgB,EAAC,EAAE,CAAC,CAAC;IACrB,IAAA,wBAAkB,EAAC,EAAE,CAAC,CAAC;IAEvB,MAAM;IACN,IAAA,qBAAe,EAAC,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;;;AA2BH,sDAEC;AA1BD,wDAAqD;AAErD;;;GAGG;AACH,MAAa,iBAAkB,SAAQ,6BAAa;IAIlD;;;OAGG;IACH,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,6BAAa,CAAC,IAAI,CAAC,CAAC;QARvC,kDAAkD;QAClD,cAAS,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAQtB,CAAC;CACF;AAXD,8CAWC;AAED;;;;GAIG;AACH,SAAgB,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
+ {"version":3,"file":"MockJsonRequestUC.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Mocks/MockJsonRequestUC.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AA2BH,sDAEC;AA1BD,wDAAqD;AAErD;;;GAGG;AACH,MAAa,iBAAkB,SAAQ,6BAAa;IAIlD;;;OAGG;IACH,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,6BAAa,CAAC,IAAI,CAAC,CAAC;QARvC,kDAAkD;QAClD,cAAS,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAQtB,CAAC;CACF;AAXD,8CAWC;AAED;;;;GAIG;AACH,SAAgB,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,mDAAiC;AACjC,qDAAmC;AACnC,sDAAoC;AACpC,2DAAyC;AACzC,gEAA8C;AAC9C,gEAA8C;AAC9C,mDAAiC;AACjC,wDAAsC;AACtC,4DAA0C;AAC1C,sDAAoC;AACpC,yDAAuC;AACvC,+DAA6C;AAC7C,yDAAuC;AACvC,qDAAmC;AACnC,uDAAqC;AACrC,wDAAsC;AACtC,oDAAkC;AAClC,oDAAkC","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
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/VivedAPI/Mocks/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;;;;;;;;;;;;;;AAEH,mDAAiC;AACjC,qDAAmC;AACnC,sDAAoC;AACpC,2DAAyC;AACzC,gEAA8C;AAC9C,gEAA8C;AAC9C,mDAAiC;AACjC,wDAAsC;AACtC,4DAA0C;AAC1C,sDAAoC;AACpC,yDAAuC;AACvC,+DAA6C;AAC7C,yDAAuC;AACvC,qDAAmC;AACnC,uDAAqC;AACrC,wDAAsC;AACtC,oDAAkC;AAClC,oDAAkC","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;;;;;;;;;;;;;;;;;;;GAmBG;;;AAiCH,wCAEC;AAjCD,sCAKqB;AACrB,0CAAuD;AAEvD;;;GAGG;AACH,MAAsB,UAAW,SAAQ,kBAAqB;IAI5D;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAa,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACxE,CAAC;;AAXH,gCAYC;AAXC,gDAAgD;AACzC,eAAI,GAAG,YAAY,CAAC;AAY7B;;;;GAIG;AACH,SAAgB,cAAc,CAAC,SAAoB;IACjD,OAAO,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,MAAM,aAAc,SAAQ,UAAU;IACpC;;;OAGG;IACH,IAAY,GAAG;QACb,OAAO,IAAI,CAAC,kBAAkB,CAAiB,yBAAc,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,CAAW,EAAE,CAAW;QAClC,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAYD;;;OAGG;IACH,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;QAfpC;;;WAGG;QACH,mBAAc,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,IAAI,CAAC,GAAG;gBAAE,OAAO;YAEtB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvC,CAAC,CAAC;QAQA,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAExC,IAAI,CAAC,GAAG,EAAE,iBAAiB,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
+ {"version":3,"file":"ApiStagePM.js","sourceRoot":"","sources":["../../../../src/VivedAPI/PMs/ApiStagePM.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAiCH,wCAEC;AAjCD,sCAKqB;AACrB,0CAAuD;AAEvD;;;GAGG;AACH,MAAsB,UAAW,SAAQ,kBAAqB;IAI5D;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,UAAyB;QAClC,OAAO,IAAA,4BAAqB,EAAa,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACxE,CAAC;;AAXH,gCAYC;AAXC,gDAAgD;AACzC,eAAI,GAAG,YAAY,CAAC;AAY7B;;;;GAIG;AACH,SAAgB,cAAc,CAAC,SAAoB;IACjD,OAAO,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,MAAM,aAAc,SAAQ,UAAU;IACpC;;;OAGG;IACH,IAAY,GAAG;QACb,OAAO,IAAI,CAAC,kBAAkB,CAAiB,yBAAc,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,CAAW,EAAE,CAAW;QAClC,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAYD;;;OAGG;IACH,YAAY,SAAoB;QAC9B,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;QAfpC;;;WAGG;QACH,mBAAc,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,IAAI,CAAC,GAAG;gBAAE,OAAO;YAEtB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvC,CAAC,CAAC;QAQA,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAExC,IAAI,CAAC,GAAG,EAAE,iBAAiB,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;;;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;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.onEntityCh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AC;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 * \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
+ {"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 * \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
+ {"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 * \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
+ {"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"]}