@actschurch/ccms-sdk 0.0.25 → 0.0.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 (123) hide show
  1. package/dist/models/accounselling/ModelView/CareSessionModelView.d.ts +7 -0
  2. package/dist/models/accounselling/ModelView/CareSessionModelView.d.ts.map +1 -1
  3. package/dist/models/accourses/FacilitatorCourse.d.ts +22 -0
  4. package/dist/models/accourses/FacilitatorCourse.d.ts.map +1 -0
  5. package/dist/models/accourses/FacilitatorCourse.js +2 -0
  6. package/dist/models/accourses/FacilitatorCourse.js.map +1 -0
  7. package/dist/models/accourses/FacilitatorDocument.d.ts +30 -0
  8. package/dist/models/accourses/FacilitatorDocument.d.ts.map +1 -0
  9. package/dist/models/accourses/FacilitatorDocument.js +2 -0
  10. package/dist/models/accourses/FacilitatorDocument.js.map +1 -0
  11. package/dist/models/accourses/FacilitatorLocation.d.ts +22 -0
  12. package/dist/models/accourses/FacilitatorLocation.d.ts.map +1 -0
  13. package/dist/models/accourses/FacilitatorLocation.js +2 -0
  14. package/dist/models/accourses/FacilitatorLocation.js.map +1 -0
  15. package/dist/models/accourses/ModelView/ACCourseModelView.d.ts +2 -0
  16. package/dist/models/accourses/ModelView/ACCourseModelView.d.ts.map +1 -1
  17. package/dist/models/accourses/ModelView/CourseFileModelView.d.ts +15 -0
  18. package/dist/models/accourses/ModelView/CourseFileModelView.d.ts.map +1 -1
  19. package/dist/models/accourses/ModelView/FacilitatorAssociationViews.d.ts +118 -0
  20. package/dist/models/accourses/ModelView/FacilitatorAssociationViews.d.ts.map +1 -0
  21. package/dist/models/accourses/ModelView/FacilitatorAssociationViews.js +7 -0
  22. package/dist/models/accourses/ModelView/FacilitatorAssociationViews.js.map +1 -0
  23. package/dist/models/accourses/ModelView/index.d.ts +1 -0
  24. package/dist/models/accourses/ModelView/index.d.ts.map +1 -1
  25. package/dist/models/accourses/ModelView/index.js +1 -0
  26. package/dist/models/accourses/ModelView/index.js.map +1 -1
  27. package/dist/models/accourses/index.d.ts +3 -0
  28. package/dist/models/accourses/index.d.ts.map +1 -1
  29. package/dist/models/accourses/index.js +3 -0
  30. package/dist/models/accourses/index.js.map +1 -1
  31. package/dist/models/analytics/KnowledgeSearch.d.ts +10 -0
  32. package/dist/models/analytics/KnowledgeSearch.d.ts.map +1 -1
  33. package/dist/models/dashboard/index.d.ts +282 -3
  34. package/dist/models/dashboard/index.d.ts.map +1 -1
  35. package/dist/models/dashboard/index.js +315 -3
  36. package/dist/models/dashboard/index.js.map +1 -1
  37. package/dist/models/resources/ModelView/CourseModelView.d.ts +17 -0
  38. package/dist/models/resources/ModelView/CourseModelView.d.ts.map +1 -1
  39. package/dist/models/resources/ResourceSettings.d.ts +31 -0
  40. package/dist/models/resources/ResourceSettings.d.ts.map +1 -0
  41. package/dist/models/resources/ResourceSettings.js +2 -0
  42. package/dist/models/resources/ResourceSettings.js.map +1 -0
  43. package/dist/models/resources/SessionNote.d.ts +30 -0
  44. package/dist/models/resources/SessionNote.d.ts.map +1 -0
  45. package/dist/models/resources/SessionNote.js +2 -0
  46. package/dist/models/resources/SessionNote.js.map +1 -0
  47. package/dist/models/resources/index.d.ts +2 -0
  48. package/dist/models/resources/index.d.ts.map +1 -1
  49. package/dist/models/resources/index.js +3 -0
  50. package/dist/models/resources/index.js.map +1 -1
  51. package/dist/react/hooks/services/useResourcesServices.d.ts +5 -1
  52. package/dist/react/hooks/services/useResourcesServices.d.ts.map +1 -1
  53. package/dist/react/hooks/services/useResourcesServices.js +6 -0
  54. package/dist/react/hooks/services/useResourcesServices.js.map +1 -1
  55. package/dist/realtime/dashboards/DashboardAggregatorClient.d.ts +48 -0
  56. package/dist/realtime/dashboards/DashboardAggregatorClient.d.ts.map +1 -0
  57. package/dist/realtime/dashboards/DashboardAggregatorClient.js +65 -0
  58. package/dist/realtime/dashboards/DashboardAggregatorClient.js.map +1 -0
  59. package/dist/realtime/dashboards/index.d.ts +1 -0
  60. package/dist/realtime/dashboards/index.d.ts.map +1 -1
  61. package/dist/realtime/dashboards/index.js +3 -0
  62. package/dist/realtime/dashboards/index.js.map +1 -1
  63. package/dist/services/accounselling/CareCaseService.d.ts +45 -1
  64. package/dist/services/accounselling/CareCaseService.d.ts.map +1 -1
  65. package/dist/services/accounselling/CareCaseService.js +65 -0
  66. package/dist/services/accounselling/CareCaseService.js.map +1 -1
  67. package/dist/services/accourses/ACCourseService.d.ts +61 -1
  68. package/dist/services/accourses/ACCourseService.d.ts.map +1 -1
  69. package/dist/services/accourses/ACCourseService.js +198 -0
  70. package/dist/services/accourses/ACCourseService.js.map +1 -1
  71. package/dist/services/accourses/FacilitatorService.d.ts +37 -1
  72. package/dist/services/accourses/FacilitatorService.d.ts.map +1 -1
  73. package/dist/services/accourses/FacilitatorService.js +135 -0
  74. package/dist/services/accourses/FacilitatorService.js.map +1 -1
  75. package/dist/services/dashboard/DashboardAggregatorService.d.ts +73 -0
  76. package/dist/services/dashboard/DashboardAggregatorService.d.ts.map +1 -0
  77. package/dist/services/dashboard/DashboardAggregatorService.js +145 -0
  78. package/dist/services/dashboard/DashboardAggregatorService.js.map +1 -0
  79. package/dist/services/dashboard/DashboardLayoutService.d.ts +46 -0
  80. package/dist/services/dashboard/DashboardLayoutService.d.ts.map +1 -0
  81. package/dist/services/dashboard/DashboardLayoutService.js +75 -0
  82. package/dist/services/dashboard/DashboardLayoutService.js.map +1 -0
  83. package/dist/services/dashboard/DashboardServices.d.ts +38 -0
  84. package/dist/services/dashboard/DashboardServices.d.ts.map +1 -0
  85. package/dist/services/dashboard/DashboardServices.js +28 -0
  86. package/dist/services/dashboard/DashboardServices.js.map +1 -0
  87. package/dist/services/dashboard/index.d.ts +11 -0
  88. package/dist/services/dashboard/index.d.ts.map +1 -0
  89. package/dist/services/dashboard/index.js +10 -0
  90. package/dist/services/dashboard/index.js.map +1 -0
  91. package/dist/services/index.d.ts +1 -0
  92. package/dist/services/index.d.ts.map +1 -1
  93. package/dist/services/index.js +2 -0
  94. package/dist/services/index.js.map +1 -1
  95. package/dist/services/knowledgebase/KnowledgeBaseQAService.d.ts +7 -1
  96. package/dist/services/knowledgebase/KnowledgeBaseQAService.d.ts.map +1 -1
  97. package/dist/services/knowledgebase/KnowledgeBaseQAService.js +11 -0
  98. package/dist/services/knowledgebase/KnowledgeBaseQAService.js.map +1 -1
  99. package/dist/services/members/MemberService.d.ts +17 -0
  100. package/dist/services/members/MemberService.d.ts.map +1 -1
  101. package/dist/services/members/MemberService.js +27 -0
  102. package/dist/services/members/MemberService.js.map +1 -1
  103. package/dist/services/resources/PublicCoursesService.d.ts +7 -0
  104. package/dist/services/resources/PublicCoursesService.d.ts.map +1 -1
  105. package/dist/services/resources/PublicCoursesService.js +12 -0
  106. package/dist/services/resources/PublicCoursesService.js.map +1 -1
  107. package/dist/services/resources/ResourceSettingsService.d.ts +26 -0
  108. package/dist/services/resources/ResourceSettingsService.d.ts.map +1 -0
  109. package/dist/services/resources/ResourceSettingsService.js +43 -0
  110. package/dist/services/resources/ResourceSettingsService.js.map +1 -0
  111. package/dist/services/resources/SessionNoteService.d.ts +27 -0
  112. package/dist/services/resources/SessionNoteService.d.ts.map +1 -0
  113. package/dist/services/resources/SessionNoteService.js +44 -0
  114. package/dist/services/resources/SessionNoteService.js.map +1 -0
  115. package/dist/services/resources/UserCourseProgressService.d.ts +9 -0
  116. package/dist/services/resources/UserCourseProgressService.d.ts.map +1 -1
  117. package/dist/services/resources/UserCourseProgressService.js +13 -0
  118. package/dist/services/resources/UserCourseProgressService.js.map +1 -1
  119. package/dist/services/resources/index.d.ts +6 -0
  120. package/dist/services/resources/index.d.ts.map +1 -1
  121. package/dist/services/resources/index.js +6 -0
  122. package/dist/services/resources/index.js.map +1 -1
  123. package/package.json +1 -1
