@quba/sensitive-data-protection 0.0.5 → 0.0.6
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/index.cjs +317 -317
- package/dist/index.d.cts +254 -254
- package/dist/index.d.mts +254 -254
- package/dist/index.mjs +245 -245
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -263,96 +263,96 @@ var TextApiResponse = class {
|
|
|
263
263
|
};
|
|
264
264
|
|
|
265
265
|
//#endregion
|
|
266
|
-
//#region src/models/
|
|
266
|
+
//#region src/models/Entities.ts
|
|
267
267
|
/**
|
|
268
|
-
* Check if a given object implements the
|
|
268
|
+
* Check if a given object implements the Entities interface.
|
|
269
269
|
*/
|
|
270
|
-
function
|
|
270
|
+
function instanceOfEntities(value) {
|
|
271
271
|
return true;
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
return
|
|
273
|
+
function EntitiesFromJSON(json) {
|
|
274
|
+
return EntitiesFromJSONTyped(json, false);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function EntitiesFromJSONTyped(json, ignoreDiscriminator) {
|
|
277
277
|
return json;
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
return
|
|
279
|
+
function EntitiesToJSON(json) {
|
|
280
|
+
return EntitiesToJSONTyped(json, false);
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function EntitiesToJSONTyped(value, ignoreDiscriminator = false) {
|
|
283
283
|
return value;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
//#endregion
|
|
287
|
-
//#region src/models/
|
|
287
|
+
//#region src/models/EncryptRule.ts
|
|
288
288
|
/**
|
|
289
289
|
* @export
|
|
290
290
|
*/
|
|
291
|
-
const
|
|
291
|
+
const EncryptRuleTypeEnum = { encrypt: "encrypt" };
|
|
292
292
|
/**
|
|
293
|
-
* Check if a given object implements the
|
|
293
|
+
* Check if a given object implements the EncryptRule interface.
|
|
294
294
|
*/
|
|
295
|
-
function
|
|
296
|
-
if (!("
|
|
295
|
+
function instanceOfEncryptRule(value) {
|
|
296
|
+
if (!("entities" in value) || value["entities"] === void 0) return false;
|
|
297
297
|
return true;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
return
|
|
299
|
+
function EncryptRuleFromJSON(json) {
|
|
300
|
+
return EncryptRuleFromJSONTyped(json, false);
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function EncryptRuleFromJSONTyped(json, ignoreDiscriminator) {
|
|
303
303
|
if (json == null) return json;
|
|
304
304
|
return {
|
|
305
|
-
"
|
|
306
|
-
"
|
|
305
|
+
"type": json["type"] == null ? void 0 : json["type"],
|
|
306
|
+
"entities": EntitiesFromJSON(json["entities"]),
|
|
307
307
|
"key": json["key"] == null ? void 0 : json["key"]
|
|
308
308
|
};
|
|
309
309
|
}
|
|
310
|
-
function
|
|
311
|
-
return
|
|
310
|
+
function EncryptRuleToJSON(json) {
|
|
311
|
+
return EncryptRuleToJSONTyped(json, false);
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function EncryptRuleToJSONTyped(value, ignoreDiscriminator = false) {
|
|
314
314
|
if (value == null) return value;
|
|
315
315
|
return {
|
|
316
|
-
"
|
|
317
|
-
"
|
|
316
|
+
"type": value["type"],
|
|
317
|
+
"entities": EntitiesToJSON(value["entities"]),
|
|
318
318
|
"key": value["key"]
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
//#endregion
|
|
323
|
-
//#region src/models/
|
|
323
|
+
//#region src/models/MaskRule.ts
|
|
324
324
|
/**
|
|
325
325
|
* @export
|
|
326
326
|
*/
|
|
327
|
-
const
|
|
327
|
+
const MaskRuleTypeEnum = { mask: "mask" };
|
|
328
328
|
/**
|
|
329
|
-
* Check if a given object implements the
|
|
329
|
+
* Check if a given object implements the MaskRule interface.
|
|
330
330
|
*/
|
|
331
|
-
function
|
|
332
|
-
if (!("
|
|
331
|
+
function instanceOfMaskRule(value) {
|
|
332
|
+
if (!("entities" in value) || value["entities"] === void 0) return false;
|
|
333
333
|
return true;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
return
|
|
335
|
+
function MaskRuleFromJSON(json) {
|
|
336
|
+
return MaskRuleFromJSONTyped(json, false);
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function MaskRuleFromJSONTyped(json, ignoreDiscriminator) {
|
|
339
339
|
if (json == null) return json;
|
|
340
340
|
return {
|
|
341
|
-
"
|
|
342
|
-
"
|
|
341
|
+
"type": json["type"] == null ? void 0 : json["type"],
|
|
342
|
+
"entities": EntitiesFromJSON(json["entities"]),
|
|
343
343
|
"masking_char": json["masking_char"] == null ? void 0 : json["masking_char"],
|
|
344
344
|
"chars_to_mask": json["chars_to_mask"] == null ? void 0 : json["chars_to_mask"],
|
|
345
345
|
"from_end": json["from_end"] == null ? void 0 : json["from_end"]
|
|
346
346
|
};
|
|
347
347
|
}
|
|
348
|
-
function
|
|
349
|
-
return
|
|
348
|
+
function MaskRuleToJSON(json) {
|
|
349
|
+
return MaskRuleToJSONTyped(json, false);
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function MaskRuleToJSONTyped(value, ignoreDiscriminator = false) {
|
|
352
352
|
if (value == null) return value;
|
|
353
353
|
return {
|
|
354
|
-
"
|
|
355
|
-
"
|
|
354
|
+
"type": value["type"],
|
|
355
|
+
"entities": EntitiesToJSON(value["entities"]),
|
|
356
356
|
"masking_char": value["masking_char"],
|
|
357
357
|
"chars_to_mask": value["chars_to_mask"],
|
|
358
358
|
"from_end": value["from_end"]
|
|
@@ -360,172 +360,172 @@ function MaskTransformationToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
360
360
|
}
|
|
361
361
|
|
|
362
362
|
//#endregion
|
|
363
|
-
//#region src/models/
|
|
363
|
+
//#region src/models/RedactRule.ts
|
|
364
364
|
/**
|
|
365
365
|
* @export
|
|
366
366
|
*/
|
|
367
|
-
const
|
|
367
|
+
const RedactRuleTypeEnum = { redact: "redact" };
|
|
368
368
|
/**
|
|
369
|
-
* Check if a given object implements the
|
|
369
|
+
* Check if a given object implements the RedactRule interface.
|
|
370
370
|
*/
|
|
371
|
-
function
|
|
372
|
-
if (!("
|
|
371
|
+
function instanceOfRedactRule(value) {
|
|
372
|
+
if (!("entities" in value) || value["entities"] === void 0) return false;
|
|
373
373
|
return true;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
return
|
|
375
|
+
function RedactRuleFromJSON(json) {
|
|
376
|
+
return RedactRuleFromJSONTyped(json, false);
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function RedactRuleFromJSONTyped(json, ignoreDiscriminator) {
|
|
379
379
|
if (json == null) return json;
|
|
380
380
|
return {
|
|
381
|
-
"
|
|
382
|
-
"
|
|
381
|
+
"type": json["type"] == null ? void 0 : json["type"],
|
|
382
|
+
"entities": EntitiesFromJSON(json["entities"])
|
|
383
383
|
};
|
|
384
384
|
}
|
|
385
|
-
function
|
|
386
|
-
return
|
|
385
|
+
function RedactRuleToJSON(json) {
|
|
386
|
+
return RedactRuleToJSONTyped(json, false);
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function RedactRuleToJSONTyped(value, ignoreDiscriminator = false) {
|
|
389
389
|
if (value == null) return value;
|
|
390
390
|
return {
|
|
391
|
-
"
|
|
392
|
-
"
|
|
391
|
+
"type": value["type"],
|
|
392
|
+
"entities": EntitiesToJSON(value["entities"])
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
//#endregion
|
|
397
|
-
//#region src/models/
|
|
397
|
+
//#region src/models/ReplaceRule.ts
|
|
398
398
|
/**
|
|
399
399
|
* @export
|
|
400
400
|
*/
|
|
401
|
-
const
|
|
401
|
+
const ReplaceRuleTypeEnum = { replace: "replace" };
|
|
402
402
|
/**
|
|
403
|
-
* Check if a given object implements the
|
|
403
|
+
* Check if a given object implements the ReplaceRule interface.
|
|
404
404
|
*/
|
|
405
|
-
function
|
|
406
|
-
if (!("
|
|
405
|
+
function instanceOfReplaceRule(value) {
|
|
406
|
+
if (!("entities" in value) || value["entities"] === void 0) return false;
|
|
407
407
|
return true;
|
|
408
408
|
}
|
|
409
|
-
function
|
|
410
|
-
return
|
|
409
|
+
function ReplaceRuleFromJSON(json) {
|
|
410
|
+
return ReplaceRuleFromJSONTyped(json, false);
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function ReplaceRuleFromJSONTyped(json, ignoreDiscriminator) {
|
|
413
413
|
if (json == null) return json;
|
|
414
414
|
return {
|
|
415
|
-
"
|
|
416
|
-
"
|
|
415
|
+
"type": json["type"] == null ? void 0 : json["type"],
|
|
416
|
+
"entities": EntitiesFromJSON(json["entities"]),
|
|
417
417
|
"replacement": json["replacement"] == null ? void 0 : json["replacement"]
|
|
418
418
|
};
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
return
|
|
420
|
+
function ReplaceRuleToJSON(json) {
|
|
421
|
+
return ReplaceRuleToJSONTyped(json, false);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function ReplaceRuleToJSONTyped(value, ignoreDiscriminator = false) {
|
|
424
424
|
if (value == null) return value;
|
|
425
425
|
return {
|
|
426
|
-
"
|
|
427
|
-
"
|
|
426
|
+
"type": value["type"],
|
|
427
|
+
"entities": EntitiesToJSON(value["entities"]),
|
|
428
428
|
"replacement": value["replacement"]
|
|
429
429
|
};
|
|
430
430
|
}
|
|
431
431
|
|
|
432
432
|
//#endregion
|
|
433
|
-
//#region src/models/
|
|
433
|
+
//#region src/models/SHA256Rule.ts
|
|
434
434
|
/**
|
|
435
435
|
* @export
|
|
436
436
|
*/
|
|
437
|
-
const
|
|
437
|
+
const SHA256RuleTypeEnum = { sha256: "sha256" };
|
|
438
438
|
/**
|
|
439
|
-
* Check if a given object implements the
|
|
439
|
+
* Check if a given object implements the SHA256Rule interface.
|
|
440
440
|
*/
|
|
441
|
-
function
|
|
442
|
-
if (!("
|
|
441
|
+
function instanceOfSHA256Rule(value) {
|
|
442
|
+
if (!("entities" in value) || value["entities"] === void 0) return false;
|
|
443
443
|
return true;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
return
|
|
445
|
+
function SHA256RuleFromJSON(json) {
|
|
446
|
+
return SHA256RuleFromJSONTyped(json, false);
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function SHA256RuleFromJSONTyped(json, ignoreDiscriminator) {
|
|
449
449
|
if (json == null) return json;
|
|
450
450
|
return {
|
|
451
|
-
"
|
|
452
|
-
"
|
|
451
|
+
"type": json["type"] == null ? void 0 : json["type"],
|
|
452
|
+
"entities": EntitiesFromJSON(json["entities"])
|
|
453
453
|
};
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
return
|
|
455
|
+
function SHA256RuleToJSON(json) {
|
|
456
|
+
return SHA256RuleToJSONTyped(json, false);
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function SHA256RuleToJSONTyped(value, ignoreDiscriminator = false) {
|
|
459
459
|
if (value == null) return value;
|
|
460
460
|
return {
|
|
461
|
-
"
|
|
462
|
-
"
|
|
461
|
+
"type": value["type"],
|
|
462
|
+
"entities": EntitiesToJSON(value["entities"])
|
|
463
463
|
};
|
|
464
464
|
}
|
|
465
465
|
|
|
466
466
|
//#endregion
|
|
467
|
-
//#region src/models/
|
|
467
|
+
//#region src/models/SHA512Rule.ts
|
|
468
468
|
/**
|
|
469
469
|
* @export
|
|
470
470
|
*/
|
|
471
|
-
const
|
|
471
|
+
const SHA512RuleTypeEnum = { sha512: "sha512" };
|
|
472
472
|
/**
|
|
473
|
-
* Check if a given object implements the
|
|
473
|
+
* Check if a given object implements the SHA512Rule interface.
|
|
474
474
|
*/
|
|
475
|
-
function
|
|
476
|
-
if (!("
|
|
475
|
+
function instanceOfSHA512Rule(value) {
|
|
476
|
+
if (!("entities" in value) || value["entities"] === void 0) return false;
|
|
477
477
|
return true;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
480
|
-
return
|
|
479
|
+
function SHA512RuleFromJSON(json) {
|
|
480
|
+
return SHA512RuleFromJSONTyped(json, false);
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function SHA512RuleFromJSONTyped(json, ignoreDiscriminator) {
|
|
483
483
|
if (json == null) return json;
|
|
484
484
|
return {
|
|
485
|
-
"
|
|
486
|
-
"
|
|
485
|
+
"type": json["type"] == null ? void 0 : json["type"],
|
|
486
|
+
"entities": EntitiesFromJSON(json["entities"])
|
|
487
487
|
};
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
return
|
|
489
|
+
function SHA512RuleToJSON(json) {
|
|
490
|
+
return SHA512RuleToJSONTyped(json, false);
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function SHA512RuleToJSONTyped(value, ignoreDiscriminator = false) {
|
|
493
493
|
if (value == null) return value;
|
|
494
494
|
return {
|
|
495
|
-
"
|
|
496
|
-
"
|
|
495
|
+
"type": value["type"],
|
|
496
|
+
"entities": EntitiesToJSON(value["entities"])
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
499
|
|
|
500
500
|
//#endregion
|
|
501
|
-
//#region src/models/
|
|
502
|
-
function
|
|
503
|
-
return
|
|
501
|
+
//#region src/models/AnonymizeRequestBodyRulesInner.ts
|
|
502
|
+
function AnonymizeRequestBodyRulesInnerFromJSON(json) {
|
|
503
|
+
return AnonymizeRequestBodyRulesInnerFromJSONTyped(json, false);
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function AnonymizeRequestBodyRulesInnerFromJSONTyped(json, ignoreDiscriminator) {
|
|
506
506
|
if (json == null) return json;
|
|
507
|
-
switch (json["
|
|
508
|
-
case "encrypt": return Object.assign({},
|
|
509
|
-
case "mask": return Object.assign({},
|
|
510
|
-
case "redact": return Object.assign({},
|
|
511
|
-
case "replace": return Object.assign({},
|
|
512
|
-
case "sha256": return Object.assign({},
|
|
513
|
-
case "sha512": return Object.assign({},
|
|
507
|
+
switch (json["type"]) {
|
|
508
|
+
case "encrypt": return Object.assign({}, EncryptRuleFromJSONTyped(json, true), { type: "encrypt" });
|
|
509
|
+
case "mask": return Object.assign({}, MaskRuleFromJSONTyped(json, true), { type: "mask" });
|
|
510
|
+
case "redact": return Object.assign({}, RedactRuleFromJSONTyped(json, true), { type: "redact" });
|
|
511
|
+
case "replace": return Object.assign({}, ReplaceRuleFromJSONTyped(json, true), { type: "replace" });
|
|
512
|
+
case "sha256": return Object.assign({}, SHA256RuleFromJSONTyped(json, true), { type: "sha256" });
|
|
513
|
+
case "sha512": return Object.assign({}, SHA512RuleFromJSONTyped(json, true), { type: "sha512" });
|
|
514
514
|
default: return json;
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
return
|
|
517
|
+
function AnonymizeRequestBodyRulesInnerToJSON(json) {
|
|
518
|
+
return AnonymizeRequestBodyRulesInnerToJSONTyped(json, false);
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function AnonymizeRequestBodyRulesInnerToJSONTyped(value, ignoreDiscriminator = false) {
|
|
521
521
|
if (value == null) return value;
|
|
522
|
-
switch (value["
|
|
523
|
-
case "encrypt": return Object.assign({},
|
|
524
|
-
case "mask": return Object.assign({},
|
|
525
|
-
case "redact": return Object.assign({},
|
|
526
|
-
case "replace": return Object.assign({},
|
|
527
|
-
case "sha256": return Object.assign({},
|
|
528
|
-
case "sha512": return Object.assign({},
|
|
522
|
+
switch (value["type"]) {
|
|
523
|
+
case "encrypt": return Object.assign({}, EncryptRuleToJSON(value), { type: "encrypt" });
|
|
524
|
+
case "mask": return Object.assign({}, MaskRuleToJSON(value), { type: "mask" });
|
|
525
|
+
case "redact": return Object.assign({}, RedactRuleToJSON(value), { type: "redact" });
|
|
526
|
+
case "replace": return Object.assign({}, ReplaceRuleToJSON(value), { type: "replace" });
|
|
527
|
+
case "sha256": return Object.assign({}, SHA256RuleToJSON(value), { type: "sha256" });
|
|
528
|
+
case "sha512": return Object.assign({}, SHA512RuleToJSON(value), { type: "sha512" });
|
|
529
529
|
default: return value;
|
|
530
530
|
}
|
|
531
531
|
}
|
|
@@ -537,7 +537,7 @@ function AnonymizeRequestBodyTransformationsInnerToJSONTyped(value, ignoreDiscri
|
|
|
537
537
|
*/
|
|
538
538
|
function instanceOfAnonymizeRequestBody(value) {
|
|
539
539
|
if (!("text" in value) || value["text"] === void 0) return false;
|
|
540
|
-
if (!("
|
|
540
|
+
if (!("rules" in value) || value["rules"] === void 0) return false;
|
|
541
541
|
return true;
|
|
542
542
|
}
|
|
543
543
|
function AnonymizeRequestBodyFromJSON(json) {
|
|
@@ -547,7 +547,7 @@ function AnonymizeRequestBodyFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
547
547
|
if (json == null) return json;
|
|
548
548
|
return {
|
|
549
549
|
"text": json["text"],
|
|
550
|
-
"
|
|
550
|
+
"rules": json["rules"].map(AnonymizeRequestBodyRulesInnerFromJSON)
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
553
|
function AnonymizeRequestBodyToJSON(json) {
|
|
@@ -557,7 +557,7 @@ function AnonymizeRequestBodyToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
557
557
|
if (value == null) return value;
|
|
558
558
|
return {
|
|
559
559
|
"text": value["text"],
|
|
560
|
-
"
|
|
560
|
+
"rules": value["rules"].map(AnonymizeRequestBodyRulesInnerToJSON)
|
|
561
561
|
};
|
|
562
562
|
}
|
|
563
563
|
|
|
@@ -592,84 +592,98 @@ function AnonymizeResponseBodyToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
592
592
|
}
|
|
593
593
|
|
|
594
594
|
//#endregion
|
|
595
|
-
//#region src/models/
|
|
595
|
+
//#region src/models/ModelEntity.ts
|
|
596
596
|
/**
|
|
597
597
|
* @export
|
|
598
598
|
*/
|
|
599
|
-
const
|
|
599
|
+
const ModelEntityTypeEnum = { model: "model" };
|
|
600
600
|
/**
|
|
601
|
-
* Check if a given object implements the
|
|
601
|
+
* Check if a given object implements the ModelEntity interface.
|
|
602
602
|
*/
|
|
603
|
-
function
|
|
604
|
-
if (!("
|
|
605
|
-
if (!("end" in value) || value["end"] === void 0) return false;
|
|
606
|
-
if (!("entity_type" in value) || value["entity_type"] === void 0) return false;
|
|
607
|
-
if (!("text" in value) || value["text"] === void 0) return false;
|
|
603
|
+
function instanceOfModelEntity(value) {
|
|
604
|
+
if (!("value" in value) || value["value"] === void 0) return false;
|
|
608
605
|
return true;
|
|
609
606
|
}
|
|
610
|
-
function
|
|
611
|
-
return
|
|
607
|
+
function ModelEntityFromJSON(json) {
|
|
608
|
+
return ModelEntityFromJSONTyped(json, false);
|
|
612
609
|
}
|
|
613
|
-
function
|
|
610
|
+
function ModelEntityFromJSONTyped(json, ignoreDiscriminator) {
|
|
614
611
|
if (json == null) return json;
|
|
615
612
|
return {
|
|
616
|
-
"
|
|
617
|
-
"
|
|
618
|
-
"end": json["end"],
|
|
619
|
-
"entity_type": json["entity_type"],
|
|
620
|
-
"text": json["text"],
|
|
621
|
-
"score": json["score"] == null ? void 0 : json["score"]
|
|
613
|
+
"type": json["type"] == null ? void 0 : json["type"],
|
|
614
|
+
"value": json["value"]
|
|
622
615
|
};
|
|
623
616
|
}
|
|
624
|
-
function
|
|
625
|
-
return
|
|
617
|
+
function ModelEntityToJSON(json) {
|
|
618
|
+
return ModelEntityToJSONTyped(json, false);
|
|
626
619
|
}
|
|
627
|
-
function
|
|
620
|
+
function ModelEntityToJSONTyped(value, ignoreDiscriminator = false) {
|
|
628
621
|
if (value == null) return value;
|
|
629
622
|
return {
|
|
630
|
-
"
|
|
631
|
-
"
|
|
632
|
-
"end": value["end"],
|
|
633
|
-
"entity_type": value["entity_type"],
|
|
634
|
-
"text": value["text"],
|
|
635
|
-
"score": value["score"]
|
|
623
|
+
"type": value["type"],
|
|
624
|
+
"value": value["value"]
|
|
636
625
|
};
|
|
637
626
|
}
|
|
638
627
|
|
|
639
628
|
//#endregion
|
|
640
|
-
//#region src/models/
|
|
629
|
+
//#region src/models/RegexEntity.ts
|
|
641
630
|
/**
|
|
642
631
|
* @export
|
|
643
632
|
*/
|
|
644
|
-
const
|
|
633
|
+
const RegexEntityTypeEnum = { regex: "regex" };
|
|
645
634
|
/**
|
|
646
|
-
* Check if a given object implements the
|
|
635
|
+
* Check if a given object implements the RegexEntity interface.
|
|
647
636
|
*/
|
|
648
|
-
function
|
|
649
|
-
if (!("
|
|
637
|
+
function instanceOfRegexEntity(value) {
|
|
638
|
+
if (!("value" in value) || value["value"] === void 0) return false;
|
|
650
639
|
return true;
|
|
651
640
|
}
|
|
652
|
-
function
|
|
653
|
-
return
|
|
641
|
+
function RegexEntityFromJSON(json) {
|
|
642
|
+
return RegexEntityFromJSONTyped(json, false);
|
|
654
643
|
}
|
|
655
|
-
function
|
|
644
|
+
function RegexEntityFromJSONTyped(json, ignoreDiscriminator) {
|
|
656
645
|
if (json == null) return json;
|
|
657
646
|
return {
|
|
658
|
-
"
|
|
659
|
-
"
|
|
647
|
+
"type": json["type"] == null ? void 0 : json["type"],
|
|
648
|
+
"value": json["value"]
|
|
660
649
|
};
|
|
661
650
|
}
|
|
662
|
-
function
|
|
663
|
-
return
|
|
651
|
+
function RegexEntityToJSON(json) {
|
|
652
|
+
return RegexEntityToJSONTyped(json, false);
|
|
664
653
|
}
|
|
665
|
-
function
|
|
654
|
+
function RegexEntityToJSONTyped(value, ignoreDiscriminator = false) {
|
|
666
655
|
if (value == null) return value;
|
|
667
656
|
return {
|
|
668
|
-
"
|
|
669
|
-
"
|
|
657
|
+
"type": value["type"],
|
|
658
|
+
"value": value["value"]
|
|
670
659
|
};
|
|
671
660
|
}
|
|
672
661
|
|
|
662
|
+
//#endregion
|
|
663
|
+
//#region src/models/EntitiesAnyOfInner.ts
|
|
664
|
+
function EntitiesAnyOfInnerFromJSON(json) {
|
|
665
|
+
return EntitiesAnyOfInnerFromJSONTyped(json, false);
|
|
666
|
+
}
|
|
667
|
+
function EntitiesAnyOfInnerFromJSONTyped(json, ignoreDiscriminator) {
|
|
668
|
+
if (json == null) return json;
|
|
669
|
+
switch (json["type"]) {
|
|
670
|
+
case "model": return Object.assign({}, ModelEntityFromJSONTyped(json, true), { type: "model" });
|
|
671
|
+
case "regex": return Object.assign({}, RegexEntityFromJSONTyped(json, true), { type: "regex" });
|
|
672
|
+
default: return json;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
function EntitiesAnyOfInnerToJSON(json) {
|
|
676
|
+
return EntitiesAnyOfInnerToJSONTyped(json, false);
|
|
677
|
+
}
|
|
678
|
+
function EntitiesAnyOfInnerToJSONTyped(value, ignoreDiscriminator = false) {
|
|
679
|
+
if (value == null) return value;
|
|
680
|
+
switch (value["type"]) {
|
|
681
|
+
case "model": return Object.assign({}, ModelEntityToJSON(value), { type: "model" });
|
|
682
|
+
case "regex": return Object.assign({}, RegexEntityToJSON(value), { type: "regex" });
|
|
683
|
+
default: return value;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
673
687
|
//#endregion
|
|
674
688
|
//#region src/models/ValidationErrorLocInner.ts
|
|
675
689
|
/**
|
|
@@ -749,44 +763,89 @@ function HTTPValidationErrorToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
749
763
|
}
|
|
750
764
|
|
|
751
765
|
//#endregion
|
|
752
|
-
//#region src/models/
|
|
766
|
+
//#region src/models/ModelSpan.ts
|
|
767
|
+
/**
|
|
768
|
+
* @export
|
|
769
|
+
*/
|
|
770
|
+
const ModelSpanTypeEnum = { model: "model" };
|
|
771
|
+
/**
|
|
772
|
+
* Check if a given object implements the ModelSpan interface.
|
|
773
|
+
*/
|
|
774
|
+
function instanceOfModelSpan(value) {
|
|
775
|
+
if (!("start" in value) || value["start"] === void 0) return false;
|
|
776
|
+
if (!("end" in value) || value["end"] === void 0) return false;
|
|
777
|
+
if (!("value" in value) || value["value"] === void 0) return false;
|
|
778
|
+
if (!("text" in value) || value["text"] === void 0) return false;
|
|
779
|
+
return true;
|
|
780
|
+
}
|
|
781
|
+
function ModelSpanFromJSON(json) {
|
|
782
|
+
return ModelSpanFromJSONTyped(json, false);
|
|
783
|
+
}
|
|
784
|
+
function ModelSpanFromJSONTyped(json, ignoreDiscriminator) {
|
|
785
|
+
if (json == null) return json;
|
|
786
|
+
return {
|
|
787
|
+
"type": json["type"] == null ? void 0 : json["type"],
|
|
788
|
+
"start": json["start"],
|
|
789
|
+
"end": json["end"],
|
|
790
|
+
"value": json["value"],
|
|
791
|
+
"text": json["text"],
|
|
792
|
+
"score": json["score"] == null ? void 0 : json["score"]
|
|
793
|
+
};
|
|
794
|
+
}
|
|
795
|
+
function ModelSpanToJSON(json) {
|
|
796
|
+
return ModelSpanToJSONTyped(json, false);
|
|
797
|
+
}
|
|
798
|
+
function ModelSpanToJSONTyped(value, ignoreDiscriminator = false) {
|
|
799
|
+
if (value == null) return value;
|
|
800
|
+
return {
|
|
801
|
+
"type": value["type"],
|
|
802
|
+
"start": value["start"],
|
|
803
|
+
"end": value["end"],
|
|
804
|
+
"value": value["value"],
|
|
805
|
+
"text": value["text"],
|
|
806
|
+
"score": value["score"]
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
//#endregion
|
|
811
|
+
//#region src/models/RegexSpan.ts
|
|
753
812
|
/**
|
|
754
813
|
* @export
|
|
755
814
|
*/
|
|
756
|
-
const
|
|
815
|
+
const RegexSpanTypeEnum = { regex: "regex" };
|
|
757
816
|
/**
|
|
758
|
-
* Check if a given object implements the
|
|
817
|
+
* Check if a given object implements the RegexSpan interface.
|
|
759
818
|
*/
|
|
760
|
-
function
|
|
819
|
+
function instanceOfRegexSpan(value) {
|
|
761
820
|
if (!("start" in value) || value["start"] === void 0) return false;
|
|
762
821
|
if (!("end" in value) || value["end"] === void 0) return false;
|
|
763
|
-
if (!("
|
|
822
|
+
if (!("value" in value) || value["value"] === void 0) return false;
|
|
764
823
|
if (!("text" in value) || value["text"] === void 0) return false;
|
|
765
824
|
return true;
|
|
766
825
|
}
|
|
767
|
-
function
|
|
768
|
-
return
|
|
826
|
+
function RegexSpanFromJSON(json) {
|
|
827
|
+
return RegexSpanFromJSONTyped(json, false);
|
|
769
828
|
}
|
|
770
|
-
function
|
|
829
|
+
function RegexSpanFromJSONTyped(json, ignoreDiscriminator) {
|
|
771
830
|
if (json == null) return json;
|
|
772
831
|
return {
|
|
773
|
-
"
|
|
832
|
+
"type": json["type"] == null ? void 0 : json["type"],
|
|
774
833
|
"start": json["start"],
|
|
775
834
|
"end": json["end"],
|
|
776
|
-
"
|
|
835
|
+
"value": json["value"],
|
|
777
836
|
"text": json["text"]
|
|
778
837
|
};
|
|
779
838
|
}
|
|
780
|
-
function
|
|
781
|
-
return
|
|
839
|
+
function RegexSpanToJSON(json) {
|
|
840
|
+
return RegexSpanToJSONTyped(json, false);
|
|
782
841
|
}
|
|
783
|
-
function
|
|
842
|
+
function RegexSpanToJSONTyped(value, ignoreDiscriminator = false) {
|
|
784
843
|
if (value == null) return value;
|
|
785
844
|
return {
|
|
786
|
-
"
|
|
845
|
+
"type": value["type"],
|
|
787
846
|
"start": value["start"],
|
|
788
847
|
"end": value["end"],
|
|
789
|
-
"
|
|
848
|
+
"value": value["value"],
|
|
790
849
|
"text": value["text"]
|
|
791
850
|
};
|
|
792
851
|
}
|
|
@@ -798,9 +857,9 @@ function MapValueInnerFromJSON(json) {
|
|
|
798
857
|
}
|
|
799
858
|
function MapValueInnerFromJSONTyped(json, ignoreDiscriminator) {
|
|
800
859
|
if (json == null) return json;
|
|
801
|
-
switch (json["
|
|
802
|
-
case "
|
|
803
|
-
case "regex": return Object.assign({},
|
|
860
|
+
switch (json["type"]) {
|
|
861
|
+
case "model": return Object.assign({}, ModelSpanFromJSONTyped(json, true), { type: "model" });
|
|
862
|
+
case "regex": return Object.assign({}, RegexSpanFromJSONTyped(json, true), { type: "regex" });
|
|
804
863
|
default: return json;
|
|
805
864
|
}
|
|
806
865
|
}
|
|
@@ -809,47 +868,13 @@ function MapValueInnerToJSON(json) {
|
|
|
809
868
|
}
|
|
810
869
|
function MapValueInnerToJSONTyped(value, ignoreDiscriminator = false) {
|
|
811
870
|
if (value == null) return value;
|
|
812
|
-
switch (value["
|
|
813
|
-
case "
|
|
814
|
-
case "regex": return Object.assign({},
|
|
871
|
+
switch (value["type"]) {
|
|
872
|
+
case "model": return Object.assign({}, ModelSpanToJSON(value), { type: "model" });
|
|
873
|
+
case "regex": return Object.assign({}, RegexSpanToJSON(value), { type: "regex" });
|
|
815
874
|
default: return value;
|
|
816
875
|
}
|
|
817
876
|
}
|
|
818
877
|
|
|
819
|
-
//#endregion
|
|
820
|
-
//#region src/models/RegexTarget.ts
|
|
821
|
-
/**
|
|
822
|
-
* @export
|
|
823
|
-
*/
|
|
824
|
-
const RegexTargetIdEnum = { regex: "regex" };
|
|
825
|
-
/**
|
|
826
|
-
* Check if a given object implements the RegexTarget interface.
|
|
827
|
-
*/
|
|
828
|
-
function instanceOfRegexTarget(value) {
|
|
829
|
-
if (!("pattern" in value) || value["pattern"] === void 0) return false;
|
|
830
|
-
return true;
|
|
831
|
-
}
|
|
832
|
-
function RegexTargetFromJSON(json) {
|
|
833
|
-
return RegexTargetFromJSONTyped(json, false);
|
|
834
|
-
}
|
|
835
|
-
function RegexTargetFromJSONTyped(json, ignoreDiscriminator) {
|
|
836
|
-
if (json == null) return json;
|
|
837
|
-
return {
|
|
838
|
-
"id": json["id"] == null ? void 0 : json["id"],
|
|
839
|
-
"pattern": json["pattern"]
|
|
840
|
-
};
|
|
841
|
-
}
|
|
842
|
-
function RegexTargetToJSON(json) {
|
|
843
|
-
return RegexTargetToJSONTyped(json, false);
|
|
844
|
-
}
|
|
845
|
-
function RegexTargetToJSONTyped(value, ignoreDiscriminator = false) {
|
|
846
|
-
if (value == null) return value;
|
|
847
|
-
return {
|
|
848
|
-
"id": value["id"],
|
|
849
|
-
"pattern": value["pattern"]
|
|
850
|
-
};
|
|
851
|
-
}
|
|
852
|
-
|
|
853
878
|
//#endregion
|
|
854
879
|
//#region src/models/ScanRequestBody.ts
|
|
855
880
|
/**
|
|
@@ -945,31 +970,6 @@ function ScanResponseBodyToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
945
970
|
return { "results": value["results"].map(ScanResultToJSON) };
|
|
946
971
|
}
|
|
947
972
|
|
|
948
|
-
//#endregion
|
|
949
|
-
//#region src/models/TargetsAnyOfInner.ts
|
|
950
|
-
function TargetsAnyOfInnerFromJSON(json) {
|
|
951
|
-
return TargetsAnyOfInnerFromJSONTyped(json, false);
|
|
952
|
-
}
|
|
953
|
-
function TargetsAnyOfInnerFromJSONTyped(json, ignoreDiscriminator) {
|
|
954
|
-
if (json == null) return json;
|
|
955
|
-
switch (json["id"]) {
|
|
956
|
-
case "entity": return Object.assign({}, EntityTargetFromJSONTyped(json, true), { id: "entity" });
|
|
957
|
-
case "regex": return Object.assign({}, RegexTargetFromJSONTyped(json, true), { id: "regex" });
|
|
958
|
-
default: return json;
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
function TargetsAnyOfInnerToJSON(json) {
|
|
962
|
-
return TargetsAnyOfInnerToJSONTyped(json, false);
|
|
963
|
-
}
|
|
964
|
-
function TargetsAnyOfInnerToJSONTyped(value, ignoreDiscriminator = false) {
|
|
965
|
-
if (value == null) return value;
|
|
966
|
-
switch (value["id"]) {
|
|
967
|
-
case "entity": return Object.assign({}, EntityTargetToJSON(value), { id: "entity" });
|
|
968
|
-
case "regex": return Object.assign({}, RegexTargetToJSON(value), { id: "regex" });
|
|
969
|
-
default: return value;
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
|
|
973
973
|
//#endregion
|
|
974
974
|
//#region src/apis/SensitiveDataProtectionApi.ts
|
|
975
975
|
/**
|
|
@@ -1061,4 +1061,4 @@ var SensitiveDataProtectionApi = class extends BaseAPI {
|
|
|
1061
1061
|
};
|
|
1062
1062
|
|
|
1063
1063
|
//#endregion
|
|
1064
|
-
export { AnonymizeRequestBodyFromJSON, AnonymizeRequestBodyFromJSONTyped,
|
|
1064
|
+
export { AnonymizeRequestBodyFromJSON, AnonymizeRequestBodyFromJSONTyped, AnonymizeRequestBodyRulesInnerFromJSON, AnonymizeRequestBodyRulesInnerFromJSONTyped, AnonymizeRequestBodyRulesInnerToJSON, AnonymizeRequestBodyRulesInnerToJSONTyped, AnonymizeRequestBodyToJSON, AnonymizeRequestBodyToJSONTyped, AnonymizeResponseBodyFromJSON, AnonymizeResponseBodyFromJSONTyped, AnonymizeResponseBodyToJSON, AnonymizeResponseBodyToJSONTyped, BASE_PATH, BaseAPI, BlobApiResponse, COLLECTION_FORMATS, Configuration, DefaultConfig, EncryptRuleFromJSON, EncryptRuleFromJSONTyped, EncryptRuleToJSON, EncryptRuleToJSONTyped, EncryptRuleTypeEnum, EntitiesAnyOfInnerFromJSON, EntitiesAnyOfInnerFromJSONTyped, EntitiesAnyOfInnerToJSON, EntitiesAnyOfInnerToJSONTyped, EntitiesFromJSON, EntitiesFromJSONTyped, EntitiesToJSON, EntitiesToJSONTyped, FetchError, HTTPValidationErrorFromJSON, HTTPValidationErrorFromJSONTyped, HTTPValidationErrorToJSON, HTTPValidationErrorToJSONTyped, JSONApiResponse, MapValueInnerFromJSON, MapValueInnerFromJSONTyped, MapValueInnerToJSON, MapValueInnerToJSONTyped, MaskRuleFromJSON, MaskRuleFromJSONTyped, MaskRuleToJSON, MaskRuleToJSONTyped, MaskRuleTypeEnum, ModelEntityFromJSON, ModelEntityFromJSONTyped, ModelEntityToJSON, ModelEntityToJSONTyped, ModelEntityTypeEnum, ModelSpanFromJSON, ModelSpanFromJSONTyped, ModelSpanToJSON, ModelSpanToJSONTyped, ModelSpanTypeEnum, RedactRuleFromJSON, RedactRuleFromJSONTyped, RedactRuleToJSON, RedactRuleToJSONTyped, RedactRuleTypeEnum, RegexEntityFromJSON, RegexEntityFromJSONTyped, RegexEntityToJSON, RegexEntityToJSONTyped, RegexEntityTypeEnum, RegexSpanFromJSON, RegexSpanFromJSONTyped, RegexSpanToJSON, RegexSpanToJSONTyped, RegexSpanTypeEnum, ReplaceRuleFromJSON, ReplaceRuleFromJSONTyped, ReplaceRuleToJSON, ReplaceRuleToJSONTyped, ReplaceRuleTypeEnum, RequiredError, ResponseError, SHA256RuleFromJSON, SHA256RuleFromJSONTyped, SHA256RuleToJSON, SHA256RuleToJSONTyped, SHA256RuleTypeEnum, SHA512RuleFromJSON, SHA512RuleFromJSONTyped, SHA512RuleToJSON, SHA512RuleToJSONTyped, SHA512RuleTypeEnum, ScanRequestBodyFromJSON, ScanRequestBodyFromJSONTyped, ScanRequestBodyToJSON, ScanRequestBodyToJSONTyped, ScanResponseBodyFromJSON, ScanResponseBodyFromJSONTyped, ScanResponseBodyToJSON, ScanResponseBodyToJSONTyped, ScanResultFromJSON, ScanResultFromJSONTyped, ScanResultToJSON, ScanResultToJSONTyped, SensitiveDataProtectionApi, TextApiResponse, ValidationErrorFromJSON, ValidationErrorFromJSONTyped, ValidationErrorLocInnerFromJSON, ValidationErrorLocInnerFromJSONTyped, ValidationErrorLocInnerToJSON, ValidationErrorLocInnerToJSONTyped, ValidationErrorToJSON, ValidationErrorToJSONTyped, VoidApiResponse, canConsumeForm, exists, instanceOfAnonymizeRequestBody, instanceOfAnonymizeResponseBody, instanceOfEncryptRule, instanceOfEntities, instanceOfHTTPValidationError, instanceOfMaskRule, instanceOfModelEntity, instanceOfModelSpan, instanceOfRedactRule, instanceOfRegexEntity, instanceOfRegexSpan, instanceOfReplaceRule, instanceOfSHA256Rule, instanceOfSHA512Rule, instanceOfScanRequestBody, instanceOfScanResponseBody, instanceOfScanResult, instanceOfValidationError, instanceOfValidationErrorLocInner, mapValues, querystring };
|