@ikonintegration/module-config-api 2.0.19 → 2.0.21

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.
@@ -19,7 +19,7 @@ export interface CacheConfig {
19
19
  version?: number;
20
20
  }
21
21
  /**
22
- * Cache key prefixes and TTL constants (matching the legacy client).
22
+ * Cache key prefixes and TTL constants (matching the persistent cache).
23
23
  */
24
24
  export declare const CacheConstants: {
25
25
  readonly CustomerPrefix: "CO::";
@@ -29,3 +29,299 @@ export declare const CacheConstants: {
29
29
  readonly AllTenantsTTL: number;
30
30
  readonly TenantTTL: 60;
31
31
  };
32
+ /**
33
+ * Course provider object as stored in the expanded customer cache.
34
+ */
35
+ export interface CachedCourseProvider {
36
+ id: string;
37
+ type?: string;
38
+ onlineTemplateIDs?: string[];
39
+ provider?: any;
40
+ createdBy?: string;
41
+ createdOn?: number;
42
+ updatedBy?: string;
43
+ updatedOn?: number;
44
+ }
45
+ /**
46
+ * Tile permissions as injected into the cached customer.
47
+ */
48
+ export interface CachedTilePermissions {
49
+ customerID?: string;
50
+ tilePermissions?: Record<string, any>;
51
+ [key: string]: any;
52
+ }
53
+ /**
54
+ * The expanded customer object stored in the persistent cache.
55
+ * Differs from CustomerResponse:
56
+ * - `allowedOnlineCourseProviders` contains full CourseProvider objects (not just IDs)
57
+ * - `tilePermissions` is injected from the PortalTilePermissions table
58
+ */
59
+ export interface CachedCustomer {
60
+ id: string;
61
+ createdBy?: string;
62
+ createdOn?: number;
63
+ updatedBy?: string;
64
+ updatedOn?: number;
65
+ timezoneCode?: string;
66
+ adminRole?: string;
67
+ userRole?: string;
68
+ instructorRole?: string;
69
+ idmKey?: string;
70
+ idmToken?: string;
71
+ idmAPIUser?: string;
72
+ idmAPIPassword?: string;
73
+ mailerSender?: string;
74
+ preventUserFromUpdatingNames?: boolean;
75
+ orgModEndpoint?: string;
76
+ orgAdminRole?: string;
77
+ orgSubAdminRole?: string;
78
+ orgUserRole?: string;
79
+ orgModNamespace?: string;
80
+ /** Expanded: full CourseProvider objects (not just IDs) */
81
+ allowedOnlineCourseProviders?: CachedCourseProvider[];
82
+ allowedForeignReqs?: string[];
83
+ displayName?: string;
84
+ sharedModuleLicenseAPIKey?: string;
85
+ sharedModuleConfigAPIKey?: string;
86
+ sharedModuleAuditingAPIKey?: string;
87
+ sharedModuleAgreementAPIKey?: string;
88
+ sharedModuleOrganizationAPIKey?: string;
89
+ sharedModuleClassroomAPIKey?: string;
90
+ sharedModuleMailerAPIKey?: string;
91
+ authConfig?: Record<string, any>;
92
+ portalConfig?: {
93
+ theme?: string;
94
+ domain?: string;
95
+ cookiesHubDomain?: string;
96
+ acceptConnectionsFrom?: string;
97
+ };
98
+ theme?: Record<string, any>;
99
+ domain?: string;
100
+ cookiesHubDomain?: string;
101
+ acceptConnectionsFrom?: string[];
102
+ worksafeTerm?: string;
103
+ cancelationPolicies?: Array<{
104
+ id?: string;
105
+ description?: string;
106
+ cancelPolicy?: {
107
+ isBusinessDays?: boolean;
108
+ canBeCanceled?: boolean;
109
+ canBeRescheduled?: boolean;
110
+ rules?: Array<{
111
+ untilDaysBefore?: number;
112
+ percentageRefunded?: number;
113
+ amountCharged?: number;
114
+ deductEnrolmentPayment?: boolean;
115
+ }>;
116
+ };
117
+ }>;
118
+ salesTaxLabel?: string;
119
+ ignoreCustomAttributesForSignUp?: boolean;
120
+ timezone?: string;
121
+ /** Injected from PortalTilePermissions table */
122
+ tilePermissions?: CachedTilePermissions | null;
123
+ cooldownPolicies?: Array<{
124
+ id?: string;
125
+ description?: string;
126
+ cooldownPolicy?: {
127
+ rules?: Array<{
128
+ untilFailedAttempts?: number;
129
+ cooldownPeriod?: number;
130
+ invalidateCourseRequirements?: boolean;
131
+ lockApplication?: boolean;
132
+ blockCourse?: boolean;
133
+ autoUnlockInDays?: number;
134
+ }>;
135
+ };
136
+ }>;
137
+ ui?: {
138
+ banner?: {
139
+ type?: string;
140
+ content?: string;
141
+ };
142
+ };
143
+ featureFlags?: Array<{
144
+ name: string;
145
+ enabled: boolean;
146
+ metadata?: string;
147
+ }>;
148
+ [key: string]: any;
149
+ }
150
+ /**
151
+ * Course object as stored inside cached certification requirements.
152
+ */
153
+ export interface CachedCourse {
154
+ id: string;
155
+ certificationID: string;
156
+ tenantID?: string;
157
+ customerID?: string;
158
+ productID?: string;
159
+ waivePayments?: boolean;
160
+ coolDownPeriod?: number | number[] | null;
161
+ coolDownPolicy?: any;
162
+ enableRequestToEnrol?: boolean;
163
+ materialsProductID?: string;
164
+ maxRetry?: number;
165
+ requirementsIDs?: string[];
166
+ requiredOnRenew?: boolean;
167
+ validityPeriod?: number;
168
+ validityPeriodInMonths?: number;
169
+ validityPeriodInYears?: number;
170
+ webhooks?: string[];
171
+ isRetakeAllowed?: boolean;
172
+ allowStudentUploads?: boolean;
173
+ allowIfAnyRequirementMet?: boolean;
174
+ allowOnlyIfCertificationIsValid?: boolean;
175
+ gracePeriodAfterCertCompletion?: number;
176
+ courseFailWebhooks?: string[];
177
+ cooldownStartWebhooks?: string[];
178
+ cooldownEndWebhooks?: string[];
179
+ lockAfterFailure?: boolean;
180
+ agreementID?: string;
181
+ isMandatory?: boolean;
182
+ points?: number;
183
+ courseBooks?: Array<{
184
+ fileID: string;
185
+ fileName: string;
186
+ attachToEmail?: boolean;
187
+ }>;
188
+ courseCertificateType?: string;
189
+ courseCertificateTemplate?: string;
190
+ courseCertNumberMaskFormat?: string;
191
+ courseCertNumberMode?: string;
192
+ courseCertNumberInitialNumber?: string;
193
+ externalRequirementWebhook?: string;
194
+ reuseCertNumber?: boolean;
195
+ warningDuePaymentRemainingDays?: number;
196
+ warningRemainingDays?: Array<{
197
+ template: string;
198
+ period: number;
199
+ }>;
200
+ onlineWarningRemainingDays?: Array<{
201
+ template: string;
202
+ period: number;
203
+ }>;
204
+ emailComplement?: string;
205
+ emailTemplates?: {
206
+ coursePassed?: string | null;
207
+ courseFailed?: string | null;
208
+ };
209
+ emailEventOverrides?: Array<{
210
+ eventID: string;
211
+ templateID: string;
212
+ }>;
213
+ displayName?: string;
214
+ cardDescription?: string;
215
+ description?: string;
216
+ uiTerm?: string;
217
+ uiLogo?: string;
218
+ calendarColor?: string;
219
+ showCollapsed?: boolean;
220
+ passUiTerm?: string;
221
+ failUiTerm?: string;
222
+ courseType?: string;
223
+ preventLaunchIfCompleted?: boolean;
224
+ requirementUserAttribIDs?: Array<{
225
+ partition: string;
226
+ attributeName: string;
227
+ description: string;
228
+ }>;
229
+ createdBy?: string;
230
+ createdOn?: number;
231
+ updatedBy?: string;
232
+ updatedOn?: number;
233
+ [key: string]: any;
234
+ }
235
+ /**
236
+ * Training provider object as stored inside cached certifications.
237
+ */
238
+ export interface CachedTrainingProvider {
239
+ id: string;
240
+ customerID: string;
241
+ name?: string;
242
+ url?: string;
243
+ isDisabled?: boolean;
244
+ createdBy?: string;
245
+ createdOn?: number;
246
+ updatedBy?: string;
247
+ updatedOn?: number;
248
+ }
249
+ /**
250
+ * Application section within a cached certification.
251
+ */
252
+ export interface CachedApplicationSection {
253
+ applicationEnabled?: boolean;
254
+ equivalenciesSection?: {
255
+ sectionEnabled?: boolean;
256
+ /** Expanded equivalence objects with isDisabled flag */
257
+ options?: Array<{
258
+ id: string;
259
+ isDisabled?: boolean;
260
+ [key: string]: any;
261
+ }>;
262
+ };
263
+ requirementsSection?: {
264
+ sectionEnabled?: boolean;
265
+ /** Expanded requirement objects with isDisabled flag */
266
+ requirements?: Array<{
267
+ id: string;
268
+ isDisabled?: boolean;
269
+ [key: string]: any;
270
+ }>;
271
+ };
272
+ electiveRequirementsSection?: {
273
+ sectionEnabled?: boolean;
274
+ requirements?: Array<{
275
+ id: string;
276
+ isDisabled?: boolean;
277
+ [key: string]: any;
278
+ }>;
279
+ };
280
+ customRequirementsSections?: Array<{
281
+ sectionEnabled?: boolean;
282
+ requirements?: Array<{
283
+ id: string;
284
+ isDisabled?: boolean;
285
+ [key: string]: any;
286
+ }>;
287
+ [key: string]: any;
288
+ }>;
289
+ [key: string]: any;
290
+ }
291
+ /**
292
+ * Certification object as stored inside the cached tenant.
293
+ * Contains expanded requirements (full course objects) and application sections.
294
+ */
295
+ export interface CachedCertification {
296
+ id: string;
297
+ customerID: string;
298
+ tenantID: string;
299
+ /** Expanded course requirements — can be CachedCourse or CachedCourse[] (grouped alternatives) */
300
+ requirements?: (CachedCourse | CachedCourse[])[];
301
+ application?: CachedApplicationSection;
302
+ renewal?: {
303
+ application?: CachedApplicationSection;
304
+ [key: string]: any;
305
+ };
306
+ /** Training providers relevant to this certification */
307
+ trainingProviders?: CachedTrainingProvider[];
308
+ [key: string]: any;
309
+ }
310
+ /**
311
+ * The expanded tenant object stored in the persistent cache.
312
+ * Differs from TenantResponse:
313
+ * - `certifications` array is injected with fully expanded certification objects
314
+ * (including courses, applications with equivalencies/requirements, training providers)
315
+ */
316
+ export interface CachedTenant {
317
+ id: string;
318
+ customerID: string;
319
+ createdBy?: string;
320
+ createdOn?: number;
321
+ updatedBy?: string;
322
+ updatedOn?: number;
323
+ name?: string;
324
+ /** Expanded certifications with full course/application/training provider data */
325
+ certifications?: CachedCertification[];
326
+ [key: string]: any;
327
+ }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CacheConstants = void 0;
4
4
  /**
5
- * Cache key prefixes and TTL constants (matching the legacy client).
5
+ * Cache key prefixes and TTL constants (matching the persistent cache).
6
6
  */
7
7
  exports.CacheConstants = {
8
8
  // Customer
package/dist/index.d.ts CHANGED
@@ -6,4 +6,4 @@ export * from './Api.js';
6
6
  export { CacheClient } from './CacheClient.js';
7
7
  export { MemoryCache } from './MemoryCache.js';
8
8
  export { CacheConstants } from './CacheTypes.js';
9
- export type { RedisLike, CacheConfig } from './CacheTypes.js';
9
+ export type { RedisLike, CacheConfig, CachedCustomer, CachedTenant, CachedCertification, CachedCourse, CachedCourseProvider, CachedTrainingProvider, CachedApplicationSection, CachedTilePermissions, } from './CacheTypes.js';
package/index.ts CHANGED
@@ -11,4 +11,15 @@ export * from './Api.js'
11
11
  export { CacheClient } from './CacheClient.js'
12
12
  export { MemoryCache } from './MemoryCache.js'
13
13
  export { CacheConstants } from './CacheTypes.js'
14
- export type { RedisLike, CacheConfig } from './CacheTypes.js'
14
+ export type {
15
+ RedisLike,
16
+ CacheConfig,
17
+ CachedCustomer,
18
+ CachedTenant,
19
+ CachedCertification,
20
+ CachedCourse,
21
+ CachedCourseProvider,
22
+ CachedTrainingProvider,
23
+ CachedApplicationSection,
24
+ CachedTilePermissions,
25
+ } from './CacheTypes.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikonintegration/module-config-api",
3
- "version": "2.0.19",
3
+ "version": "2.0.21",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {