@gen3/frontend 0.11.25 → 0.11.27

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 (151) hide show
  1. package/dist/cjs/index.js +257 -4
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/dts/components/Buttons/index.d.ts +1 -0
  4. package/dist/dts/components/Buttons/index.d.ts.map +1 -1
  5. package/dist/dts/components/Buttons/index.js +1 -0
  6. package/dist/dts/components/Buttons/index.js.map +1 -1
  7. package/dist/dts/components/Providers/Gen3Provider.d.ts +6 -6
  8. package/dist/dts/components/SegmentedControl.stories.d.ts +374 -0
  9. package/dist/dts/components/SegmentedControl.stories.d.ts.map +1 -0
  10. package/dist/dts/components/SegmentedControl.stories.js +28 -0
  11. package/dist/dts/components/SegmentedControl.stories.js.map +1 -0
  12. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +4 -4
  13. package/dist/dts/features/CohortBuilder/ExplorerTable/AccessCellRenderers.d.ts +3 -0
  14. package/dist/dts/features/CohortBuilder/ExplorerTable/AccessCellRenderers.d.ts.map +1 -0
  15. package/dist/dts/features/CohortBuilder/ExplorerTable/AccessCellRenderers.js +46 -0
  16. package/dist/dts/features/CohortBuilder/ExplorerTable/AccessCellRenderers.js.map +1 -0
  17. package/dist/dts/features/CohortBuilder/ExplorerTable/ArrayCellRenderer.d.ts +1 -1
  18. package/dist/dts/features/CohortBuilder/Repository/Repository.d.ts +4 -0
  19. package/dist/dts/features/CohortBuilder/Repository/Repository.d.ts.map +1 -0
  20. package/dist/dts/features/CohortBuilder/Repository/Repository.js +8 -0
  21. package/dist/dts/features/CohortBuilder/Repository/Repository.js.map +1 -0
  22. package/dist/dts/features/CohortBuilder/Repository/index.d.ts +4 -0
  23. package/dist/dts/features/CohortBuilder/Repository/index.d.ts.map +1 -0
  24. package/dist/dts/features/CohortBuilder/Repository/index.js +3 -0
  25. package/dist/dts/features/CohortBuilder/Repository/index.js.map +1 -0
  26. package/dist/dts/features/CohortBuilder/Repository/types.d.ts +12 -0
  27. package/dist/dts/features/CohortBuilder/Repository/types.d.ts.map +1 -0
  28. package/dist/dts/features/CohortBuilder/Repository/types.js.map +1 -0
  29. package/dist/dts/lib/session/session.d.ts.map +1 -1
  30. package/dist/dts/lib/session/session.js +36 -1
  31. package/dist/dts/lib/session/session.js.map +1 -1
  32. package/dist/dts/pages/Repository/Repository.d.ts +4 -0
  33. package/dist/dts/pages/Repository/Repository.d.ts.map +1 -0
  34. package/dist/dts/pages/Repository/Repository.js +24 -0
  35. package/dist/dts/pages/Repository/Repository.js.map +1 -0
  36. package/dist/dts/pages/Repository/data.d.ts +4 -0
  37. package/dist/dts/pages/Repository/data.d.ts.map +1 -0
  38. package/dist/dts/{features/CohortBuilder/CohortManager/cohortActionHooks.js → pages/Repository/data.js} +55 -42
  39. package/dist/dts/pages/Repository/data.js.map +1 -0
  40. package/dist/dts/pages/Repository/index.d.ts +4 -0
  41. package/dist/dts/pages/Repository/index.d.ts.map +1 -0
  42. package/dist/dts/pages/Repository/index.js +4 -0
  43. package/dist/dts/pages/Repository/index.js.map +1 -0
  44. package/dist/dts/pages/Repository/types.d.ts +6 -0
  45. package/dist/dts/pages/Repository/types.d.ts.map +1 -0
  46. package/dist/dts/pages/Repository/types.js +2 -0
  47. package/dist/dts/pages/Repository/types.js.map +1 -0
  48. package/dist/dts/types/icons.d.ts +2 -2
  49. package/dist/dts/types/icons.d.ts.map +1 -1
  50. package/dist/dts/types/icons.js +2 -2
  51. package/dist/dts/types/icons.js.map +1 -1
  52. package/dist/esm/index.js +259 -6
  53. package/dist/esm/index.js.map +1 -1
  54. package/dist/index.d.ts +6 -6
  55. package/dist/tsconfig.tsbuildinfo +1 -1
  56. package/package.json +3 -3
  57. package/dist/dts/components/DropdownMenu/DropdownMenu.d.ts +0 -64
  58. package/dist/dts/components/DropdownMenu/DropdownMenu.d.ts.map +0 -1
  59. package/dist/dts/components/DropdownMenu/DropdownMenu.js +0 -38
  60. package/dist/dts/components/DropdownMenu/DropdownMenu.js.map +0 -1
  61. package/dist/dts/components/DropdownMenu/DropdownMenu.unit.test.d.ts +0 -2
  62. package/dist/dts/components/DropdownMenu/DropdownMenu.unit.test.d.ts.map +0 -1
  63. package/dist/dts/components/DropdownMenu/DropdownMenu.unit.test.js +0 -141
  64. package/dist/dts/components/DropdownMenu/DropdownMenu.unit.test.js.map +0 -1
  65. package/dist/dts/components/DropdownMenu/index.d.ts +0 -3
  66. package/dist/dts/components/DropdownMenu/index.d.ts.map +0 -1
  67. package/dist/dts/components/DropdownMenu/index.js +0 -3
  68. package/dist/dts/components/DropdownMenu/index.js.map +0 -1
  69. package/dist/dts/components/MessageCards/ErrorMessage.d.ts +0 -7
  70. package/dist/dts/components/MessageCards/ErrorMessage.d.ts.map +0 -1
  71. package/dist/dts/components/MessageCards/ErrorMessage.js +0 -8
  72. package/dist/dts/components/MessageCards/ErrorMessage.js.map +0 -1
  73. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.d.ts +0 -20
  74. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.d.ts.map +0 -1
  75. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.js +0 -37
  76. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.js.map +0 -1
  77. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotificationProvider.d.ts +0 -9
  78. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotificationProvider.d.ts.map +0 -1
  79. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotificationProvider.js +0 -122
  80. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotificationProvider.js.map +0 -1
  81. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotifications.d.ts +0 -19
  82. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotifications.d.ts.map +0 -1
  83. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotifications.js +0 -52
  84. package/dist/dts/features/CohortBuilder/CohortManager/CohortNotifications.js.map +0 -1
  85. package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.d.ts +0 -10
  86. package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.d.ts.map +0 -1
  87. package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.js +0 -37
  88. package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.js.map +0 -1
  89. package/dist/dts/features/CohortBuilder/CohortManager/CustomCohortSelectItem.d.ts +0 -13
  90. package/dist/dts/features/CohortBuilder/CohortManager/CustomCohortSelectItem.d.ts.map +0 -1
  91. package/dist/dts/features/CohortBuilder/CohortManager/CustomCohortSelectItem.js +0 -33
  92. package/dist/dts/features/CohortBuilder/CohortManager/CustomCohortSelectItem.js.map +0 -1
  93. package/dist/dts/features/CohortBuilder/CohortManager/cohortActionHooks.d.ts +0 -7
  94. package/dist/dts/features/CohortBuilder/CohortManager/cohortActionHooks.d.ts.map +0 -1
  95. package/dist/dts/features/CohortBuilder/CohortManager/cohortActionHooks.js.map +0 -1
  96. package/dist/dts/features/CohortBuilder/CohortManager/commonIcons.d.ts +0 -5
  97. package/dist/dts/features/CohortBuilder/CohortManager/commonIcons.d.ts.map +0 -1
  98. package/dist/dts/features/CohortBuilder/CohortManager/commonIcons.js +0 -5
  99. package/dist/dts/features/CohortBuilder/CohortManager/commonIcons.js.map +0 -1
  100. package/dist/dts/features/CohortBuilder/CohortManager/index.d.ts +0 -5
  101. package/dist/dts/features/CohortBuilder/CohortManager/index.d.ts.map +0 -1
  102. package/dist/dts/features/CohortBuilder/CohortManager/index.js +0 -4
  103. package/dist/dts/features/CohortBuilder/CohortManager/index.js.map +0 -1
  104. package/dist/dts/features/CohortBuilder/CohortManager/modals/GenericCohortModal.d.ts +0 -13
  105. package/dist/dts/features/CohortBuilder/CohortManager/modals/GenericCohortModal.d.ts.map +0 -1
  106. package/dist/dts/features/CohortBuilder/CohortManager/modals/GenericCohortModal.js +0 -15
  107. package/dist/dts/features/CohortBuilder/CohortManager/modals/GenericCohortModal.js.map +0 -1
  108. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortErrorModal.d.ts +0 -4
  109. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortErrorModal.d.ts.map +0 -1
  110. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortErrorModal.js +0 -8
  111. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortErrorModal.js.map +0 -1
  112. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.d.ts +0 -32
  113. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.d.ts.map +0 -1
  114. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.js +0 -190
  115. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.js.map +0 -1
  116. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.unit.test.d.ts +0 -2
  117. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.unit.test.d.ts.map +0 -1
  118. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.unit.test.js +0 -145
  119. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.unit.test.js.map +0 -1
  120. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.d.ts +0 -29
  121. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.d.ts.map +0 -1
  122. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.js +0 -79
  123. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.js.map +0 -1
  124. package/dist/dts/features/CohortBuilder/CohortManager/style.d.ts +0 -5
  125. package/dist/dts/features/CohortBuilder/CohortManager/style.d.ts.map +0 -1
  126. package/dist/dts/features/CohortBuilder/CohortManager/style.js +0 -21
  127. package/dist/dts/features/CohortBuilder/CohortManager/style.js.map +0 -1
  128. package/dist/dts/features/CohortBuilder/CohortManager/types.d.ts +0 -49
  129. package/dist/dts/features/CohortBuilder/CohortManager/types.d.ts.map +0 -1
  130. package/dist/dts/features/CohortBuilder/CohortManager/types.js.map +0 -1
  131. package/dist/dts/features/CohortBuilder/CohortManager.d.ts +0 -6
  132. package/dist/dts/features/CohortBuilder/CohortManager.d.ts.map +0 -1
  133. package/dist/dts/features/CohortBuilder/CohortManager.js +0 -8
  134. package/dist/dts/features/CohortBuilder/CohortManager.js.map +0 -1
  135. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortStorage.d.ts +0 -64
  136. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortStorage.d.ts.map +0 -1
  137. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortStorage.js +0 -572
  138. package/dist/dts/features/CohortDiscovery/CohortManagment/CohortStorage.js.map +0 -1
  139. package/dist/dts/features/CohortDiscovery/CohortSelectors.d.ts +0 -1
  140. package/dist/dts/features/CohortDiscovery/CohortSelectors.d.ts.map +0 -1
  141. package/dist/dts/features/CohortDiscovery/CohortSelectors.js +0 -41
  142. package/dist/dts/features/CohortDiscovery/CohortSelectors.js.map +0 -1
  143. package/dist/dts/features/CohortDiscovery/CohortSlice.d.ts +0 -1
  144. package/dist/dts/features/CohortDiscovery/CohortSlice.d.ts.map +0 -1
  145. package/dist/dts/features/CohortDiscovery/CohortSlice.js +0 -162
  146. package/dist/dts/features/CohortDiscovery/CohortSlice.js.map +0 -1
  147. package/dist/dts/features/CohortDiscovery/SavedCohortManagerSlice.d.ts +0 -1
  148. package/dist/dts/features/CohortDiscovery/SavedCohortManagerSlice.d.ts.map +0 -1
  149. package/dist/dts/features/CohortDiscovery/SavedCohortManagerSlice.js +0 -284
  150. package/dist/dts/features/CohortDiscovery/SavedCohortManagerSlice.js.map +0 -1
  151. /package/dist/dts/features/CohortBuilder/{CohortManager → Repository}/types.js +0 -0