@@ -1,8 +1,287 @@
1
1
  /**
2
2
  * Dashboard models
3
3
  *
4
- * This file is a placeholder for future dashboard-related models.
5
- * Currently, no backend models exist in the Dashboard directory.
4
+ * TypeScript-SDK mirror of the cross-domain "my day at CCMS" dashboard
5
+ * contract kept byte-for-byte in step with the iOS (`CCMSSDK`) and Android
6
+ * (`com.ccms.sdk`) SDKs and the backend
7
+ * `CCMS.Api.DashboardAggregator` / `CCMSLib.Dashboard` types.
8
+ *
9
+ * The Hub renders a dashboard widget purely from its JSON payload — it never
10
+ * links the owning domain's binary — so these shapes are the locked
11
+ * cross-platform contract (`05_DASHBOARD_EXPERIENCE.md`). Unknown renderer /
12
+ * container kinds (a newer server talking to an older client) must degrade
13
+ * gracefully rather than blank-out or crash.
14
+ *
15
+ * Wire form is camelCase, matching Swift/Kotlin exactly.
16
+ */
17
+ /**
18
+ * The renderer kind a dashboard widget is drawn with — the SDK mirror of the
19
+ * backend `CCMSLib.Dashboard.WidgetRendererKind`.
20
+ *
21
+ * Wire form is the lower / kebab-case string. `'custom'` is the
22
+ * graceful-degradation fallback for unknown values.
23
+ */
24
+ export type WidgetRendererKind = 'stat' | 'list' | 'progress' | 'calendar-strip' | 'custom';
25
+ /** Every known renderer kind, in declaration order. */
26
+ export declare const WIDGET_RENDERER_KINDS: readonly WidgetRendererKind[];
27
+ /**
28
+ * Parse a wire value to a {@link WidgetRendererKind}. Unknown / undefined
29
+ * values fall back to `'custom'` — the graceful-degradation contract (a widget
30
+ * always renders something, never blank, never a crash).
31
+ */
32
+ export declare function parseWidgetRendererKind(value?: string | null): WidgetRendererKind;
33
+ /**
34
+ * The layout kind of a dashboard container section — the SDK mirror of the
35
+ * backend `CCMSLib.Dashboard.WidgetContainerType`.
36
+ *
37
+ * Wire form is the kebab-case string. `'stack'` is the graceful-degradation
38
+ * fallback for unknown values.
39
+ */
40
+ export type WidgetContainerType = 'kpi-grid' | 'kpi-two-col' | 'kpi-single' | 'horizontal-cards' | 'stack';
41
+ /** Every known container type, in declaration order. */
42
+ export declare const WIDGET_CONTAINER_TYPES: readonly WidgetContainerType[];
43
+ /**
44
+ * Parse a wire value to a {@link WidgetContainerType}. Unknown / undefined
45
+ * values fall back to `'stack'`.
46
+ */
47
+ export declare function parseWidgetContainerType(value?: string | null): WidgetContainerType;
48
+ /**
49
+ * A single self-contained dashboard widget — the SDK mirror of the backend
50
+ * `CCMSLib.Dashboard.DashboardWidget`. The Hub renders one of these from JSON
51
+ * alone, without linking the owning domain's binary.
52
+ */
53
+ export interface DashboardWidget {
54
+ /** Stable, catalogue-registered widget id (e.g. `task.my-open-count`). */
55
+ widgetId: string;
56
+ /** Payload schema version, bumped when `payload`'s shape changes. */
57
+ version: number;
58
+ /**
59
+ * The wire string the Hub maps to a native renderer. Parse with
60
+ * {@link parseWidgetRendererKind} for the unknown-tolerant value.
61
+ */
62
+ rendererKind: string;
63
+ /**
64
+ * The renderer-specific free-form JSON bag (title, subtitle, primary value,
65
+ * rows, actions, …). Kept untyped so a domain can evolve its payload without
66
+ * a shared-model change.
67
+ */
68
+ payload: Record<string, unknown>;
69
+ /** UTC ISO-8601 timestamp the underlying data was computed. */
70
+ lastUpdated?: string;
71
+ /** Freshness window in seconds; the client refreshes after it elapses. */
72
+ ttl: number;
73
+ /**
74
+ * Set when the widget could not be produced; the Hub renders an error state
75
+ * for this widget only — the rest of the dashboard still renders.
76
+ */
77
+ error?: string;
78
+ }
79
+ /**
80
+ * The composed dashboard returned by `GET /api/dashboard/me` — the SDK mirror
81
+ * of the backend `CCMS.Api.DashboardAggregator.Models.DashboardResponse`.
82
+ */
83
+ export interface DashboardResponse {
84
+ /**
85
+ * Every requested widget, in request order. Failed widgets carry a non-empty
86
+ * {@link DashboardWidget.error} — the dashboard still renders.
87
+ */
88
+ widgets: DashboardWidget[];
89
+ /** UTC ISO-8601 time the dashboard was composed. */
90
+ generatedAt: string;
91
+ }
92
+ /**
93
+ * One label/value field in a widget's enriched detail view — the SDK mirror of
94
+ * the backend `WidgetDetailField`. **Locked cross-platform contract** (matches
95
+ * the iOS `WidgetDetailFieldResult` and Android `WidgetDetailFieldResult`).
96
+ */
97
+ export interface WidgetDetailField {
98
+ /** The field's display label. */
99
+ label: string;
100
+ /** The field's display value. */
101
+ value: string;
102
+ /** Optional hex colour for the value (e.g. a status colour). */
103
+ color?: string;
104
+ }
105
+ /**
106
+ * The enriched detail a domain returns for a tapped widget row — fetched on
107
+ * demand via `GET /api/dashboard/detail?widget=&item=`. The SDK mirror of the
108
+ * backend `WidgetDetailResult` and the iOS/Android SDKs. **Locked
109
+ * cross-platform contract.**
110
+ */
111
+ export interface WidgetDetailResult {
112
+ /** The detail view's title. */
113
+ title: string;
114
+ /** Optional secondary line under the title. */
115
+ subtitle?: string;
116
+ /** The label/value fields rendered in the detail view. */
117
+ fields: WidgetDetailField[];
118
+ /** Deep link the "Open App" button routes to (e.g. `/app/tasks/123`). */
119
+ deepLink?: string;
120
+ /** Optional header image (e.g. an avatar) URL. */
121
+ imageUrl?: string;
122
+ }
123
+ /**
124
+ * One widget's placement in a {@link DashboardLayout}.
125
+ */
126
+ export interface WidgetLayoutEntry {
127
+ /** Stable, catalogue-registered widget id (e.g. `task.my-open-count`). */
128
+ widgetId: string;
129
+ /** Whether the widget is shown on the dashboard. */
130
+ enabled: boolean;
131
+ /** Zero-based sort position among the layout's widgets. */
132
+ order: number;
133
+ /**
134
+ * Free-form per-widget settings bag — kept untyped so a widget can evolve
135
+ * its settings shape without a shared-model change.
136
+ */
137
+ settings: Record<string, unknown>;
138
+ }
139
+ /**
140
+ * A container section grouping one or more widgets for the Hub to render — the
141
+ * SDK mirror of the backend `LayoutSection`.
142
+ */
143
+ export interface LayoutSection {
144
+ /** Stable section id. */
145
+ id: string;
146
+ /** Optional section heading. */
147
+ title?: string;
148
+ /**
149
+ * Wire string (`kpi-grid` | `kpi-two-col` | `kpi-single` |
150
+ * `horizontal-cards` | `stack`). Parse with {@link parseWidgetContainerType}
151
+ * (unknown → `stack`).
152
+ */
153
+ containerType: string;
154
+ /** Zero-based sort position among the layout's sections. */
155
+ order: number;
156
+ /** Whether the section is rendered. */
157
+ enabled: boolean;
158
+ /** The ids of the widgets placed in this section, in order. */
159
+ widgetIds: string[];
160
+ /**
161
+ * Free-form section settings the client reads (e.g. `{ background, cardRows,
162
+ * showWidgetTitles }`) — kept untyped so a section can evolve its settings
163
+ * shape without a shared-model change. Absent on pre-settings layouts.
164
+ */
165
+ settings?: Record<string, unknown>;
166
+ }
167
+ /**
168
+ * A swipeable dashboard page — the top layout level. The SDK mirror of the
169
+ * backend `DashboardPage`. **Locked cross-platform contract** (matches the iOS
170
+ * `DashboardPage` and Android `DashboardPage`).
171
+ */
172
+ export interface DashboardPage {
173
+ /** Stable page id (e.g. `"home"`). Unique within a layout. */
174
+ id: string;
175
+ /** Optional page title shown in the page indicator / tab. */
176
+ title?: string;
177
+ /** Zero-based sort position among the layout's pages. */
178
+ order: number;
179
+ /** The container sections rendered on this page, in order. */
180
+ sections: LayoutSection[];
181
+ }
182
+ /**
183
+ * The user's personalised dashboard layout — the SDK mirror of the backend
184
+ * `CCMS.Api.DashboardAggregator.Models.DashboardLayout`.
185
+ *
186
+ * This is the locked cross-platform contract: the iOS / Android SDKs define an
187
+ * identically-shaped type and the backend serialises the identical shape. It is
188
+ * read/written via `GET/PUT /api/dashboard/me/layout`.
189
+ */
190
+ export interface DashboardLayout {
191
+ /**
192
+ * Every widget the user has placed on their dashboard, with its enabled flag,
193
+ * sort order, and per-widget settings bag.
194
+ */
195
+ widgets: WidgetLayoutEntry[];
196
+ /**
197
+ * Optional swipeable pages — the top layout level. Absent/empty ⇒ the client
198
+ * wraps {@link DashboardLayout.sections} (or a flat stack) as a single page.
199
+ * Superseded by `pages` when present.
200
+ */
201
+ pages?: DashboardPage[];
202
+ /**
203
+ * Optional saved container sections (legacy / single-page); absent on
204
+ * pre-container layouts. Superseded by {@link DashboardLayout.pages}.
205
+ */
206
+ sections?: LayoutSection[];
207
+ /**
208
+ * UTC ISO-8601 time the layout was last saved. The server stamps this on a
209
+ * successful `PUT`; clients send it back unchanged.
210
+ */
211
+ updatedAt?: string;
212
+ }
213
+ /**
214
+ * The widgets the user has switched on, in their chosen `order`.
215
+ */
216
+ export declare function enabledWidgetsInOrder(layout: DashboardLayout): WidgetLayoutEntry[];
217
+ /**
218
+ * The sections to render: the saved {@link DashboardLayout.sections} (enabled,
219
+ * ordered, each trimmed to its enabled widgets and dropped when empty) when
220
+ * present, else a single synthesized `stack` section over
221
+ * {@link enabledWidgetsInOrder} — back-compat with pre-container layouts.
222
+ *
223
+ * Mirrors the Swift `resolvedSections` / Kotlin `resolvedSections()` logic.
224
+ */
225
+ export declare function resolvedSections(layout: DashboardLayout): LayoutSection[];
226
+ /**
227
+ * The pages to render: the saved {@link DashboardLayout.pages} (sorted by
228
+ * order, each page's sections filtered to enabled and trimmed to the layout's
229
+ * enabled widget ids, then dropped when empty) when present, else a single
230
+ * `home` page wrapping {@link resolvedSections} — back-compat with pre-page
231
+ * layouts.
232
+ *
233
+ * Mirrors the Swift `resolvedPages` / Kotlin `resolvedPages()` logic.
234
+ */
235
+ export declare function resolvedPages(layout: DashboardLayout): DashboardPage[];
236
+ /**
237
+ * One per-widget setting the editor renders a control for — the SDK mirror of
238
+ * the backend `WidgetSettingSchema`. **Locked cross-platform contract** (matches
239
+ * the iOS `WidgetSettingSchema` and Android `WidgetSettingSchema`).
240
+ */
241
+ export interface WidgetSettingSchema {
242
+ /** The setting's stable key (e.g. `"showOverdueOnly"`). */
243
+ key: string;
244
+ /** The control type — `int` | `string` | `bool` | `enum`. */
245
+ type: string;
246
+ /** The setting's display label. */
247
+ label: string;
248
+ /** The default value (number / string / bool). Wire key is `default`. */
249
+ default?: unknown;
250
+ /** Minimum value for a numeric setting. */
251
+ min?: number;
252
+ /** Maximum value for a numeric setting. */
253
+ max?: number;
254
+ /** Allowed choices for an `enum` setting. */
255
+ options?: string[];
256
+ }
257
+ /**
258
+ * Catalog metadata for one widget — drives the Hub's add-picker + settings
259
+ * sheet. The SDK mirror of the backend `WidgetCatalogItem` and the iOS/Android
260
+ * SDKs. **Locked cross-platform contract.** Returned by `GET /api/dashboard/widgets`.
261
+ */
262
+ export interface WidgetCatalogItem {
263
+ /** Stable, catalogue-registered widget id (e.g. `task.my-open-count`). */
264
+ id: string;
265
+ /** The widget's display title. */
266
+ title: string;
267
+ /** A short description shown in the add-picker. */
268
+ description: string;
269
+ /** Renderer kind: `stat` | `list` | `progress` | `calendar-strip` | `custom`. */
270
+ kind: string;
271
+ /** The widget's grouping category in the add-picker. */
272
+ category: string;
273
+ /** The container type the widget defaults into when added. */
274
+ defaultContainer: string;
275
+ /** The container types the widget can be placed in. */
276
+ supportedContainers: string[];
277
+ /** Optional default accent colour (hex) for the widget. */
278
+ defaultAccentColor?: string;
279
+ /** The per-widget settings the editor renders controls for. */
280
+ settings: WidgetSettingSchema[];
281
+ }
282
+ /**
283
+ * The bundled catalog — same set + order as the backend `WidgetCatalogMeta.All`,
284
+ * the iOS `WidgetCatalogItem.bundled`, and the Kotlin `BUNDLED_WIDGET_CATALOG`.
6
285
  */
7
- export {};
286
+ export declare const BUNDLED_WIDGET_CATALOG: WidgetCatalogItem[];
8
287
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/dashboard/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/dashboard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,MAAM,GACN,UAAU,GACV,gBAAgB,GAChB,QAAQ,CAAC;AAEb,uDAAuD;AACvD,eAAO,MAAM,qBAAqB,EAAE,SAAS,kBAAkB,EAMrD,CAAC;AAEX;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,kBAAkB,CAejF;AAMD;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,aAAa,GACb,YAAY,GACZ,kBA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CAKlF;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,aAAa,EAAE,CA2BzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,aAAa,EAAE,CA+BtE;AAMD;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,2DAA2D;IAC3D,GAAG,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2CAA2C;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,gBAAgB,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,2DAA2D;IAC3D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+DAA+D;IAC/D,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACjC;AA0ID;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,EAqErD,CAAC"}
@@ -1,8 +1,320 @@
1
1
  /**
2
2
  * Dashboard models
3
3
  *
4
- * This file is a placeholder for future dashboard-related models.
5
- * Currently, no backend models exist in the Dashboard directory.
4
+ * TypeScript-SDK mirror of the cross-domain "my day at CCMS" dashboard
5
+ * contract kept byte-for-byte in step with the iOS (`CCMSSDK`) and Android
6
+ * (`com.ccms.sdk`) SDKs and the backend
7
+ * `CCMS.Api.DashboardAggregator` / `CCMSLib.Dashboard` types.
8
+ *
9
+ * The Hub renders a dashboard widget purely from its JSON payload — it never
10
+ * links the owning domain's binary — so these shapes are the locked
11
+ * cross-platform contract (`05_DASHBOARD_EXPERIENCE.md`). Unknown renderer /
12
+ * container kinds (a newer server talking to an older client) must degrade
13
+ * gracefully rather than blank-out or crash.
14
+ *
15
+ * Wire form is camelCase, matching Swift/Kotlin exactly.
16
+ */
17
+ /** Every known renderer kind, in declaration order. */
18
+ export const WIDGET_RENDERER_KINDS = [
19
+ 'stat',
20
+ 'list',
21
+ 'progress',
22
+ 'calendar-strip',
23
+ 'custom',
24
+ ];
25
+ /**
26
+ * Parse a wire value to a {@link WidgetRendererKind}. Unknown / undefined
27
+ * values fall back to `'custom'` — the graceful-degradation contract (a widget
28
+ * always renders something, never blank, never a crash).
29
+ */
30
+ export function parseWidgetRendererKind(value) {
31
+ switch (value?.trim().toLowerCase()) {
32
+ case 'stat':
33
+ return 'stat';
34
+ case 'list':
35
+ return 'list';
36
+ case 'progress':
37
+ return 'progress';
38
+ case 'calendar-strip':
39
+ return 'calendar-strip';
40
+ case 'custom':
41
+ return 'custom';
42
+ default:
43
+ return 'custom';
44
+ }
45
+ }
46
+ /** Every known container type, in declaration order. */
47
+ export const WIDGET_CONTAINER_TYPES = [
48
+ 'kpi-grid',
49
+ 'kpi-two-col',
50
+ 'kpi-single',
51
+ 'horizontal-cards',
52
+ 'stack',
53
+ ];
54
+ /**
55
+ * Parse a wire value to a {@link WidgetContainerType}. Unknown / undefined
56
+ * values fall back to `'stack'`.
57
+ */
58
+ export function parseWidgetContainerType(value) {
59
+ switch (value?.trim().toLowerCase()) {
60
+ case 'kpi-grid':
61
+ return 'kpi-grid';
62
+ case 'kpi-two-col':
63
+ return 'kpi-two-col';
64
+ case 'kpi-single':
65
+ return 'kpi-single';
66
+ case 'horizontal-cards':
67
+ return 'horizontal-cards';
68
+ case 'stack':
69
+ return 'stack';
70
+ default:
71
+ return 'stack';
72
+ }
73
+ }
74
+ /**
75
+ * The widgets the user has switched on, in their chosen `order`.
76
+ */
77
+ export function enabledWidgetsInOrder(layout) {
78
+ return (layout.widgets ?? [])
79
+ .filter((w) => w.enabled)
80
+ .slice()
81
+ .sort((a, b) => a.order - b.order);
82
+ }
83
+ /**
84
+ * The sections to render: the saved {@link DashboardLayout.sections} (enabled,
85
+ * ordered, each trimmed to its enabled widgets and dropped when empty) when
86
+ * present, else a single synthesized `stack` section over
87
+ * {@link enabledWidgetsInOrder} — back-compat with pre-container layouts.
88
+ *
89
+ * Mirrors the Swift `resolvedSections` / Kotlin `resolvedSections()` logic.
90
+ */
91
+ export function resolvedSections(layout) {
92
+ const ordered = enabledWidgetsInOrder(layout);
93
+ const enabledIds = new Set(ordered.map((w) => w.widgetId));
94
+ const saved = layout.sections;
95
+ if (saved && saved.length > 0) {
96
+ return saved
97
+ .filter((s) => s.enabled)
98
+ .slice()
99
+ .sort((a, b) => a.order - b.order)
100
+ .map((s) => ({
101
+ ...s,
102
+ widgetIds: s.widgetIds.filter((id) => enabledIds.has(id)),
103
+ }))
104
+ .filter((s) => s.widgetIds.length > 0);
105
+ }
106
+ return [
107
+ {
108
+ id: 'all',
109
+ title: undefined,
110
+ containerType: 'stack',
111
+ order: 0,
112
+ enabled: true,
113
+ widgetIds: ordered.map((w) => w.widgetId),
114
+ },
115
+ ];
116
+ }
117
+ /**
118
+ * The pages to render: the saved {@link DashboardLayout.pages} (sorted by
119
+ * order, each page's sections filtered to enabled and trimmed to the layout's
120
+ * enabled widget ids, then dropped when empty) when present, else a single
121
+ * `home` page wrapping {@link resolvedSections} — back-compat with pre-page
122
+ * layouts.
123
+ *
124
+ * Mirrors the Swift `resolvedPages` / Kotlin `resolvedPages()` logic.
125
+ */
126
+ export function resolvedPages(layout) {
127
+ const enabledIds = new Set(enabledWidgetsInOrder(layout).map((w) => w.widgetId));
128
+ const saved = layout.pages;
129
+ if (saved && saved.length > 0) {
130
+ return saved
131
+ .slice()
132
+ .sort((a, b) => a.order - b.order)
133
+ .map((page) => ({
134
+ ...page,
135
+ sections: page.sections
136
+ .filter((s) => s.enabled)
137
+ .slice()
138
+ .sort((a, b) => a.order - b.order)
139
+ .map((s) => ({
140
+ ...s,
141
+ widgetIds: s.widgetIds.filter((id) => enabledIds.has(id)),
142
+ }))
143
+ .filter((s) => s.widgetIds.length > 0),
144
+ }))
145
+ .filter((page) => page.sections.length > 0);
146
+ }
147
+ return [
148
+ {
149
+ id: 'home',
150
+ title: undefined,
151
+ order: 0,
152
+ sections: resolvedSections(layout),
153
+ },
154
+ ];
155
+ }
156
+ // ───────────────────────────────────────────────────────────────────────────
157
+ // Bundled catalog fallback
158
+ // ───────────────────────────────────────────────────────────────────────────
159
+ /**
160
+ * A **bundled, client-side mirror** of the backend `WidgetCatalogMeta` — the
161
+ * fallback the Hub uses when `GET /api/dashboard/widgets` is unavailable (e.g. an
162
+ * aggregator deployment that predates the catalog endpoint). It keeps the
163
+ * Add-Widget picker, type badges and per-widget settings working before the
164
+ * server catalog ships.
165
+ *
166
+ * Kept byte-identical to the backend `WidgetCatalogMeta` and the iOS
167
+ * `WidgetCatalogItem.bundled` / Kotlin `BUNDLED_WIDGET_CATALOG` (ids, kinds,
168
+ * categories, descriptions, accent hexes, settings schema).
169
+ */
170
+ // ---- categories (domain-based, mirroring the backend) ----
171
+ const CAT_TASKS = 'Tasks';
172
+ const CAT_HR = 'HR & People';
173
+ const CAT_BOOKINGS = 'Bookings';
174
+ const CAT_PROCUREMENT = 'Procurement';
175
+ const CAT_LEARNING = 'Learning';
176
+ const CAT_ANNOUNCEMENTS = 'Announcements';
177
+ const CAT_MEETINGS = 'Meetings';
178
+ const CAT_MESSAGES = 'Messages';
179
+ const CAT_APPS = 'My Apps';
180
+ const STAT_CONTAINERS = ['kpi-grid', 'kpi-two-col', 'kpi-single', 'stack'];
181
+ const LIST_CONTAINERS = ['stack', 'horizontal-cards'];
182
+ const STACK_ONLY = ['stack'];
183
+ const customTitleSetting = () => ({
184
+ key: 'customTitle',
185
+ type: 'string',
186
+ label: 'Custom title',
187
+ });
188
+ const countSetting = (max = 20, def = 5) => ({
189
+ key: 'count',
190
+ type: 'int',
191
+ label: 'How many to show',
192
+ default: def,
193
+ min: 1,
194
+ max,
195
+ });
196
+ const accentColorSetting = () => ({
197
+ key: 'color',
198
+ type: 'enum',
199
+ label: 'Accent colour',
200
+ default: 'default',
201
+ options: ['default', 'blue', 'green', 'amber', 'purple', 'pink', 'teal', 'red', 'cyan'],
202
+ });
203
+ const statItem = (id, title, description, category, accent) => ({
204
+ id,
205
+ title,
206
+ description,
207
+ kind: 'stat',
208
+ category,
209
+ defaultContainer: 'kpi-grid',
210
+ supportedContainers: STAT_CONTAINERS,
211
+ defaultAccentColor: accent,
212
+ settings: [customTitleSetting(), accentColorSetting()],
213
+ });
214
+ const listItem = (id, title, description, category) => ({
215
+ id,
216
+ title,
217
+ description,
218
+ kind: 'list',
219
+ category,
220
+ defaultContainer: 'stack',
221
+ supportedContainers: LIST_CONTAINERS,
222
+ settings: [customTitleSetting(), countSetting()],
223
+ });
224
+ const progressItem = (id, title, description, category) => ({
225
+ id,
226
+ title,
227
+ description,
228
+ kind: 'progress',
229
+ category,
230
+ defaultContainer: 'stack',
231
+ supportedContainers: STACK_ONLY,
232
+ settings: [customTitleSetting()],
233
+ });
234
+ const calendarItem = (id, title, description, category) => ({
235
+ id,
236
+ title,
237
+ description,
238
+ kind: 'calendar-strip',
239
+ category,
240
+ defaultContainer: 'stack',
241
+ supportedContainers: STACK_ONLY,
242
+ settings: [customTitleSetting()],
243
+ });
244
+ const customItem = (id, title, description, category) => ({
245
+ id,
246
+ title,
247
+ description,
248
+ kind: 'custom',
249
+ category,
250
+ defaultContainer: 'stack',
251
+ supportedContainers: STACK_ONLY,
252
+ settings: [],
253
+ });
254
+ /**
255
+ * The bundled catalog — same set + order as the backend `WidgetCatalogMeta.All`,
256
+ * the iOS `WidgetCatalogItem.bundled`, and the Kotlin `BUNDLED_WIDGET_CATALOG`.
6
257
  */
