@ampsec/platform-client 68.4.0 → 68.6.0
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/build/src/dto/findings.dto.d.ts +0 -19
- package/build/src/dto/findings.dto.js +0 -1
- package/build/src/dto/findings.dto.js.map +1 -1
- package/build/src/dto/platform/platform.findings.dto.d.ts +0 -14
- package/build/src/services/contentful.service.d.ts +28 -11
- package/build/src/services/contentful.service.js +33 -9
- package/build/src/services/contentful.service.js.map +1 -1
- package/package.json +1 -1
- package/src/dto/findings.dto.ts +0 -1
- package/src/services/contentful.service.ts +39 -11
|
@@ -89,7 +89,6 @@ declare const _FindingSpecInsights: z.ZodObject<{
|
|
|
89
89
|
}, {
|
|
90
90
|
$has: boolean;
|
|
91
91
|
}>>;
|
|
92
|
-
severity: z.ZodOptional<z.ZodNativeEnum<typeof FindingSeverity>>;
|
|
93
92
|
findingCondition: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>;
|
|
94
93
|
remediatedCondition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>>;
|
|
95
94
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -102,7 +101,6 @@ declare const _FindingSpecInsights: z.ZodObject<{
|
|
|
102
101
|
uid?: {
|
|
103
102
|
$has: boolean;
|
|
104
103
|
} | undefined;
|
|
105
|
-
severity?: FindingSeverity | undefined;
|
|
106
104
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
107
105
|
}, {
|
|
108
106
|
kind: SaasComponentKind;
|
|
@@ -114,7 +112,6 @@ declare const _FindingSpecInsights: z.ZodObject<{
|
|
|
114
112
|
uid?: {
|
|
115
113
|
$has: boolean;
|
|
116
114
|
} | undefined;
|
|
117
|
-
severity?: FindingSeverity | undefined;
|
|
118
115
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
119
116
|
}>>;
|
|
120
117
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -133,7 +130,6 @@ declare const _FindingSpecInsights: z.ZodObject<{
|
|
|
133
130
|
uid?: {
|
|
134
131
|
$has: boolean;
|
|
135
132
|
} | undefined;
|
|
136
|
-
severity?: FindingSeverity | undefined;
|
|
137
133
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
138
134
|
} | undefined;
|
|
139
135
|
}, {
|
|
@@ -152,7 +148,6 @@ declare const _FindingSpecInsights: z.ZodObject<{
|
|
|
152
148
|
uid?: {
|
|
153
149
|
$has: boolean;
|
|
154
150
|
} | undefined;
|
|
155
|
-
severity?: FindingSeverity | undefined;
|
|
156
151
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
157
152
|
} | undefined;
|
|
158
153
|
}>;
|
|
@@ -198,7 +193,6 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
198
193
|
}, {
|
|
199
194
|
$has: boolean;
|
|
200
195
|
}>>;
|
|
201
|
-
severity: z.ZodOptional<z.ZodNativeEnum<typeof FindingSeverity>>;
|
|
202
196
|
findingCondition: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>;
|
|
203
197
|
remediatedCondition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>>;
|
|
204
198
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -211,7 +205,6 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
211
205
|
uid?: {
|
|
212
206
|
$has: boolean;
|
|
213
207
|
} | undefined;
|
|
214
|
-
severity?: FindingSeverity | undefined;
|
|
215
208
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
216
209
|
}, {
|
|
217
210
|
kind: SaasComponentKind;
|
|
@@ -223,7 +216,6 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
223
216
|
uid?: {
|
|
224
217
|
$has: boolean;
|
|
225
218
|
} | undefined;
|
|
226
|
-
severity?: FindingSeverity | undefined;
|
|
227
219
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
228
220
|
}>>;
|
|
229
221
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -242,7 +234,6 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
242
234
|
uid?: {
|
|
243
235
|
$has: boolean;
|
|
244
236
|
} | undefined;
|
|
245
|
-
severity?: FindingSeverity | undefined;
|
|
246
237
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
247
238
|
} | undefined;
|
|
248
239
|
}, {
|
|
@@ -261,7 +252,6 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
261
252
|
uid?: {
|
|
262
253
|
$has: boolean;
|
|
263
254
|
} | undefined;
|
|
264
|
-
severity?: FindingSeverity | undefined;
|
|
265
255
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
266
256
|
} | undefined;
|
|
267
257
|
}>>;
|
|
@@ -297,7 +287,6 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
297
287
|
uid?: {
|
|
298
288
|
$has: boolean;
|
|
299
289
|
} | undefined;
|
|
300
|
-
severity?: FindingSeverity | undefined;
|
|
301
290
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
302
291
|
} | undefined;
|
|
303
292
|
} | undefined;
|
|
@@ -332,7 +321,6 @@ export declare const _FindingSpecDto: z.ZodObject<{
|
|
|
332
321
|
uid?: {
|
|
333
322
|
$has: boolean;
|
|
334
323
|
} | undefined;
|
|
335
|
-
severity?: FindingSeverity | undefined;
|
|
336
324
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
337
325
|
} | undefined;
|
|
338
326
|
} | undefined;
|
|
@@ -386,7 +374,6 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
386
374
|
}, {
|
|
387
375
|
$has: boolean;
|
|
388
376
|
}>>;
|
|
389
|
-
severity: z.ZodOptional<z.ZodNativeEnum<typeof FindingSeverity>>;
|
|
390
377
|
findingCondition: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>;
|
|
391
378
|
remediatedCondition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>>;
|
|
392
379
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -399,7 +386,6 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
399
386
|
uid?: {
|
|
400
387
|
$has: boolean;
|
|
401
388
|
} | undefined;
|
|
402
|
-
severity?: FindingSeverity | undefined;
|
|
403
389
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
404
390
|
}, {
|
|
405
391
|
kind: SaasComponentKind;
|
|
@@ -411,7 +397,6 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
411
397
|
uid?: {
|
|
412
398
|
$has: boolean;
|
|
413
399
|
} | undefined;
|
|
414
|
-
severity?: FindingSeverity | undefined;
|
|
415
400
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
416
401
|
}>>;
|
|
417
402
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -430,7 +415,6 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
430
415
|
uid?: {
|
|
431
416
|
$has: boolean;
|
|
432
417
|
} | undefined;
|
|
433
|
-
severity?: FindingSeverity | undefined;
|
|
434
418
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
435
419
|
} | undefined;
|
|
436
420
|
}, {
|
|
@@ -449,7 +433,6 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
449
433
|
uid?: {
|
|
450
434
|
$has: boolean;
|
|
451
435
|
} | undefined;
|
|
452
|
-
severity?: FindingSeverity | undefined;
|
|
453
436
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
454
437
|
} | undefined;
|
|
455
438
|
}>>;
|
|
@@ -484,7 +467,6 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
484
467
|
uid?: {
|
|
485
468
|
$has: boolean;
|
|
486
469
|
} | undefined;
|
|
487
|
-
severity?: FindingSeverity | undefined;
|
|
488
470
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
489
471
|
} | undefined;
|
|
490
472
|
} | undefined;
|
|
@@ -519,7 +501,6 @@ export declare const _FindingSpecUpsertDto: z.ZodObject<{
|
|
|
519
501
|
uid?: {
|
|
520
502
|
$has: boolean;
|
|
521
503
|
} | undefined;
|
|
522
|
-
severity?: FindingSeverity | undefined;
|
|
523
504
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
524
505
|
} | undefined;
|
|
525
506
|
} | undefined;
|
|
@@ -28,7 +28,6 @@ const _FindingSpecInsights = zod_1.z.object({
|
|
|
28
28
|
$has: zod_1.z.boolean(),
|
|
29
29
|
})
|
|
30
30
|
.optional(),
|
|
31
|
-
severity: zod_1.z.nativeEnum(enums_2.FindingSeverity).optional(),
|
|
32
31
|
findingCondition: zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.boolean(), zod_1.z.string(), zod_1.z.number(), zod_1.z.undefined()])),
|
|
33
32
|
remediatedCondition: zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.boolean(), zod_1.z.string(), zod_1.z.number(), zod_1.z.undefined()])).optional(),
|
|
34
33
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findings.dto.js","sourceRoot":"","sources":["../../../src/dto/findings.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAEtB,yCAA6E;AAC7E,mCAAkF;AAClF,mCAAuE;AA6DvE,MAAM,uBAAuB,GAAG,OA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
|
48
48
|
$has: boolean;
|
|
49
49
|
}>>;
|
|
50
|
-
severity: z.ZodOptional<z.ZodNativeEnum<typeof import("..").FindingSeverity>>;
|
|
51
50
|
findingCondition: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>;
|
|
52
51
|
remediatedCondition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>>;
|
|
53
52
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -60,7 +59,6 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
|
|
|
60
59
|
uid?: {
|
|
61
60
|
$has: boolean;
|
|
62
61
|
} | undefined;
|
|
63
|
-
severity?: import("..").FindingSeverity | undefined;
|
|
64
62
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
65
63
|
}, {
|
|
66
64
|
kind: import("..").SaasComponentKind;
|
|
@@ -72,7 +70,6 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
|
|
|
72
70
|
uid?: {
|
|
73
71
|
$has: boolean;
|
|
74
72
|
} | undefined;
|
|
75
|
-
severity?: import("..").FindingSeverity | undefined;
|
|
76
73
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
77
74
|
}>>;
|
|
78
75
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -91,7 +88,6 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
|
|
|
91
88
|
uid?: {
|
|
92
89
|
$has: boolean;
|
|
93
90
|
} | undefined;
|
|
94
|
-
severity?: import("..").FindingSeverity | undefined;
|
|
95
91
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
96
92
|
} | undefined;
|
|
97
93
|
}, {
|
|
@@ -110,7 +106,6 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
|
|
|
110
106
|
uid?: {
|
|
111
107
|
$has: boolean;
|
|
112
108
|
} | undefined;
|
|
113
|
-
severity?: import("..").FindingSeverity | undefined;
|
|
114
109
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
115
110
|
} | undefined;
|
|
116
111
|
}>>;
|
|
@@ -147,7 +142,6 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
|
|
|
147
142
|
uid?: {
|
|
148
143
|
$has: boolean;
|
|
149
144
|
} | undefined;
|
|
150
|
-
severity?: import("..").FindingSeverity | undefined;
|
|
151
145
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
152
146
|
} | undefined;
|
|
153
147
|
} | undefined;
|
|
@@ -183,7 +177,6 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
|
|
|
183
177
|
uid?: {
|
|
184
178
|
$has: boolean;
|
|
185
179
|
} | undefined;
|
|
186
|
-
severity?: import("..").FindingSeverity | undefined;
|
|
187
180
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
188
181
|
} | undefined;
|
|
189
182
|
} | undefined;
|
|
@@ -235,7 +228,6 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
|
|
|
235
228
|
}, {
|
|
236
229
|
$has: boolean;
|
|
237
230
|
}>>;
|
|
238
|
-
severity: z.ZodOptional<z.ZodNativeEnum<typeof import("..").FindingSeverity>>;
|
|
239
231
|
findingCondition: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>;
|
|
240
232
|
remediatedCondition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodNumber, z.ZodUndefined]>>>;
|
|
241
233
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -248,7 +240,6 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
|
|
|
248
240
|
uid?: {
|
|
249
241
|
$has: boolean;
|
|
250
242
|
} | undefined;
|
|
251
|
-
severity?: import("..").FindingSeverity | undefined;
|
|
252
243
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
253
244
|
}, {
|
|
254
245
|
kind: import("..").SaasComponentKind;
|
|
@@ -260,7 +251,6 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
|
|
|
260
251
|
uid?: {
|
|
261
252
|
$has: boolean;
|
|
262
253
|
} | undefined;
|
|
263
|
-
severity?: import("..").FindingSeverity | undefined;
|
|
264
254
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
265
255
|
}>>;
|
|
266
256
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -279,7 +269,6 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
|
|
|
279
269
|
uid?: {
|
|
280
270
|
$has: boolean;
|
|
281
271
|
} | undefined;
|
|
282
|
-
severity?: import("..").FindingSeverity | undefined;
|
|
283
272
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
284
273
|
} | undefined;
|
|
285
274
|
}, {
|
|
@@ -298,7 +287,6 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
|
|
|
298
287
|
uid?: {
|
|
299
288
|
$has: boolean;
|
|
300
289
|
} | undefined;
|
|
301
|
-
severity?: import("..").FindingSeverity | undefined;
|
|
302
290
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
303
291
|
} | undefined;
|
|
304
292
|
}>>;
|
|
@@ -335,7 +323,6 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
|
|
|
335
323
|
uid?: {
|
|
336
324
|
$has: boolean;
|
|
337
325
|
} | undefined;
|
|
338
|
-
severity?: import("..").FindingSeverity | undefined;
|
|
339
326
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
340
327
|
} | undefined;
|
|
341
328
|
} | undefined;
|
|
@@ -371,7 +358,6 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
|
|
|
371
358
|
uid?: {
|
|
372
359
|
$has: boolean;
|
|
373
360
|
} | undefined;
|
|
374
|
-
severity?: import("..").FindingSeverity | undefined;
|
|
375
361
|
remediatedCondition?: Record<string, string | number | boolean | undefined> | undefined;
|
|
376
362
|
} | undefined;
|
|
377
363
|
} | undefined;
|
|
@@ -57,18 +57,18 @@ export type ContentOptions = {
|
|
|
57
57
|
declare const _BackendContent: z.ZodObject<{
|
|
58
58
|
key: z.ZodString;
|
|
59
59
|
value: z.ZodString;
|
|
60
|
-
serviceFilter: z.ZodArray<z.ZodString, "many"
|
|
61
|
-
useCaseFilter: z.ZodArray<z.ZodString, "many"
|
|
60
|
+
serviceFilter: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
61
|
+
useCaseFilter: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
62
62
|
}, "strip", z.ZodTypeAny, {
|
|
63
63
|
value: string;
|
|
64
64
|
key: string;
|
|
65
|
-
serviceFilter
|
|
66
|
-
useCaseFilter
|
|
65
|
+
serviceFilter?: string[] | undefined;
|
|
66
|
+
useCaseFilter?: string[] | undefined;
|
|
67
67
|
}, {
|
|
68
68
|
value: string;
|
|
69
69
|
key: string;
|
|
70
|
-
serviceFilter
|
|
71
|
-
useCaseFilter
|
|
70
|
+
serviceFilter?: string[] | undefined;
|
|
71
|
+
useCaseFilter?: string[] | undefined;
|
|
72
72
|
}>;
|
|
73
73
|
export type BackendContent = z.infer<typeof _BackendContent>;
|
|
74
74
|
declare const _ServiceProfile: z.ZodObject<{
|
|
@@ -278,13 +278,14 @@ export declare class ContentService {
|
|
|
278
278
|
getI18nRichContent: (options?: ContentOptions) => Promise<I18nRichContent[]>;
|
|
279
279
|
static instance(): ContentService;
|
|
280
280
|
}
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
declare class KeyedContentService<T> {
|
|
282
|
+
readonly kind: string;
|
|
283
|
+
private readonly fetchFunction;
|
|
283
284
|
private content;
|
|
284
285
|
private isInitialized;
|
|
285
|
-
|
|
286
|
-
init: () => Promise<
|
|
287
|
-
refresh: () => Promise<
|
|
286
|
+
protected constructor(kind: string, fetchFunction: () => Promise<T[]>);
|
|
287
|
+
init: () => Promise<KeyedContentService<T>>;
|
|
288
|
+
refresh: () => Promise<KeyedContentService<T>>;
|
|
288
289
|
/**
|
|
289
290
|
* Example Usage:
|
|
290
291
|
* ```ts
|
|
@@ -313,6 +314,22 @@ export declare class I18nContentService {
|
|
|
313
314
|
* @returns
|
|
314
315
|
*/
|
|
315
316
|
getLookupFunction: () => (key: string, defaultValue?: string) => string;
|
|
317
|
+
}
|
|
318
|
+
export declare class BackendContentService extends KeyedContentService<BackendContent> {
|
|
319
|
+
private static _instance;
|
|
320
|
+
static instance(_options?: {
|
|
321
|
+
locale?: 'en';
|
|
322
|
+
useCaseFilter?: string | string[];
|
|
323
|
+
}): BackendContentService;
|
|
324
|
+
}
|
|
325
|
+
export declare class RichI18nContentService extends KeyedContentService<I18nRichContent> {
|
|
326
|
+
private static _instance;
|
|
327
|
+
static instance(_options?: {
|
|
328
|
+
locale?: 'en';
|
|
329
|
+
useCaseFilter?: string | string[];
|
|
330
|
+
}): RichI18nContentService;
|
|
331
|
+
}
|
|
332
|
+
export declare class I18nContentService extends KeyedContentService<I18nContent> {
|
|
316
333
|
private static _instance;
|
|
317
334
|
static instance(_options?: {
|
|
318
335
|
locale?: 'en';
|
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.I18nContentService = exports.ContentService = exports.ContentType = exports.ContentfulService = void 0;
|
|
29
|
+
exports.I18nContentService = exports.RichI18nContentService = exports.BackendContentService = exports.ContentService = exports.ContentType = exports.ContentfulService = void 0;
|
|
30
30
|
const zod_1 = require("zod");
|
|
31
31
|
const contentful = __importStar(require("contentful"));
|
|
32
32
|
const lodash_1 = __importDefault(require("lodash"));
|
|
@@ -102,8 +102,8 @@ const ContentfulRichText = zod_1.z.any();
|
|
|
102
102
|
const _BackendContent = zod_1.z.object({
|
|
103
103
|
key: zod_1.z.string(),
|
|
104
104
|
value: zod_1.z.string(),
|
|
105
|
-
serviceFilter: zod_1.z.array(zod_1.z.string()),
|
|
106
|
-
useCaseFilter: zod_1.z.array(zod_1.z.string()),
|
|
105
|
+
serviceFilter: zod_1.z.array(zod_1.z.string()).optional(),
|
|
106
|
+
useCaseFilter: zod_1.z.array(zod_1.z.string()).optional(),
|
|
107
107
|
});
|
|
108
108
|
const _ServiceProfile = zod_1.z.object({
|
|
109
109
|
serviceKey: zod_1.z.string(),
|
|
@@ -231,13 +231,14 @@ class ContentService {
|
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
exports.ContentService = ContentService;
|
|
234
|
-
class
|
|
235
|
-
constructor(
|
|
236
|
-
this.
|
|
234
|
+
class KeyedContentService {
|
|
235
|
+
constructor(kind, fetchFunction) {
|
|
236
|
+
this.kind = kind;
|
|
237
|
+
this.fetchFunction = fetchFunction;
|
|
237
238
|
this.content = {};
|
|
238
239
|
this.init = async () => this.isInitialized;
|
|
239
240
|
this.refresh = async () => {
|
|
240
|
-
const content = await this.
|
|
241
|
+
const content = await this.fetchFunction();
|
|
241
242
|
this.content = lodash_1.default.keyBy(content, 'key');
|
|
242
243
|
return this;
|
|
243
244
|
};
|
|
@@ -272,13 +273,36 @@ class I18nContentService {
|
|
|
272
273
|
*/
|
|
273
274
|
this.getLookupFunction = () => this.g;
|
|
274
275
|
this.isInitialized = this.refresh().then(service => {
|
|
275
|
-
console.debug(
|
|
276
|
+
console.debug(`${kind} initialized`);
|
|
276
277
|
return service;
|
|
277
278
|
});
|
|
278
279
|
}
|
|
280
|
+
}
|
|
281
|
+
class BackendContentService extends KeyedContentService {
|
|
282
|
+
static instance(_options) {
|
|
283
|
+
if (!BackendContentService._instance) {
|
|
284
|
+
const contentService = ContentService.instance();
|
|
285
|
+
BackendContentService._instance = new BackendContentService('BackendContent', () => contentService.getBackendContent());
|
|
286
|
+
}
|
|
287
|
+
return BackendContentService._instance;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
exports.BackendContentService = BackendContentService;
|
|
291
|
+
class RichI18nContentService extends KeyedContentService {
|
|
292
|
+
static instance(_options) {
|
|
293
|
+
if (!RichI18nContentService._instance) {
|
|
294
|
+
const contentService = ContentService.instance();
|
|
295
|
+
RichI18nContentService._instance = new RichI18nContentService('I18nRichContent', () => contentService.getBackendContent());
|
|
296
|
+
}
|
|
297
|
+
return RichI18nContentService._instance;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
exports.RichI18nContentService = RichI18nContentService;
|
|
301
|
+
class I18nContentService extends KeyedContentService {
|
|
279
302
|
static instance(_options) {
|
|
280
303
|
if (!I18nContentService._instance) {
|
|
281
|
-
|
|
304
|
+
const contentService = ContentService.instance();
|
|
305
|
+
I18nContentService._instance = new I18nContentService('I18nContent', () => contentService.getBackendContent());
|
|
282
306
|
}
|
|
283
307
|
return I18nContentService._instance;
|
|
284
308
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentful.service.js","sourceRoot":"","sources":["../../../src/services/contentful.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAsB;AAEtB,uDAAyC;AACzC,oDAAuB;AAevB;;;;;;;;;;;IAWI;AACJ,MAAa,iBAAiB;IAE5B;;;;;;;OAOG;IACH;QAWA,wBAAmB,GAAG,KAAK,IAA+C,EAAE;YAC1E,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAkB,iBAAiB,EAAE,CAAC,CAAC,CAAC;YAChG,OAAO,gBAAgB,CAAC;QAC1B,CAAC,CAAC;QAEF,yBAAoB,GAAG,KAAK,EAA+B,WAAmB,EAAE,OAAgB,EAAE,IAAa,EAAE,KAAc,EAA+B,EAAE;YAC9J,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,C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B,SAAQ,mBAAoC;IAE9E,MAAM,CAAC,QAAQ,CAAC,QAA6D;QAC3E,IAAI,CAAC,sBAAsB,CAAC,SAAS,EAAE,CAAC;YACtC,MAAM,cAAc,GAAG,cAAc,CAAC,QAAQ,EAAE,CAAC;YACjD,sBAAsB,CAAC,SAAS,GAAG,IAAI,sBAAsB,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAC7H,CAAC;QACD,OAAO,sBAAsB,CAAC,SAAS,CAAC;IAC1C,CAAC;CACF;AATD,wDASC;AAED,MAAa,kBAAmB,SAAQ,mBAAgC;IAEtE,MAAM,CAAC,QAAQ,CAAC,QAA6D;QAC3E,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,CAAC;YAClC,MAAM,cAAc,GAAG,cAAc,CAAC,QAAQ,EAAE,CAAC;YACjD,kBAAkB,CAAC,SAAS,GAAG,IAAI,kBAAkB,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC,CAAC;QACjH,CAAC;QACD,OAAO,kBAAkB,CAAC,SAAS,CAAC;IACtC,CAAC;CACF;AATD,gDASC"}
|
package/package.json
CHANGED
package/src/dto/findings.dto.ts
CHANGED
|
@@ -86,7 +86,6 @@ const _FindingSpecInsights = z.object({
|
|
|
86
86
|
$has: z.boolean(),
|
|
87
87
|
})
|
|
88
88
|
.optional(),
|
|
89
|
-
severity: z.nativeEnum(FindingSeverity).optional(),
|
|
90
89
|
findingCondition: z.record(z.string(), z.union([z.boolean(), z.string(), z.number(), z.undefined()])),
|
|
91
90
|
remediatedCondition: z.record(z.string(), z.union([z.boolean(), z.string(), z.number(), z.undefined()])).optional(),
|
|
92
91
|
})
|
|
@@ -98,8 +98,8 @@ export type ContentOptions = {
|
|
|
98
98
|
const _BackendContent = z.object({
|
|
99
99
|
key: z.string(),
|
|
100
100
|
value: z.string(),
|
|
101
|
-
serviceFilter: z.array(z.string()),
|
|
102
|
-
useCaseFilter: z.array(z.string()),
|
|
101
|
+
serviceFilter: z.array(z.string()).optional(),
|
|
102
|
+
useCaseFilter: z.array(z.string()).optional(),
|
|
103
103
|
});
|
|
104
104
|
export type BackendContent = z.infer<typeof _BackendContent>;
|
|
105
105
|
|
|
@@ -259,20 +259,23 @@ export class ContentService {
|
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
|
|
263
|
-
private content = {} as Record<string,
|
|
264
|
-
private isInitialized: Promise<
|
|
265
|
-
|
|
262
|
+
class KeyedContentService<T> {
|
|
263
|
+
private content = {} as Record<string, T>;
|
|
264
|
+
private isInitialized: Promise<KeyedContentService<T>>;
|
|
265
|
+
protected constructor(
|
|
266
|
+
public readonly kind: string,
|
|
267
|
+
private readonly fetchFunction: () => Promise<T[]>
|
|
268
|
+
) {
|
|
266
269
|
this.isInitialized = this.refresh().then(service => {
|
|
267
|
-
console.debug(
|
|
270
|
+
console.debug(`${kind} initialized`);
|
|
268
271
|
return service;
|
|
269
272
|
});
|
|
270
273
|
}
|
|
271
274
|
|
|
272
|
-
init = async (): Promise<
|
|
275
|
+
init = async (): Promise<KeyedContentService<T>> => this.isInitialized;
|
|
273
276
|
|
|
274
|
-
refresh = async (): Promise<
|
|
275
|
-
const content = await this.
|
|
277
|
+
refresh = async (): Promise<KeyedContentService<T>> => {
|
|
278
|
+
const content = await this.fetchFunction();
|
|
276
279
|
this.content = _.keyBy(content, 'key');
|
|
277
280
|
return this;
|
|
278
281
|
};
|
|
@@ -308,11 +311,36 @@ export class I18nContentService {
|
|
|
308
311
|
* @returns
|
|
309
312
|
*/
|
|
310
313
|
getLookupFunction = () => this.g;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export class BackendContentService extends KeyedContentService<BackendContent> {
|
|
317
|
+
private static _instance: BackendContentService | undefined;
|
|
318
|
+
static instance(_options?: {locale?: 'en'; useCaseFilter?: string | string[]}) {
|
|
319
|
+
if (!BackendContentService._instance) {
|
|
320
|
+
const contentService = ContentService.instance();
|
|
321
|
+
BackendContentService._instance = new BackendContentService('BackendContent', () => contentService.getBackendContent());
|
|
322
|
+
}
|
|
323
|
+
return BackendContentService._instance;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export class RichI18nContentService extends KeyedContentService<I18nRichContent> {
|
|
328
|
+
private static _instance: RichI18nContentService | undefined;
|
|
329
|
+
static instance(_options?: {locale?: 'en'; useCaseFilter?: string | string[]}) {
|
|
330
|
+
if (!RichI18nContentService._instance) {
|
|
331
|
+
const contentService = ContentService.instance();
|
|
332
|
+
RichI18nContentService._instance = new RichI18nContentService('I18nRichContent', () => contentService.getBackendContent());
|
|
333
|
+
}
|
|
334
|
+
return RichI18nContentService._instance;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
311
337
|
|
|
338
|
+
export class I18nContentService extends KeyedContentService<I18nContent> {
|
|
312
339
|
private static _instance: I18nContentService | undefined;
|
|
313
340
|
static instance(_options?: {locale?: 'en'; useCaseFilter?: string | string[]}) {
|
|
314
341
|
if (!I18nContentService._instance) {
|
|
315
|
-
|
|
342
|
+
const contentService = ContentService.instance();
|
|
343
|
+
I18nContentService._instance = new I18nContentService('I18nContent', () => contentService.getBackendContent());
|
|
316
344
|
}
|
|
317
345
|
return I18nContentService._instance;
|
|
318
346
|
}
|