@@ -1,572 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
23
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
49
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
50
- if (ar || !(i in from)) {
51
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
52
- ar[i] = from[i];
53
- }
54
- }
55
- return to.concat(ar || Array.prototype.slice.call(from));
56
- };
57
- import { openDB } from 'idb';
58
- import { getTimestamp } from '@gen3/core';
59
- var DATABASE_NAME = 'Gen3CohortDiscovery';
60
- var STORE_NAME = 'cohorts';
61
- var DB_SCHEMA_VERSION = 1;
62
- var CohortStorage = /** @class */ (function () {
63
- function CohortStorage() {
64
- }
65
- CohortStorage.prototype.getDb = function () {
66
- try {
67
- return openDB(DATABASE_NAME, 1, {
68
- upgrade: function (db) {
69
- if (!db.objectStoreNames.contains(STORE_NAME)) {
70
- db.createObjectStore(STORE_NAME, { keyPath: 'id' });
71
- }
72
- },
73
- });
74
- }
75
- catch (error) {
76
- var errorMessage = 'Unknown error';
77
- if (error instanceof Error) {
78
- errorMessage = error.message;
79
- }
80
- throw new Error("Database initialization failed: ".concat(errorMessage));
81
- }
82
- };
83
- /**
84
- * Initialize the IndexedDB database with proper schema
85
- */
86
- CohortStorage.prototype.initializeDB = function () {
87
- return __awaiter(this, void 0, void 0, function () {
88
- var error_1, errorMessage;
89
- return __generator(this, function (_a) {
90
- switch (_a.label) {
91
- case 0:
92
- _a.trys.push([0, 2, , 3]);
93
- return [4 /*yield*/, openDB(DATABASE_NAME, DB_SCHEMA_VERSION, {
94
- upgrade: function (db) {
95
- if (!db.objectStoreNames.contains(STORE_NAME)) {
96
- db.createObjectStore(STORE_NAME, { keyPath: 'id' });
97
- }
98
- },
99
- blocked: function () {
100
- console.warn('CohortDB: Database upgrade blocked by another connection');
101
- },
102
- blocking: function () {
103
- console.warn('CohortDB: This connection is blocking a database upgrade');
104
- },
105
- terminated: function () {
106
- console.error('CohortDB: Database connection terminated unexpectedly');
107
- },
108
- })];
109
- case 1: return [2 /*return*/, _a.sent()];
110
- case 2:
111
- error_1 = _a.sent();
112
- errorMessage = 'Unknown error';
113
- if (error_1 instanceof Error) {
114
- errorMessage = error_1.message;
115
- }
116
- throw new Error("Database initialization failed: ".concat(errorMessage));
117
- case 3: return [2 /*return*/];
118
- }
119
- });
120
- });
121
- };
122
- // ===== CREATE OPERATIONS =====
123
- /**
124
- * Save a single cohort to the database
125
- */
126
- CohortStorage.prototype.saveCohort = function (cohort) {
127
- return __awaiter(this, void 0, void 0, function () {
128
- var db, tx, _error_1;
129
- return __generator(this, function (_a) {
130
- switch (_a.label) {
131
- case 0:
132
- _a.trys.push([0, 3, , 4]);
133
- return [4 /*yield*/, this.getDb()];
134
- case 1:
135
- db = _a.sent();
136
- tx = db.transaction(STORE_NAME, 'readwrite');
137
- tx.objectStore(STORE_NAME).put(cohort);
138
- return [4 /*yield*/, tx.done];
139
- case 2:
140
- _a.sent();
141
- return [2 /*return*/, { status: 200, message: 'cohort added' }];
142
- case 3:
143
- _error_1 = _a.sent();
144
- return [2 /*return*/, { isError: true, status: 500, message: 'unable to save cohort' }];
145
- case 4: return [2 /*return*/];
146
- }
147
- });
148
- });
149
- };
150
- /**
151
- * Save multiple cohorts in a single transaction (bulk operation)
152
- */
153
- CohortStorage.prototype.saveCohorts = function (cohorts) {
154
- return __awaiter(this, void 0, void 0, function () {
155
- var db, tx_1, _error_2;
156
- return __generator(this, function (_a) {
157
- switch (_a.label) {
158
- case 0:
159
- if (cohorts.length === 0)
160
- return [2 /*return*/, {
161
- isError: true,
162
- status: 400,
163
- message: 'cannot add an empty array',
164
- }];
165
- _a.label = 1;
166
- case 1:
167
- _a.trys.push([1, 4, , 5]);
168
- return [4 /*yield*/, this.getDb()];
169
- case 2:
170
- db = _a.sent();
171
- tx_1 = db.transaction(STORE_NAME, 'readwrite');
172
- // Batch all operations in single transaction for better performance
173
- return [4 /*yield*/, Promise.all(__spreadArray(__spreadArray([], cohorts.map(function (cohort) { return tx_1.store.put(__assign(__assign({}, cohort), { saved: true })); }), true), [
174
- tx_1.done,
175
- ], false))];
176
- case 3:
177
- // Batch all operations in single transaction for better performance
178
- _a.sent();
179
- return [2 /*return*/, { status: 200, message: 'cohorts added' }];
180
- case 4:
181
- _error_2 = _a.sent();
182
- return [2 /*return*/, { isError: true, status: 500, message: 'unable to save cohort' }];
183
- case 5: return [2 /*return*/];
184
- }
185
- });
186
- });
187
- };
188
- // ===== READ OPERATIONS =====
189
- /**
190
- * Get a specific cohort by ID
191
- */
192
- CohortStorage.prototype.getCohort = function (id) {
193
- return __awaiter(this, void 0, void 0, function () {
194
- var db, tx, store, cohort, _error_3;
195
- return __generator(this, function (_a) {
196
- switch (_a.label) {
197
- case 0:
198
- _a.trys.push([0, 3, , 4]);
199
- return [4 /*yield*/, this.getDb()];
200
- case 1:
201
- db = _a.sent();
202
- tx = db.transaction(STORE_NAME, 'readonly');
203
- store = tx.objectStore(STORE_NAME);
204
- return [4 /*yield*/, store.get(id)];
205
- case 2:
206
- cohort = (_a.sent());
207
- return [2 /*return*/, {
208
- status: 200,
209
- message: 'success',
210
- data: cohort,
211
- }];
212
- case 3:
213
- _error_3 = _a.sent();
214
- return [2 /*return*/, {
215
- isError: true,
216
- status: 401,
217
- message: "cannot find cohort ".concat(id),
218
- }];
219
- case 4: return [2 /*return*/];
220
- }
221
- });
222
- });
223
- };
224
- /**
225
- * Get all cohorts from the database
226
- */
227
- CohortStorage.prototype.getAllCohorts = function () {
228
- return __awaiter(this, void 0, void 0, function () {
229
- var db, tx, store, savedCohorts, cohorts, _error_4;
230
- return __generator(this, function (_a) {
231
- switch (_a.label) {
232
- case 0:
233
- _a.trys.push([0, 3, , 4]);
234
- return [4 /*yield*/, this.getDb()];
235
- case 1:
236
- db = _a.sent();
237
- tx = db.transaction(STORE_NAME, 'readonly');
238
- store = tx.objectStore(STORE_NAME);
239
- return [4 /*yield*/, store.getAll()];
240
- case 2:
241
- savedCohorts = (_a.sent());
242
- if (!savedCohorts) {
243
- return [2 /*return*/, {
244
- isError: true,
245
- status: 500,
246
- message: 'no cohorts returned',
247
- }];
248
- }
249
- cohorts = savedCohorts.reduce(function (acc, cohort) {
250
- var id = cohort.id;
251
- acc[id] = cohort;
252
- return acc;
253
- }, {});
254
- return [2 /*return*/, {
255
- status: 200,
256
- message: 'success',
257
- data: cohorts,
258
- }];
259
- case 3:
260
- _error_4 = _a.sent();
261
- return [2 /*return*/, { isError: true, status: 401, message: 'cannot return cohorts' }];
262
- case 4: return [2 /*return*/];
263
- }
264
- });
265
- });
266
- };
267
- /**
268
- * Search cohorts by name (case-insensitive partial match)
269
- */
270
- CohortStorage.prototype.searchCohortsByName = function (searchTerm) {
271
- return __awaiter(this, void 0, void 0, function () {
272
- var db, tx, store, allCohorts, searchLower_1, _error_5;
273
- return __generator(this, function (_a) {
274
- switch (_a.label) {
275
- case 0:
276
- _a.trys.push([0, 3, , 4]);
277
- return [4 /*yield*/, this.getDb()];
278
- case 1:
279
- db = _a.sent();
280
- tx = db.transaction(STORE_NAME, 'readonly');
281
- store = tx.objectStore(STORE_NAME);
282
- return [4 /*yield*/, store.getAll(STORE_NAME)];
283
- case 2:
284
- allCohorts = (_a.sent());
285
- searchLower_1 = searchTerm.toLowerCase();
286
- return [2 /*return*/, {
287
- status: 200,
288
- message: 'success',
289
- data: allCohorts
290
- .filter(function (cohort) { return cohort.name.toLowerCase().includes(searchLower_1); })
291
- .reduce(function (acc, cohort) {
292
- var id = cohort.id;
293
- acc[id] = cohort;
294
- return acc;
295
- }, {}),
296
- }];
297
- case 3:
298
- _error_5 = _a.sent();
299
- return [2 /*return*/, { isError: true, status: 401, message: 'cannot find cohorts' }];
300
- case 4: return [2 /*return*/];
301
- }
302
- });
303
- });
304
- };
305
- /**
306
- * Count total number of cohorts
307
- */
308
- CohortStorage.prototype.getCohortCount = function () {
309
- return __awaiter(this, void 0, void 0, function () {
310
- var db, total, _error_6;
311
- return __generator(this, function (_a) {
312
- switch (_a.label) {
313
- case 0:
314
- _a.trys.push([0, 3, , 4]);
315
- return [4 /*yield*/, this.getDb()];
316
- case 1:
317
- db = _a.sent();
318
- return [4 /*yield*/, db.count(STORE_NAME)];
319
- case 2:
320
- total = _a.sent();
321
- return [2 /*return*/, {
322
- status: 200,
323
- message: 'success',
324
- data: total,
325
- }];
326
- case 3:
327
- _error_6 = _a.sent();
328
- return [2 /*return*/, {
329
- isError: true,
330
- status: 401,
331
- message: 'cannot find cohort count',
332
- }];
333
- case 4: return [2 /*return*/];
334
- }
335
- });
336
- });
337
- };
338
- // ===== UPDATE OPERATIONS =====
339
- /**
340
- * Update an existing cohort (full replacement)
341
- */
342
- CohortStorage.prototype.updateCohort = function (cohort) {
343
- return __awaiter(this, void 0, void 0, function () {
344
- var db, tx, store, existing, timestamp, updated, error_2, errorMessage;
345
- return __generator(this, function (_a) {
346
- switch (_a.label) {
347
- case 0:
348
- _a.trys.push([0, 4, , 5]);
349
- return [4 /*yield*/, this.getDb()];
350
- case 1:
351
- db = _a.sent();
352
- tx = db.transaction(STORE_NAME, 'readwrite');
353
- store = tx.objectStore(STORE_NAME);
354
- return [4 /*yield*/, store.get(cohort.id)];
355
- case 2:
356
- existing = _a.sent();
357
- if (!existing) {
358
- return [2 /*return*/, {
359
- isError: true,
360
- status: 401,
361
- message: 'cohort not found',
362
- }];
363
- }
364
- timestamp = getTimestamp();
365
- updated = __assign(__assign({}, existing), { modifiedDatetime: timestamp });
366
- store.put(updated);
367
- return [4 /*yield*/, tx.done];
368
- case 3:
369
- _a.sent();
370
- return [2 /*return*/, { status: 200, message: 'success' }];
371
- case 4:
372
- error_2 = _a.sent();
373
- errorMessage = 'An unknown error occurred';
374
- if (error_2 instanceof Error) {
375
- errorMessage = error_2.message;
376
- }
377
- return [2 /*return*/, {
378
- isError: true,
379
- status: 500,
380
- message: "Unable to update cohort: ".concat(cohort.id, ". Error: ").concat(errorMessage),
381
- }];
382
- case 5: return [2 /*return*/];
383
- }
384
- });
385
- });
386
- };
387
- // ===== DELETE OPERATIONS =====
388
- /**
389
- * Delete a specific cohort by ID
390
- */
391
- CohortStorage.prototype.deleteCohort = function (id) {
392
- return __awaiter(this, void 0, void 0, function () {
393
- var db, tx, store, existing, error_3, errorMessage;
394
- return __generator(this, function (_a) {
395
- switch (_a.label) {
396
- case 0:
397
- _a.trys.push([0, 4, , 5]);
398
- return [4 /*yield*/, this.getDb()];
399
- case 1:
400
- db = _a.sent();
401
- tx = db.transaction(STORE_NAME, 'readwrite');
402
- store = tx.objectStore(STORE_NAME);
403
- return [4 /*yield*/, db.get(STORE_NAME, id)];
404
- case 2:
405
- existing = _a.sent();
406
- if (!existing) {
407
- return [2 /*return*/, {
408
- isError: true,
409
- status: 401,
410
- message: 'cohort not found',
411
- }];
412
- }
413
- store.delete(id);
414
- return [4 /*yield*/, tx.done];
415
- case 3:
416
- _a.sent();
417
- return [2 /*return*/, { status: 200, message: "".concat(id, " deleted") }];
418
- case 4:
419
- error_3 = _a.sent();
420
- errorMessage = error_3 instanceof Error ? error_3.message : 'An unknown error occurred';
421
- return [2 /*return*/, {
422
- isError: true,
423
- status: 500,
424
- message: "Unable to delete cohort: ".concat(id, ". Error: ").concat(errorMessage),
425
- }];
426
- case 5: return [2 /*return*/];
427
- }
428
- });
429
- });
430
- };
431
- /**
432
- * Delete all cohorts from the database
433
- */
434
- CohortStorage.prototype.deleteAllCohorts = function () {
435
- return __awaiter(this, void 0, void 0, function () {
436
- var db, tx, store, error_4, errorMessage;
437
- return __generator(this, function (_a) {
438
- switch (_a.label) {
439
- case 0:
440
- _a.trys.push([0, 3, , 4]);
441
- return [4 /*yield*/, this.getDb()];
442
- case 1:
443
- db = _a.sent();
444
- tx = db.transaction(STORE_NAME, 'readwrite');
445
- store = tx.objectStore(STORE_NAME);
446
- store.clear();
447
- return [4 /*yield*/, tx.done];
448
- case 2:
449
- _a.sent();
450
- return [2 /*return*/, { status: 200, message: "all cohorts deleted" }];
451
- case 3:
452
- error_4 = _a.sent();
453
- errorMessage = error_4 instanceof Error ? error_4.message : 'An unknown error occurred';
454
- return [2 /*return*/, {
455
- isError: true,
456
- status: 500,
457
- message: "Unable to delete all cohorts. Error: ".concat(errorMessage),
458
- }];
459
- case 4: return [2 /*return*/];
460
- }
461
- });
462
- });
463
- };
464
- // ===== UTILITY OPERATIONS =====
465
- /**
466
- * Check if a cohort exists
467
- */
468
- CohortStorage.prototype.cohortExists = function (id) {
469
- return __awaiter(this, void 0, void 0, function () {
470
- var db, tx, store, existing, error_5, errorMessage;
471
- return __generator(this, function (_a) {
472
- switch (_a.label) {
473
- case 0:
474
- _a.trys.push([0, 3, , 4]);
475
- return [4 /*yield*/, this.getDb()];
476
- case 1:
477
- db = _a.sent();
478
- tx = db.transaction(STORE_NAME, 'readwrite');
479
- store = tx.objectStore(STORE_NAME);
480
- return [4 /*yield*/, db.get(STORE_NAME, id)];
481
- case 2:
482
- existing = _a.sent();
483
- return [2 /*return*/, { status: 200, message: "".concat(id, ": ").concat(existing ? 'true' : 'false') }];
484
- case 3:
485
- error_5 = _a.sent();
486
- errorMessage = error_5 instanceof Error ? error_5.message : 'An unknown error occurred';
487
- return [2 /*return*/, {
488
- isError: true,
489
- status: 500,
490
- message: "Unable search for cohort. Error: ".concat(errorMessage),
491
- }];
492
- case 4: return [2 /*return*/];
493
- }
494
- });
495
- });
496
- };
497
- /**
498
- * Export all cohorts as JSON
499
- */
500
- CohortStorage.prototype.exportCohorts = function () {
501
- return __awaiter(this, void 0, void 0, function () {
502
- return __generator(this, function (_a) {
503
- switch (_a.label) {
504
- case 0: return [4 /*yield*/, this.getAllCohorts()];
505
- case 1: return [2 /*return*/, _a.sent()];
506
- }
507
- });
508
- });
509
- };
510
- /**
511
- * Import cohorts from JSON data
512
- */
513
- CohortStorage.prototype.importCohorts = function (cohorts_1) {
514
- return __awaiter(this, arguments, void 0, function (cohorts, overwrite) {
515
- var error_6, errorMessage;
516
- if (overwrite === void 0) { overwrite = false; }
517
- return __generator(this, function (_a) {
518
- switch (_a.label) {
519
- case 0:
520
- _a.trys.push([0, 4, , 5]);
521
- if (!overwrite) return [3 /*break*/, 2];
522
- return [4 /*yield*/, this.deleteAllCohorts()];
523
- case 1:
524
- _a.sent();
525
- _a.label = 2;
526
- case 2: return [4 /*yield*/, this.saveCohorts(cohorts)];
527
- case 3:
528
- _a.sent();
529
- return [3 /*break*/, 5];
530
- case 4:
531
- error_6 = _a.sent();
532
- errorMessage = error_6 instanceof Error ? error_6.message : 'An unknown error occurred';
533
- return [2 /*return*/, {
534
- isError: true,
535
- status: 500,
536
- message: "Failed to import cohorts: ".concat(errorMessage),
537
- }];
538
- case 5: return [2 /*return*/];
539
- }
540
- });
541
- });
542
- };
543
- /**
544
- * Close the database connection
545
- */
546
- CohortStorage.prototype.close = function () {
547
- return __awaiter(this, void 0, void 0, function () {
548
- var db, error_7;
549
- return __generator(this, function (_a) {
550
- switch (_a.label) {
551
- case 0:
552
- _a.trys.push([0, 2, , 3]);
553
- return [4 /*yield*/, this.getDb()];
554
- case 1:
555
- db = _a.sent();
556
- db.close();
557
- return [3 /*break*/, 3];
558
- case 2:
559
- error_7 = _a.sent();
560
- console.error('Failed to close database:', error_7);
561
- return [3 /*break*/, 3];
562
- case 3: return [2 /*return*/];
563
- }
564
- });
565
- });
566
- };
567
- return CohortStorage;
568
- }());
569
- export { CohortStorage };
570
- // Export a singleton instance
571
- export var cohortStorage = new CohortStorage();
572
- //# sourceMappingURL=CohortStorage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CohortStorage.js","sourceRoot":"","sources":["../../../../../src/features/CohortDiscovery/CohortManagment/Cohort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AY,GAChB,OAAK,YAAY,KAAK,CAAC,CAAC,CAAC,OAAK,CAAC,OAAO,CAAC,CAAC,CAAC,2BAA2B,CAAC;wBACvE,sBAAO;gCACL,OAAO,EAAE,IAAI;gCACb,MAAM,EAAE,GAAG;gCACX,OAAO,EAAE,oCAA6B,YAAY,CAAE;6BACrD,EAAC;;;;;KAEL;IAED;;OAEG;IACG,6BAAK,GAAX;;;;;;;wBAEe,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAvB,EAAE,GAAG,SAAkB;wBAC7B,EAAE,CAAC,KAAK,EAAE,CAAC;;;;wBAEX,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,OAAK,CAAC,CAAC;;;;;;KAErD;IACH,oBAAC;AAAD,CAAC,AAvYD,IAuYC;;AAED,8BAA8B;AAC9B,MAAM,CAAC,IAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=CohortSelectors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CohortSelectors.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortSelectors.ts"],"names":[],"mappings":""}
@@ -1,41 +0,0 @@
1
- "use strict";
2
- // import { FilterSet, IndexedFilterSet, Operation } from '@gen3/core';
3
- // import { Cohort } from './CohortSlice';
4
- // import { AppState } from './appApi';
5
- //
6
- // export const selectCohortFilters = (state: AppState): IndexedFilterSet =>
7
- // state.cohorts.cohort.filters;
8
- // export const selectCurrentCohortId = (state: AppState): string =>
9
- // state.cohorts.cohort.id;
10
- // export const selectCurrentCohort = (state: AppState): Cohort =>
11
- // state.cohorts.cohort;
12
- // export const selectCurrentCohortName = (state: AppState): string =>
13
- // state.cohorts.cohort.name;
14
- // /**
15
- // * Select a filter by its name from the current cohort. If the filter is not found
16
- // * returns undefined.
17
- // * @param state - Core
18
- // * @param index which cohort index to select from
19
- // * @param name name of the filter to select
20
- // */
21
- // export const selectIndexedFilterByName = (
22
- // state: AppState,
23
- // index: string,
24
- // name: string,
25
- // ): Operation | undefined => {
26
- // return state.cohorts.cohort.filters[index]?.root[name];
27
- // };
28
- // const EmptyFilterSet: FilterSet = { mode: 'and', root: {} };
29
- // /**
30
- // * Select a filter from the index.
31
- // * returns undefined.
32
- // * @param state - Core
33
- // * @param index which cohort index to select from
34
- // */
35
- // export const selectIndexFilters = (
36
- // state: AppState,
37
- // index: string,
38
- // ): FilterSet => {
39
- // return state.cohorts.cohort.filters?.[index] ?? EmptyFilterSet; // TODO: check if this is undefined
40
- // };
41
- //# sourceMappingURL=CohortSelectors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CohortSelectors.js","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortSelectors.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,0CAA0C;AAC1C,uCAAuC;AACvC,EAAE;AACF,4EAA4E;AAC5E,kCAAkC;AAClC,oEAAoE;AACpE,6BAA6B;AAC7B,kEAAkE;AAClE,0BAA0B;AAC1B,sEAAsE;AACtE,+BAA+B;AAC/B,MAAM;AACN,qFAAqF;AACrF,wBAAwB;AACxB,yBAAyB;AACzB,oDAAoD;AACpD,8CAA8C;AAC9C,MAAM;AACN,6CAA6C;AAC7C,qBAAqB;AACrB,mBAAmB;AACnB,kBAAkB;AAClB,gCAAgC;AAChC,4DAA4D;AAC5D,KAAK;AACL,+DAA+D;AAC/D,MAAM;AACN,qCAAqC;AACrC,wBAAwB;AACxB,yBAAyB;AACzB,oDAAoD;AACpD,MAAM;AACN,sCAAsC;AACtC,qBAAqB;AACrB,mBAAmB;AACnB,oBAAoB;AACpB,wGAAwG;AACxG,KAAK"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=CohortSlice.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CohortSlice.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortDiscovery/CohortSlice.ts"],"names":[],"mappings":""}