7
- export {};
258
+ export const BUNDLED_WIDGET_CATALOG = [
259
+ // My Apps (special client-rendered launcher)
260
+ customItem('hub.my-apps', 'My apps', 'Quick-launch the CCMS apps you use.', CAT_APPS),
261
+ // Tasks
262
+ statItem('task.my-open-count', 'Open tasks', 'How many tasks you have open right now.', CAT_TASKS, '#3B82F6'),
263
+ listItem('task.due-today', 'Due today', 'Tasks due today, by priority.', CAT_TASKS),
264
+ listItem('task.overdue', 'Overdue tasks', 'Tasks past their due date.', CAT_TASKS),
265
+ listItem('task.recently-assigned', 'Recently assigned', 'The latest tasks assigned to you.', CAT_TASKS),
266
+ listItem('task.high-priority', 'High priority', 'Your open high-priority tasks.', CAT_TASKS),
267
+ listItem('task.due-this-week', 'Due this week', 'Tasks due in the next seven days.', CAT_TASKS),
268
+ progressItem('task.completion-rate', 'Completion rate', 'Your task completion this week.', CAT_TASKS),
269
+ // HR & People
270
+ calendarItem('hr.next-leave', 'My next leave', 'Your next upcoming approved or pending leave.', CAT_HR),
271
+ listItem('hr.upcoming-birthdays', 'Upcoming birthdays', "Celebrate the team's upcoming birthdays.", CAT_HR),
272
+ listItem('hr.team-leave', 'Team leave', 'Colleagues currently on or about to start leave.', CAT_HR),
273
+ listItem('hr.pending-leave', 'My pending leave', 'Your leave requests awaiting approval.', CAT_HR),
274
+ statItem('hr.headcount', 'Headcount', 'Total active employees.', CAT_HR, '#16A34A'),
275
+ listItem('hr.birthdays-this-month', 'Birthdays this month', 'Everyone celebrating this month.', CAT_HR),
276
+ // Procurement
277
+ listItem('proc.pending-approvals', 'Pending approvals', 'Purchase requests waiting on you to approve.', CAT_PROCUREMENT),
278
+ listItem('proc.my-requests', 'My requests', 'Purchase requests you submitted and their status.', CAT_PROCUREMENT),
279
+ listItem('proc.high-value-pending', 'High-value pending', 'Pending approvals over a value threshold.', CAT_PROCUREMENT),
280
+ // Bookings
281
+ {
282
+ id: 'booking.my-upcoming',
283
+ title: 'My bookings',
284
+ description: 'Your upcoming bookings; filterable by resource type.',
285
+ kind: 'list',
286
+ category: CAT_BOOKINGS,
287
+ defaultContainer: 'stack',
288
+ supportedContainers: LIST_CONTAINERS,
289
+ settings: [
290
+ customTitleSetting(),
291
+ countSetting(),
292
+ {
293
+ key: 'resourceTypeId',
294
+ type: 'int',
295
+ label: 'Resource type id (0 = all)',
296
+ default: 0,
297
+ min: 0,
298
+ max: 9999,
299
+ },
300
+ ],
301
+ },
302
+ listItem('booking.today', "Today's bookings", 'Bookings happening today.', CAT_BOOKINGS),
303
+ listItem('booking.pending-approval', 'Pending bookings', 'Bookings awaiting approval.', CAT_BOOKINGS),
304
+ // Learning
305
+ progressItem('resource.in-progress-course', 'Course in progress', 'Pick up your most recent course.', CAT_LEARNING),
306
+ statItem('resource.completed-courses', 'Completed courses', "Courses you've finished.", CAT_LEARNING, '#8B5CF6'),
307
+ listItem('resource.recommended', 'Recommended for you', "Courses suggested from what you've started.", CAT_LEARNING),
308
+ // Announcements
309
+ statItem('announcement.unread', 'Unread announcements', "How many announcements you haven't read.", CAT_ANNOUNCEMENTS, '#F97316'),
310
+ listItem('announcement.latest-feed', 'Latest announcements', 'The newest announcements, pinned first.', CAT_ANNOUNCEMENTS),
311
+ listItem('announcement.pinned', 'Pinned announcements', 'Important pinned announcements.', CAT_ANNOUNCEMENTS),
312
+ listItem('announcement.high-priority', 'High-priority notices', 'Urgent and high-priority announcements.', CAT_ANNOUNCEMENTS),
313
+ // Meetings
314
+ statItem('meeting.next-meeting', 'Next meeting', 'Your next upcoming meeting.', CAT_MEETINGS, '#EC4899'),
315
+ listItem('meeting.today', "Today's meetings", 'Meetings on your calendar today.', CAT_MEETINGS),
316
+ statItem('meeting.invites-pending', 'Pending invites', 'Meeting invites awaiting your reply.', CAT_MEETINGS, '#EC4899'),
317
+ // Messages
318
+ statItem('chat.unread', 'Unread messages', 'Unread conversations across your chats.', CAT_MESSAGES, '#2563EB'),
319
+ ];
8
320
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/dashboard/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/dashboard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAoBH,uDAAuD;AACvD,MAAM,CAAC,MAAM,qBAAqB,GAAkC;IAClE,MAAM;IACN,MAAM;IACN,UAAU;IACV,gBAAgB;IAChB,QAAQ;CACA,CAAC;AAEX;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAqB;IAC3D,QAAQ,KAAK,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;QACpC,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB,KAAK,UAAU;YACb,OAAO,UAAU,CAAC;QACpB,KAAK,gBAAgB;YACnB,OAAO,gBAAgB,CAAC;QAC1B,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC;AAoBD,wDAAwD;AACxD,MAAM,CAAC,MAAM,sBAAsB,GAAmC;IACpE,UAAU;IACV,aAAa;IACb,YAAY;IACZ,kBAAkB;IAClB,OAAO;CACC,CAAC;AAEX;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAqB;IAC5D,QAAQ,KAAK,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;QACpC,KAAK,UAAU;YACb,OAAO,UAAU,CAAC;QACpB,KAAK,aAAa;YAChB,OAAO,aAAa,CAAC;QACvB,KAAK,YAAY;YACf,OAAO,YAAY,CAAC;QACtB,KAAK,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YAAY,EAAE,SAAS,CAAC;CAC/G,CAAC"}
@@ -1,3 +1,5 @@
1
+ import { CoursePrerequisiteModelView } from './CoursePrerequisiteModelView';
2
+ import { SessionModelView } from './SessionModelView';
1
3
  /**
2
4
  * Course Model View
3
5
  */
@@ -30,6 +32,21 @@ export interface CourseModelView {
30
32
  visibilityIcon?: string | null;
31
33
  slug?: string | null;
32
34
  publishedDateTime?: number | null;
35
+ sessions?: SessionModelView[] | null;
36
+ viewerStatusID?: number | null;
37
+ viewerStatusName?: string | null;
38
+ viewerStatusColor?: string | null;
39
+ viewerStatusIcon?: string | null;
40
+ viewerPercentComplete?: number | null;
41
+ viewerCompletedSessionCount?: number | null;
42
+ viewerLastSessionID?: number | null;
43
+ viewerStartedAt?: number | null;
44
+ viewerLastAccessedAt?: number | null;
45
+ viewerCompletedAt?: number | null;
46
+ canStart?: boolean | null;
47
+ requiredPrerequisites?: CoursePrerequisiteModelView[] | null;
48
+ unmetPrerequisites?: CoursePrerequisiteModelView[] | null;
49
+ recommendedPrerequisites?: CoursePrerequisiteModelView[] | null;
33
50
  }
34
51
  /**
35
52
  * Course Filter Model