@actschurch/ccms-sdk 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/models/accounselling/ModelView/CareSessionModelView.d.ts +31 -0
- package/dist/models/accounselling/ModelView/CareSessionModelView.d.ts.map +1 -1
- package/dist/models/analytics/KnowledgeSearch.d.ts +10 -0
- package/dist/models/analytics/KnowledgeSearch.d.ts.map +1 -1
- package/dist/models/dashboard/index.d.ts +282 -3
- package/dist/models/dashboard/index.d.ts.map +1 -1
- package/dist/models/dashboard/index.js +315 -3
- package/dist/models/dashboard/index.js.map +1 -1
- package/dist/models/resources/ModelView/CourseModelView.d.ts +17 -0
- package/dist/models/resources/ModelView/CourseModelView.d.ts.map +1 -1
- package/dist/models/resources/ResourceSettings.d.ts +31 -0
- package/dist/models/resources/ResourceSettings.d.ts.map +1 -0
- package/dist/models/resources/ResourceSettings.js +2 -0
- package/dist/models/resources/ResourceSettings.js.map +1 -0
- package/dist/models/resources/SessionNote.d.ts +30 -0
- package/dist/models/resources/SessionNote.d.ts.map +1 -0
- package/dist/models/resources/SessionNote.js +2 -0
- package/dist/models/resources/SessionNote.js.map +1 -0
- package/dist/models/resources/index.d.ts +2 -0
- package/dist/models/resources/index.d.ts.map +1 -1
- package/dist/models/resources/index.js +3 -0
- package/dist/models/resources/index.js.map +1 -1
- package/dist/react/hooks/services/useResourcesServices.d.ts +5 -1
- package/dist/react/hooks/services/useResourcesServices.d.ts.map +1 -1
- package/dist/react/hooks/services/useResourcesServices.js +6 -0
- package/dist/react/hooks/services/useResourcesServices.js.map +1 -1
- package/dist/realtime/dashboards/DashboardAggregatorClient.d.ts +48 -0
- package/dist/realtime/dashboards/DashboardAggregatorClient.d.ts.map +1 -0
- package/dist/realtime/dashboards/DashboardAggregatorClient.js +65 -0
- package/dist/realtime/dashboards/DashboardAggregatorClient.js.map +1 -0
- package/dist/realtime/dashboards/index.d.ts +1 -0
- package/dist/realtime/dashboards/index.d.ts.map +1 -1
- package/dist/realtime/dashboards/index.js +3 -0
- package/dist/realtime/dashboards/index.js.map +1 -1
- package/dist/services/accounselling/CareCaseService.d.ts +115 -1
- package/dist/services/accounselling/CareCaseService.d.ts.map +1 -1
- package/dist/services/accounselling/CareCaseService.js +171 -0
- package/dist/services/accounselling/CareCaseService.js.map +1 -1
- package/dist/services/dashboard/DashboardAggregatorService.d.ts +73 -0
- package/dist/services/dashboard/DashboardAggregatorService.d.ts.map +1 -0
- package/dist/services/dashboard/DashboardAggregatorService.js +145 -0
- package/dist/services/dashboard/DashboardAggregatorService.js.map +1 -0
- package/dist/services/dashboard/DashboardLayoutService.d.ts +46 -0
- package/dist/services/dashboard/DashboardLayoutService.d.ts.map +1 -0
- package/dist/services/dashboard/DashboardLayoutService.js +75 -0
- package/dist/services/dashboard/DashboardLayoutService.js.map +1 -0
- package/dist/services/dashboard/DashboardServices.d.ts +38 -0
- package/dist/services/dashboard/DashboardServices.d.ts.map +1 -0
- package/dist/services/dashboard/DashboardServices.js +28 -0
- package/dist/services/dashboard/DashboardServices.js.map +1 -0
- package/dist/services/dashboard/index.d.ts +11 -0
- package/dist/services/dashboard/index.d.ts.map +1 -0
- package/dist/services/dashboard/index.js +10 -0
- package/dist/services/dashboard/index.js.map +1 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +2 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/knowledgebase/KnowledgeBaseQAService.d.ts +7 -1
- package/dist/services/knowledgebase/KnowledgeBaseQAService.d.ts.map +1 -1
- package/dist/services/knowledgebase/KnowledgeBaseQAService.js +11 -0
- package/dist/services/knowledgebase/KnowledgeBaseQAService.js.map +1 -1
- package/dist/services/members/MemberService.d.ts +17 -0
- package/dist/services/members/MemberService.d.ts.map +1 -1
- package/dist/services/members/MemberService.js +27 -0
- package/dist/services/members/MemberService.js.map +1 -1
- package/dist/services/resources/PublicCoursesService.d.ts +7 -0
- package/dist/services/resources/PublicCoursesService.d.ts.map +1 -1
- package/dist/services/resources/PublicCoursesService.js +12 -0
- package/dist/services/resources/PublicCoursesService.js.map +1 -1
- package/dist/services/resources/ResourceSettingsService.d.ts +26 -0
- package/dist/services/resources/ResourceSettingsService.d.ts.map +1 -0
- package/dist/services/resources/ResourceSettingsService.js +43 -0
- package/dist/services/resources/ResourceSettingsService.js.map +1 -0
- package/dist/services/resources/SessionNoteService.d.ts +27 -0
- package/dist/services/resources/SessionNoteService.d.ts.map +1 -0
- package/dist/services/resources/SessionNoteService.js +44 -0
- package/dist/services/resources/SessionNoteService.js.map +1 -0
- package/dist/services/resources/UserCourseProgressService.d.ts +9 -0
- package/dist/services/resources/UserCourseProgressService.d.ts.map +1 -1
- package/dist/services/resources/UserCourseProgressService.js +13 -0
- package/dist/services/resources/UserCourseProgressService.js.map +1 -1
- package/dist/services/resources/index.d.ts +6 -0
- package/dist/services/resources/index.d.ts.map +1 -1
- package/dist/services/resources/index.js +6 -0
- package/dist/services/resources/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DashboardAggregatorClient
|
|
3
|
+
* SignalR client for the Dashboard-Aggregator realtime hub (`/hubs/dashboard`).
|
|
4
|
+
*
|
|
5
|
+
* The aggregator exposes ONE hub the Hub app connects to instead of N per-domain
|
|
6
|
+
* connections. Server → client messages:
|
|
7
|
+
* - `WidgetDelta` — a single refreshed {@link DashboardWidget}; merge by `widgetId`.
|
|
8
|
+
* - `WidgetInvalidated` — `{ widgetIds: string[] }`; re-fetch just those widgets.
|
|
9
|
+
*
|
|
10
|
+
* Mirrors the iOS `DashboardRealtimeClient` and the Kotlin
|
|
11
|
+
* `DashboardAggregatorHubClient`. Distinct from {@link DomainDashboardClient}
|
|
12
|
+
* (the admin per-domain `/hubs/dashboard/{domain}` client) — kept separate.
|
|
13
|
+
*
|
|
14
|
+
* Local events emitted (subscribe via {@link BaseSignalRClient.on}):
|
|
15
|
+
* - `'widgetDelta'` → {@link DashboardWidget}
|
|
16
|
+
* - `'widgetInvalidated'` → `string[]` (the invalidated widget ids)
|
|
17
|
+
*/
|
|
18
|
+
import { BaseSignalRClient } from '../shared/BaseSignalRClient';
|
|
19
|
+
/**
|
|
20
|
+
* Client for the cross-domain dashboard aggregator hub.
|
|
21
|
+
* Connects to `/hubs/dashboard` on the aggregator WebSocket service.
|
|
22
|
+
*/
|
|
23
|
+
export class DashboardAggregatorClient extends BaseSignalRClient {
|
|
24
|
+
constructor(baseUrl, getToken, options = {}) {
|
|
25
|
+
const hubUrl = baseUrl.endsWith('/hubs/dashboard')
|
|
26
|
+
? baseUrl
|
|
27
|
+
: `${baseUrl.replace(/\/+$/, '')}/hubs/dashboard`;
|
|
28
|
+
super(hubUrl, getToken, options);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Register server-to-client event handlers.
|
|
32
|
+
*/
|
|
33
|
+
setupServerMethods() {
|
|
34
|
+
if (!this.connection)
|
|
35
|
+
return;
|
|
36
|
+
// A single refreshed widget — the Hub merges it by widgetId.
|
|
37
|
+
this.connection.on('WidgetDelta', (widget) => {
|
|
38
|
+
this.emit('widgetDelta', widget);
|
|
39
|
+
});
|
|
40
|
+
// A set of widget ids the server marked stale — the Hub re-fetches them.
|
|
41
|
+
this.connection.on('WidgetInvalidated', (payload) => {
|
|
42
|
+
const ids = payload?.widgetIds ?? [];
|
|
43
|
+
if (ids.length > 0) {
|
|
44
|
+
this.emit('widgetInvalidated', ids);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Subscribe to refreshed widgets pushed by the hub.
|
|
50
|
+
* @param handler - Invoked with each refreshed {@link DashboardWidget}.
|
|
51
|
+
* @returns An unsubscribe handle.
|
|
52
|
+
*/
|
|
53
|
+
onWidgetDelta(handler) {
|
|
54
|
+
return this.on('widgetDelta', handler);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Subscribe to widget-invalidation notifications pushed by the hub.
|
|
58
|
+
* @param handler - Invoked with the list of invalidated widget ids.
|
|
59
|
+
* @returns An unsubscribe handle.
|
|
60
|
+
*/
|
|
61
|
+
onWidgetInvalidated(handler) {
|
|
62
|
+
return this.on('widgetInvalidated', handler);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=DashboardAggregatorClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardAggregatorClient.js","sourceRoot":"","sources":["../../../src/realtime/dashboards/DashboardAggregatorClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAShE;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,iBAAiB;IAC9D,YACE,OAAe,EACf,QAAsC,EACtC,UAAgC,EAAE;QAElC,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YAChD,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC;QACpD,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACO,kBAAkB;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,OAAO;QAE7B,6DAA6D;QAC7D,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,MAAuB,EAAE,EAAE;YAC5D,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QAEH,yEAAyE;QACzE,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,OAAiC,EAAE,EAAE;YAC5E,MAAM,GAAG,GAAG,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC;YACrC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACnB,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC;YACtC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,aAAa,CAAC,OAA0C;QAC7D,OAAO,IAAI,CAAC,EAAE,CAAkB,aAAa,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CAAC,OAAsC;QAC/D,OAAO,IAAI,CAAC,EAAE,CAAW,mBAAmB,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACF"}
|
|
@@ -5,4 +5,5 @@
|
|
|
5
5
|
export * from './types';
|
|
6
6
|
export { DomainDashboardClient } from './DomainDashboardClient';
|
|
7
7
|
export { useDomainDashboard } from './hooks/useDomainDashboard';
|
|
8
|
+
export { DashboardAggregatorClient, type WidgetInvalidatedPayload, } from './DashboardAggregatorClient';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/realtime/dashboards/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/realtime/dashboards/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAIhE,OAAO,EACL,yBAAyB,EACzB,KAAK,wBAAwB,GAC9B,MAAM,6BAA6B,CAAC"}
|
|
@@ -5,4 +5,7 @@
|
|
|
5
5
|
export * from './types';
|
|
6
6
|
export { DomainDashboardClient } from './DomainDashboardClient';
|
|
7
7
|
export { useDomainDashboard } from './hooks/useDomainDashboard';
|
|
8
|
+
// Cross-domain "my day at CCMS" dashboard aggregator hub (/hubs/dashboard).
|
|
9
|
+
// Distinct from the admin per-domain DomainDashboardClient above.
|
|
10
|
+
export { DashboardAggregatorClient, } from './DashboardAggregatorClient';
|
|
8
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/realtime/dashboards/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/realtime/dashboards/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,4EAA4E;AAC5E,kEAAkE;AAClE,OAAO,EACL,yBAAyB,GAE1B,MAAM,6BAA6B,CAAC"}
|
|
@@ -7,7 +7,7 @@ import { CrudService } from '../base/CrudService';
|
|
|
7
7
|
import type { HttpClient } from '../../core/HttpClient';
|
|
8
8
|
import type { ResponseData } from '../../models/common';
|
|
9
9
|
import type { ServiceConfig } from '../types';
|
|
10
|
-
import type { CareCase, CareCaseFile, CareCaseNote, CreateCareCase, UpdateCareCaseRequest, CareCaseFilterModel, CareCaseListViewResponse, CareCaseModelView, CareDashboardStats, CreateCareCaseNote } from '../../models/accounselling';
|
|
10
|
+
import type { CareCase, CareCaseFile, CareCaseNote, CareCaseMember, CreateCareCase, UpdateCareCaseRequest, CareCaseFilterModel, CareCaseListViewResponse, CareCaseModelView, CareDashboardStats, CreateCareCaseNote, UpdateCareCaseNoteRequest, UpdateCareCaseFileRequest, UpdateCareCaseMemberRequest } from '../../models/accounselling';
|
|
11
11
|
/**
|
|
12
12
|
* Service for care case CRUD operations, paged list views, detail views,
|
|
13
13
|
* leader/member assignment, the case note audit trail and file attachments
|
|
@@ -96,6 +96,48 @@ export declare class CareCaseService extends CrudService<CareCase, CreateCareCas
|
|
|
96
96
|
* @returns ResponseData (success/fail)
|
|
97
97
|
*/
|
|
98
98
|
addMemberRaw(caseId: number, memberId: number, isMain?: boolean): Promise<ResponseData<void>>;
|
|
99
|
+
/**
|
|
100
|
+
* Get the counselees (members) on a case
|
|
101
|
+
* @param caseId - The case ID
|
|
102
|
+
* @returns Array of case member links
|
|
103
|
+
*/
|
|
104
|
+
members(caseId: number): Promise<CareCaseMember[]>;
|
|
105
|
+
/**
|
|
106
|
+
* Get the counselees (members) on a case with full response
|
|
107
|
+
* @param caseId - The case ID
|
|
108
|
+
* @returns ResponseData with array of case member links
|
|
109
|
+
*/
|
|
110
|
+
membersRaw(caseId: number): Promise<ResponseData<CareCaseMember[]>>;
|
|
111
|
+
/**
|
|
112
|
+
* Update a counselee link on a case (e.g. primary flag / consent)
|
|
113
|
+
* @param caseId - The case ID
|
|
114
|
+
* @param memberId - The member ID
|
|
115
|
+
* @param data - Partial counselee payload (only supplied fields are applied)
|
|
116
|
+
* @returns The updated case member link
|
|
117
|
+
*/
|
|
118
|
+
updateMember(caseId: number, memberId: number, data: UpdateCareCaseMemberRequest): Promise<CareCaseMember>;
|
|
119
|
+
/**
|
|
120
|
+
* Update a counselee link on a case with full response
|
|
121
|
+
* @param caseId - The case ID
|
|
122
|
+
* @param memberId - The member ID
|
|
123
|
+
* @param data - Partial counselee payload
|
|
124
|
+
* @returns ResponseData with the updated case member link
|
|
125
|
+
*/
|
|
126
|
+
updateMemberRaw(caseId: number, memberId: number, data: UpdateCareCaseMemberRequest): Promise<ResponseData<CareCaseMember>>;
|
|
127
|
+
/**
|
|
128
|
+
* Remove a counselee (member) from a case
|
|
129
|
+
* @param caseId - The case ID
|
|
130
|
+
* @param memberId - The member ID
|
|
131
|
+
* @returns True if removed successfully
|
|
132
|
+
*/
|
|
133
|
+
removeMember(caseId: number, memberId: number): Promise<boolean>;
|
|
134
|
+
/**
|
|
135
|
+
* Remove a counselee (member) from a case with full response
|
|
136
|
+
* @param caseId - The case ID
|
|
137
|
+
* @param memberId - The member ID
|
|
138
|
+
* @returns ResponseData (success/fail)
|
|
139
|
+
*/
|
|
140
|
+
removeMemberRaw(caseId: number, memberId: number): Promise<ResponseData<void>>;
|
|
99
141
|
/**
|
|
100
142
|
* Get the audit-trail notes for a case
|
|
101
143
|
* @param caseId - The case ID
|
|
@@ -122,6 +164,36 @@ export declare class CareCaseService extends CrudService<CareCase, CreateCareCas
|
|
|
122
164
|
* @returns ResponseData with the created case note
|
|
123
165
|
*/
|
|
124
166
|
addNoteRaw(caseId: number, data: CreateCareCaseNote): Promise<ResponseData<CareCaseNote>>;
|
|
167
|
+
/**
|
|
168
|
+
* Update a case note
|
|
169
|
+
* @param caseId - The case ID
|
|
170
|
+
* @param noteId - The note ID
|
|
171
|
+
* @param data - Partial note payload (only supplied fields are applied)
|
|
172
|
+
* @returns The updated case note
|
|
173
|
+
*/
|
|
174
|
+
updateNote(caseId: number, noteId: number, data: UpdateCareCaseNoteRequest): Promise<CareCaseNote>;
|
|
175
|
+
/**
|
|
176
|
+
* Update a case note with full response
|
|
177
|
+
* @param caseId - The case ID
|
|
178
|
+
* @param noteId - The note ID
|
|
179
|
+
* @param data - Partial note payload
|
|
180
|
+
* @returns ResponseData with the updated case note
|
|
181
|
+
*/
|
|
182
|
+
updateNoteRaw(caseId: number, noteId: number, data: UpdateCareCaseNoteRequest): Promise<ResponseData<CareCaseNote>>;
|
|
183
|
+
/**
|
|
184
|
+
* Delete a case note
|
|
185
|
+
* @param caseId - The case ID
|
|
186
|
+
* @param noteId - The note ID
|
|
187
|
+
* @returns True if deleted successfully
|
|
188
|
+
*/
|
|
189
|
+
deleteNote(caseId: number, noteId: number): Promise<boolean>;
|
|
190
|
+
/**
|
|
191
|
+
* Delete a case note with full response
|
|
192
|
+
* @param caseId - The case ID
|
|
193
|
+
* @param noteId - The note ID
|
|
194
|
+
* @returns ResponseData (success/fail)
|
|
195
|
+
*/
|
|
196
|
+
deleteNoteRaw(caseId: number, noteId: number): Promise<ResponseData<void>>;
|
|
125
197
|
/**
|
|
126
198
|
* Attach a file to a case
|
|
127
199
|
* @param caseId - The case ID
|
|
@@ -136,5 +208,47 @@ export declare class CareCaseService extends CrudService<CareCase, CreateCareCas
|
|
|
136
208
|
* @returns ResponseData with the created case file
|
|
137
209
|
*/
|
|
138
210
|
addFileRaw(caseId: number, file: Partial<CareCaseFile>): Promise<ResponseData<CareCaseFile>>;
|
|
211
|
+
/**
|
|
212
|
+
* Get the files attached to a case
|
|
213
|
+
* @param caseId - The case ID
|
|
214
|
+
* @returns Array of case files
|
|
215
|
+
*/
|
|
216
|
+
files(caseId: number): Promise<CareCaseFile[]>;
|
|
217
|
+
/**
|
|
218
|
+
* Get the files attached to a case with full response
|
|
219
|
+
* @param caseId - The case ID
|
|
220
|
+
* @returns ResponseData with array of case files
|
|
221
|
+
*/
|
|
222
|
+
filesRaw(caseId: number): Promise<ResponseData<CareCaseFile[]>>;
|
|
223
|
+
/**
|
|
224
|
+
* Update a case file
|
|
225
|
+
* @param caseId - The case ID
|
|
226
|
+
* @param fileId - The file ID
|
|
227
|
+
* @param data - Partial file payload (only supplied fields are applied)
|
|
228
|
+
* @returns The updated case file
|
|
229
|
+
*/
|
|
230
|
+
updateFile(caseId: number, fileId: number, data: UpdateCareCaseFileRequest): Promise<CareCaseFile>;
|
|
231
|
+
/**
|
|
232
|
+
* Update a case file with full response
|
|
233
|
+
* @param caseId - The case ID
|
|
234
|
+
* @param fileId - The file ID
|
|
235
|
+
* @param data - Partial file payload
|
|
236
|
+
* @returns ResponseData with the updated case file
|
|
237
|
+
*/
|
|
238
|
+
updateFileRaw(caseId: number, fileId: number, data: UpdateCareCaseFileRequest): Promise<ResponseData<CareCaseFile>>;
|
|
239
|
+
/**
|
|
240
|
+
* Delete a case file
|
|
241
|
+
* @param caseId - The case ID
|
|
242
|
+
* @param fileId - The file ID
|
|
243
|
+
* @returns True if deleted successfully
|
|
244
|
+
*/
|
|
245
|
+
deleteFile(caseId: number, fileId: number): Promise<boolean>;
|
|
246
|
+
/**
|
|
247
|
+
* Delete a case file with full response
|
|
248
|
+
* @param caseId - The case ID
|
|
249
|
+
* @param fileId - The file ID
|
|
250
|
+
* @returns ResponseData (success/fail)
|
|
251
|
+
*/
|
|
252
|
+
deleteFileRaw(caseId: number, fileId: number): Promise<ResponseData<void>>;
|
|
139
253
|
}
|
|
140
254
|
//# sourceMappingURL=CareCaseService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CareCaseService.d.ts","sourceRoot":"","sources":["../../../src/services/accounselling/CareCaseService.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"CareCaseService.d.ts","sourceRoot":"","sources":["../../../src/services/accounselling/CareCaseService.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KA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AAC,CAAC;IAK1E;;;;;OAKG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;IAQjF;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAK5F;;;;OAIG;IACG,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAKpD;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC;IAK/D;;;;;;OAMG;IACG,UAAU,CACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,YAAY,CAAC;IAQxB;;;;;;OAMG;IACH,aAAa,CACX,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAKtC;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKlE;;;;;OAKG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;CAI3E"}
|
|
@@ -145,6 +145,69 @@ export class CareCaseService extends CrudService {
|
|
|
145
145
|
});
|
|
146
146
|
return this.http.post(url, {});
|
|
147
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* Get the counselees (members) on a case
|
|
150
|
+
* @param caseId - The case ID
|
|
151
|
+
* @returns Array of case member links
|
|
152
|
+
*/
|
|
153
|
+
async members(caseId) {
|
|
154
|
+
const response = await this.membersRaw(caseId);
|
|
155
|
+
return response.data ?? [];
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Get the counselees (members) on a case with full response
|
|
159
|
+
* @param caseId - The case ID
|
|
160
|
+
* @returns ResponseData with array of case member links
|
|
161
|
+
*/
|
|
162
|
+
membersRaw(caseId) {
|
|
163
|
+
const url = this.buildUrl(`${caseId}/members`);
|
|
164
|
+
return this.http.get(url);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Update a counselee link on a case (e.g. primary flag / consent)
|
|
168
|
+
* @param caseId - The case ID
|
|
169
|
+
* @param memberId - The member ID
|
|
170
|
+
* @param data - Partial counselee payload (only supplied fields are applied)
|
|
171
|
+
* @returns The updated case member link
|
|
172
|
+
*/
|
|
173
|
+
async updateMember(caseId, memberId, data) {
|
|
174
|
+
const response = await this.updateMemberRaw(caseId, memberId, data);
|
|
175
|
+
if (!response.data) {
|
|
176
|
+
throw new Error(`Failed to update member ${memberId} on care case ${caseId}`);
|
|
177
|
+
}
|
|
178
|
+
return response.data;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Update a counselee link on a case with full response
|
|
182
|
+
* @param caseId - The case ID
|
|
183
|
+
* @param memberId - The member ID
|
|
184
|
+
* @param data - Partial counselee payload
|
|
185
|
+
* @returns ResponseData with the updated case member link
|
|
186
|
+
*/
|
|
187
|
+
updateMemberRaw(caseId, memberId, data) {
|
|
188
|
+
const url = this.buildUrl(`${caseId}/members/${memberId}`);
|
|
189
|
+
return this.http.put(url, data);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Remove a counselee (member) from a case
|
|
193
|
+
* @param caseId - The case ID
|
|
194
|
+
* @param memberId - The member ID
|
|
195
|
+
* @returns True if removed successfully
|
|
196
|
+
*/
|
|
197
|
+
async removeMember(caseId, memberId) {
|
|
198
|
+
const response = await this.removeMemberRaw(caseId, memberId);
|
|
199
|
+
return response.success;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Remove a counselee (member) from a case with full response
|
|
203
|
+
* @param caseId - The case ID
|
|
204
|
+
* @param memberId - The member ID
|
|
205
|
+
* @returns ResponseData (success/fail)
|
|
206
|
+
*/
|
|
207
|
+
removeMemberRaw(caseId, memberId) {
|
|
208
|
+
const url = this.buildUrl(`${caseId}/members/${memberId}`);
|
|
209
|
+
return this.http.delete(url);
|
|
210
|
+
}
|
|
148
211
|
/**
|
|
149
212
|
* Get the audit-trail notes for a case
|
|
150
213
|
* @param caseId - The case ID
|
|
@@ -186,6 +249,51 @@ export class CareCaseService extends CrudService {
|
|
|
186
249
|
const url = this.buildUrl(`${caseId}/notes`);
|
|
187
250
|
return this.http.post(url, data);
|
|
188
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* Update a case note
|
|
254
|
+
* @param caseId - The case ID
|
|
255
|
+
* @param noteId - The note ID
|
|
256
|
+
* @param data - Partial note payload (only supplied fields are applied)
|
|
257
|
+
* @returns The updated case note
|
|
258
|
+
*/
|
|
259
|
+
async updateNote(caseId, noteId, data) {
|
|
260
|
+
const response = await this.updateNoteRaw(caseId, noteId, data);
|
|
261
|
+
if (!response.data) {
|
|
262
|
+
throw new Error(`Failed to update note ${noteId} on care case ${caseId}`);
|
|
263
|
+
}
|
|
264
|
+
return response.data;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Update a case note with full response
|
|
268
|
+
* @param caseId - The case ID
|
|
269
|
+
* @param noteId - The note ID
|
|
270
|
+
* @param data - Partial note payload
|
|
271
|
+
* @returns ResponseData with the updated case note
|
|
272
|
+
*/
|
|
273
|
+
updateNoteRaw(caseId, noteId, data) {
|
|
274
|
+
const url = this.buildUrl(`${caseId}/notes/${noteId}`);
|
|
275
|
+
return this.http.put(url, data);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Delete a case note
|
|
279
|
+
* @param caseId - The case ID
|
|
280
|
+
* @param noteId - The note ID
|
|
281
|
+
* @returns True if deleted successfully
|
|
282
|
+
*/
|
|
283
|
+
async deleteNote(caseId, noteId) {
|
|
284
|
+
const response = await this.deleteNoteRaw(caseId, noteId);
|
|
285
|
+
return response.success;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Delete a case note with full response
|
|
289
|
+
* @param caseId - The case ID
|
|
290
|
+
* @param noteId - The note ID
|
|
291
|
+
* @returns ResponseData (success/fail)
|
|
292
|
+
*/
|
|
293
|
+
deleteNoteRaw(caseId, noteId) {
|
|
294
|
+
const url = this.buildUrl(`${caseId}/notes/${noteId}`);
|
|
295
|
+
return this.http.delete(url);
|
|
296
|
+
}
|
|
189
297
|
/**
|
|
190
298
|
* Attach a file to a case
|
|
191
299
|
* @param caseId - The case ID
|
|
@@ -209,6 +317,69 @@ export class CareCaseService extends CrudService {
|
|
|
209
317
|
const url = this.buildUrl(`${caseId}/files`);
|
|
210
318
|
return this.http.post(url, file);
|
|
211
319
|
}
|
|
320
|
+
/**
|
|
321
|
+
* Get the files attached to a case
|
|
322
|
+
* @param caseId - The case ID
|
|
323
|
+
* @returns Array of case files
|
|
324
|
+
*/
|
|
325
|
+
async files(caseId) {
|
|
326
|
+
const response = await this.filesRaw(caseId);
|
|
327
|
+
return response.data ?? [];
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Get the files attached to a case with full response
|
|
331
|
+
* @param caseId - The case ID
|
|
332
|
+
* @returns ResponseData with array of case files
|
|
333
|
+
*/
|
|
334
|
+
filesRaw(caseId) {
|
|
335
|
+
const url = this.buildUrl(`${caseId}/files`);
|
|
336
|
+
return this.http.get(url);
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Update a case file
|
|
340
|
+
* @param caseId - The case ID
|
|
341
|
+
* @param fileId - The file ID
|
|
342
|
+
* @param data - Partial file payload (only supplied fields are applied)
|
|
343
|
+
* @returns The updated case file
|
|
344
|
+
*/
|
|
345
|
+
async updateFile(caseId, fileId, data) {
|
|
346
|
+
const response = await this.updateFileRaw(caseId, fileId, data);
|
|
347
|
+
if (!response.data) {
|
|
348
|
+
throw new Error(`Failed to update file ${fileId} on care case ${caseId}`);
|
|
349
|
+
}
|
|
350
|
+
return response.data;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Update a case file with full response
|
|
354
|
+
* @param caseId - The case ID
|
|
355
|
+
* @param fileId - The file ID
|
|
356
|
+
* @param data - Partial file payload
|
|
357
|
+
* @returns ResponseData with the updated case file
|
|
358
|
+
*/
|
|
359
|
+
updateFileRaw(caseId, fileId, data) {
|
|
360
|
+
const url = this.buildUrl(`${caseId}/files/${fileId}`);
|
|
361
|
+
return this.http.put(url, data);
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Delete a case file
|
|
365
|
+
* @param caseId - The case ID
|
|
366
|
+
* @param fileId - The file ID
|
|
367
|
+
* @returns True if deleted successfully
|
|
368
|
+
*/
|
|
369
|
+
async deleteFile(caseId, fileId) {
|
|
370
|
+
const response = await this.deleteFileRaw(caseId, fileId);
|
|
371
|
+
return response.success;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Delete a case file with full response
|
|
375
|
+
* @param caseId - The case ID
|
|
376
|
+
* @param fileId - The file ID
|
|
377
|
+
* @returns ResponseData (success/fail)
|
|
378
|
+
*/
|
|
379
|
+
deleteFileRaw(caseId, fileId) {
|
|
380
|
+
const url = this.buildUrl(`${caseId}/files/${fileId}`);
|
|
381
|
+
return this.http.delete(url);
|
|
382
|
+
}
|
|
212
383
|
}
|
|
213
384
|
CareCaseService.DEFAULT_SERVICE_PATH = 'ac-counselling';
|
|
214
385
|
CareCaseService.BASE_PATH = 'api/care-cases';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CareCaseService.js","sourceRoot":"","sources":["../../../src/services/accounselling/CareCaseService.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
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rC,CAAC;;AA/auB,oCAAoB,GAAG,gBAAgB,CAAC;AACxC,yBAAS,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DashboardAggregatorService
|
|
3
|
+
*
|
|
4
|
+
* Reads the cross-domain "my day at CCMS" dashboard composed by the new
|
|
5
|
+
* `CCMS.Api.DashboardAggregator` service. The TS mirror of the Kotlin
|
|
6
|
+
* `DashboardAggregatorService` / Swift `DashboardAggregatorService`.
|
|
7
|
+
*
|
|
8
|
+
* Like the {@link ApplicationCatalogueService}, the aggregator is **not** behind
|
|
9
|
+
* a microservice path prefix — it is reached directly at `/api/dashboard`
|
|
10
|
+
* (nginx `location /api/dashboard/`). It therefore does not extend
|
|
11
|
+
* {@link BaseService}; it builds its own paths.
|
|
12
|
+
*
|
|
13
|
+
* Routes:
|
|
14
|
+
* - GET /api/dashboard/me?widgets=&refresh=
|
|
15
|
+
* - GET /api/dashboard/detail?widget=&item=
|
|
16
|
+
*
|
|
17
|
+
* The aggregator always answers `200` — per-widget failures are isolated inside
|
|
18
|
+
* the payload as {@link DashboardWidget.error}, so the Hub renders an error tile
|
|
19
|
+
* for one widget without losing the whole dashboard.
|
|
20
|
+
*
|
|
21
|
+
* Decoding tolerates both the standard {@link ResponseData} envelope (the
|
|
22
|
+
* documented shape) and a bare-object payload (a deployment that drops the
|
|
23
|
+
* envelope) — matching the Kotlin/Swift unknown-tolerant decoding.
|
|
24
|
+
*/
|
|
25
|
+
import type { HttpClient } from '../../core/HttpClient';
|
|
26
|
+
import type { ServiceConfig } from '../types';
|
|
27
|
+
import type { DashboardResponse, WidgetCatalogItem, WidgetDetailResult } from '../../models/dashboard';
|
|
28
|
+
export declare class DashboardAggregatorService {
|
|
29
|
+
private readonly http;
|
|
30
|
+
/** Base path of the dashboard API. `servicePath` override relocates it. */
|
|
31
|
+
private readonly basePath;
|
|
32
|
+
constructor(http: HttpClient, config?: ServiceConfig);
|
|
33
|
+
/**
|
|
34
|
+
* Fetch the calling user's composed dashboard via `GET /api/dashboard/me`.
|
|
35
|
+
*
|
|
36
|
+
* @param widgets - The widget ids to request. An empty list omits the
|
|
37
|
+
* `widgets` query param entirely, so the server returns the role-based
|
|
38
|
+
* Phase-1 defaults (`task.my-open-count`, `task.due-today`,
|
|
39
|
+
* `task.recently-assigned`, `hr.next-leave`, `proc.pending-approvals`).
|
|
40
|
+
* @param refresh - When `true`, appends `refresh=true` to bypass the server
|
|
41
|
+
* cache — the pull-to-refresh path.
|
|
42
|
+
*/
|
|
43
|
+
fetchDashboard(widgets?: string[], refresh?: boolean): Promise<DashboardResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* Fetch the enriched detail for one tapped widget row via
|
|
46
|
+
* `GET /api/dashboard/detail?widget=&item=`. Resolves to `null` when the domain
|
|
47
|
+
* has no richer detail (HTTP 404) — the Hub keeps the inline row detail.
|
|
48
|
+
*/
|
|
49
|
+
fetchWidgetDetail(widgetId: string, itemId: string): Promise<WidgetDetailResult | null>;
|
|
50
|
+
/**
|
|
51
|
+
* Fetch the widget catalog via `GET /api/dashboard/widgets` — every addable
|
|
52
|
+
* widget with its title, description, kind, category, supported containers,
|
|
53
|
+
* and settings schema. Drives the Hub's add-picker + settings sheet.
|
|
54
|
+
*
|
|
55
|
+
* Envelope-tolerant exactly like {@link fetchDashboard}: unwraps a
|
|
56
|
+
* {@link ResponseData} envelope's `data`, falls back to a bare array.
|
|
57
|
+
*
|
|
58
|
+
* Falls back to the **bundled catalog** ({@link BUNDLED_WIDGET_CATALOG}) when
|
|
59
|
+
* the server returns nothing or the endpoint is unavailable (e.g. an aggregator
|
|
60
|
+
* deployment that predates `GET /widgets`) — so the editor keeps working before
|
|
61
|
+
* the catalog endpoint ships. Never rejects.
|
|
62
|
+
*/
|
|
63
|
+
fetchWidgetCatalog(): Promise<WidgetCatalogItem[]>;
|
|
64
|
+
/** Raw server fetch — used by {@link fetchWidgetCatalog}, which adds the bundled fallback. */
|
|
65
|
+
private fetchWidgetCatalogFromServer;
|
|
66
|
+
/**
|
|
67
|
+
* GET `url` and decode tolerantly: try the bare/raw body first (which also
|
|
68
|
+
* unwraps a `ResponseData` envelope's `data`), so both the documented
|
|
69
|
+
* envelope and an envelope-less deployment resolve to a {@link DashboardResponse}.
|
|
70
|
+
*/
|
|
71
|
+
private fetchTolerant;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=DashboardAggregatorService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardAggregatorService.d.ts","sourceRoot":"","sources":["../../../src/services/dashboard/DashboardAggregatorService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,wBAAwB,CAAC;AAMhC,qBAAa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC,2EAA2E;IAC3E,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAEtB,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,aAAa;IAQpD;;;;;;;;;OASG;IACG,cAAc,CAClB,OAAO,GAAE,MAAM,EAAO,EACtB,OAAO,UAAQ,GACd,OAAO,CAAC,iBAAiB,CAAC;IAiB7B;;;;OAIG;IACG,iBAAiB,CACrB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAsBrC;;;;;;;;;;;;OAYG;IACG,kBAAkB,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IASxD,8FAA8F;YAChF,4BAA4B;IAgB1C;;;;OAIG;YACW,aAAa;CAQ5B"}
|