@quba/sensitive-data-protection 0.0.4 → 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.mjs CHANGED
@@ -263,96 +263,96 @@ var TextApiResponse = class {
263
263
  };
264
264
 
265
265
  //#endregion
266
- //#region src/models/Targets.ts
266
+ //#region src/models/Entities.ts
267
267
  /**
268
- * Check if a given object implements the Targets interface.
268
+ * Check if a given object implements the Entities interface.
269
269
  */
270
- function instanceOfTargets(value) {
270
+ function instanceOfEntities(value) {
271
271
  return true;
272
272
  }
273
- function TargetsFromJSON(json) {
274
- return TargetsFromJSONTyped(json, false);
273
+ function EntitiesFromJSON(json) {
274
+ return EntitiesFromJSONTyped(json, false);
275
275
  }
276
- function TargetsFromJSONTyped(json, ignoreDiscriminator) {
276
+ function EntitiesFromJSONTyped(json, ignoreDiscriminator) {
277
277
  return json;
278
278
  }
279
- function TargetsToJSON(json) {
280
- return TargetsToJSONTyped(json, false);
279
+ function EntitiesToJSON(json) {
280
+ return EntitiesToJSONTyped(json, false);
281
281
  }
282
- function TargetsToJSONTyped(value, ignoreDiscriminator = false) {
282
+ function EntitiesToJSONTyped(value, ignoreDiscriminator = false) {
283
283
  return value;
284
284
  }
285
285
 
286
286
  //#endregion
287
- //#region src/models/EncryptTransformation.ts
287
+ //#region src/models/EncryptRule.ts
288
288
  /**
289
289
  * @export
290
290
  */
291
- const EncryptTransformationIdEnum = { encrypt: "encrypt" };
291
+ const EncryptRuleTypeEnum = { encrypt: "encrypt" };
292
292
  /**
293
- * Check if a given object implements the EncryptTransformation interface.
293
+ * Check if a given object implements the EncryptRule interface.
294
294
  */
295
- function instanceOfEncryptTransformation(value) {
296
- if (!("targets" in value) || value["targets"] === void 0) return false;
295
+ function instanceOfEncryptRule(value) {
296
+ if (!("entities" in value) || value["entities"] === void 0) return false;
297
297
  return true;
298
298
  }
299
- function EncryptTransformationFromJSON(json) {
300
- return EncryptTransformationFromJSONTyped(json, false);
299
+ function EncryptRuleFromJSON(json) {
300
+ return EncryptRuleFromJSONTyped(json, false);
301
301
  }
302
- function EncryptTransformationFromJSONTyped(json, ignoreDiscriminator) {
302
+ function EncryptRuleFromJSONTyped(json, ignoreDiscriminator) {
303
303
  if (json == null) return json;
304
304
  return {
305
- "id": json["id"] == null ? void 0 : json["id"],
306
- "targets": TargetsFromJSON(json["targets"]),
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 EncryptTransformationToJSON(json) {
311
- return EncryptTransformationToJSONTyped(json, false);
310
+ function EncryptRuleToJSON(json) {
311
+ return EncryptRuleToJSONTyped(json, false);
312
312
  }
313
- function EncryptTransformationToJSONTyped(value, ignoreDiscriminator = false) {
313
+ function EncryptRuleToJSONTyped(value, ignoreDiscriminator = false) {
314
314
  if (value == null) return value;
315
315
  return {
316
- "id": value["id"],
317
- "targets": TargetsToJSON(value["targets"]),
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/MaskTransformation.ts
323
+ //#region src/models/MaskRule.ts
324
324
  /**
325
325
  * @export
326
326
  */
327
- const MaskTransformationIdEnum = { mask: "mask" };
327
+ const MaskRuleTypeEnum = { mask: "mask" };
328
328
  /**
329
- * Check if a given object implements the MaskTransformation interface.
329
+ * Check if a given object implements the MaskRule interface.
330
330
  */
331
- function instanceOfMaskTransformation(value) {
332
- if (!("targets" in value) || value["targets"] === void 0) return false;
331
+ function instanceOfMaskRule(value) {
332
+ if (!("entities" in value) || value["entities"] === void 0) return false;
333
333
  return true;
334
334
  }
335
- function MaskTransformationFromJSON(json) {
336
- return MaskTransformationFromJSONTyped(json, false);
335
+ function MaskRuleFromJSON(json) {
336
+ return MaskRuleFromJSONTyped(json, false);
337
337
  }
338
- function MaskTransformationFromJSONTyped(json, ignoreDiscriminator) {
338
+ function MaskRuleFromJSONTyped(json, ignoreDiscriminator) {
339
339
  if (json == null) return json;
340
340
  return {
341
- "id": json["id"] == null ? void 0 : json["id"],
342
- "targets": TargetsFromJSON(json["targets"]),
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 MaskTransformationToJSON(json) {
349
- return MaskTransformationToJSONTyped(json, false);
348
+ function MaskRuleToJSON(json) {
349
+ return MaskRuleToJSONTyped(json, false);
350
350
  }
351
- function MaskTransformationToJSONTyped(value, ignoreDiscriminator = false) {
351
+ function MaskRuleToJSONTyped(value, ignoreDiscriminator = false) {
352
352
  if (value == null) return value;
353
353
  return {
354
- "id": value["id"],
355
- "targets": TargetsToJSON(value["targets"]),
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/RedactTransformation.ts
363
+ //#region src/models/RedactRule.ts
364
364
  /**
365
365
  * @export
366
366
  */
367
- const RedactTransformationIdEnum = { redact: "redact" };
367
+ const RedactRuleTypeEnum = { redact: "redact" };
368
368
  /**
369
- * Check if a given object implements the RedactTransformation interface.
369
+ * Check if a given object implements the RedactRule interface.
370
370
  */
371
- function instanceOfRedactTransformation(value) {
372
- if (!("targets" in value) || value["targets"] === void 0) return false;
371
+ function instanceOfRedactRule(value) {
372
+ if (!("entities" in value) || value["entities"] === void 0) return false;
373
373
  return true;
374
374
  }
375
- function RedactTransformationFromJSON(json) {
376
- return RedactTransformationFromJSONTyped(json, false);
375
+ function RedactRuleFromJSON(json) {
376
+ return RedactRuleFromJSONTyped(json, false);
377
377
  }
378
- function RedactTransformationFromJSONTyped(json, ignoreDiscriminator) {
378
+ function RedactRuleFromJSONTyped(json, ignoreDiscriminator) {
379
379
  if (json == null) return json;
380
380
  return {
381
- "id": json["id"] == null ? void 0 : json["id"],
382
- "targets": TargetsFromJSON(json["targets"])
381
+ "type": json["type"] == null ? void 0 : json["type"],
382
+ "entities": EntitiesFromJSON(json["entities"])
383
383
  };
384
384
  }
385
- function RedactTransformationToJSON(json) {
386
- return RedactTransformationToJSONTyped(json, false);
385
+ function RedactRuleToJSON(json) {
386
+ return RedactRuleToJSONTyped(json, false);
387
387
  }
388
- function RedactTransformationToJSONTyped(value, ignoreDiscriminator = false) {
388
+ function RedactRuleToJSONTyped(value, ignoreDiscriminator = false) {
389
389
  if (value == null) return value;
390
390
  return {
391
- "id": value["id"],
392
- "targets": TargetsToJSON(value["targets"])
391
+ "type": value["type"],
392
+ "entities": EntitiesToJSON(value["entities"])
393
393
  };
394
394
  }
395
395
 
396
396
  //#endregion
397
- //#region src/models/ReplaceTransformation.ts
397
+ //#region src/models/ReplaceRule.ts
398
398
  /**
399
399
  * @export
400
400
  */
401
- const ReplaceTransformationIdEnum = { replace: "replace" };
401
+ const ReplaceRuleTypeEnum = { replace: "replace" };
402
402
  /**
403
- * Check if a given object implements the ReplaceTransformation interface.
403
+ * Check if a given object implements the ReplaceRule interface.
404
404
  */
405
- function instanceOfReplaceTransformation(value) {
406
- if (!("targets" in value) || value["targets"] === void 0) return false;
405
+ function instanceOfReplaceRule(value) {
406
+ if (!("entities" in value) || value["entities"] === void 0) return false;
407
407
  return true;
408
408
  }
409
- function ReplaceTransformationFromJSON(json) {
410
- return ReplaceTransformationFromJSONTyped(json, false);
409
+ function ReplaceRuleFromJSON(json) {
410
+ return ReplaceRuleFromJSONTyped(json, false);
411
411
  }
412
- function ReplaceTransformationFromJSONTyped(json, ignoreDiscriminator) {
412
+ function ReplaceRuleFromJSONTyped(json, ignoreDiscriminator) {
413
413
  if (json == null) return json;
414
414
  return {
415
- "id": json["id"] == null ? void 0 : json["id"],
416
- "targets": TargetsFromJSON(json["targets"]),
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 ReplaceTransformationToJSON(json) {
421
- return ReplaceTransformationToJSONTyped(json, false);
420
+ function ReplaceRuleToJSON(json) {
421
+ return ReplaceRuleToJSONTyped(json, false);
422
422
  }
423
- function ReplaceTransformationToJSONTyped(value, ignoreDiscriminator = false) {
423
+ function ReplaceRuleToJSONTyped(value, ignoreDiscriminator = false) {
424
424
  if (value == null) return value;
425
425
  return {
426
- "id": value["id"],
427
- "targets": TargetsToJSON(value["targets"]),
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/SHA256Transformation.ts
433
+ //#region src/models/SHA256Rule.ts
434
434
  /**
435
435
  * @export
436
436
  */
437
- const SHA256TransformationIdEnum = { sha256: "sha256" };
437
+ const SHA256RuleTypeEnum = { sha256: "sha256" };
438
438
  /**
439
- * Check if a given object implements the SHA256Transformation interface.
439
+ * Check if a given object implements the SHA256Rule interface.
440
440
  */
441
- function instanceOfSHA256Transformation(value) {
442
- if (!("targets" in value) || value["targets"] === void 0) return false;
441
+ function instanceOfSHA256Rule(value) {
442
+ if (!("entities" in value) || value["entities"] === void 0) return false;
443
443
  return true;
444
444
  }
445
- function SHA256TransformationFromJSON(json) {
446
- return SHA256TransformationFromJSONTyped(json, false);
445
+ function SHA256RuleFromJSON(json) {
446
+ return SHA256RuleFromJSONTyped(json, false);
447
447
  }
448
- function SHA256TransformationFromJSONTyped(json, ignoreDiscriminator) {
448
+ function SHA256RuleFromJSONTyped(json, ignoreDiscriminator) {
449
449
  if (json == null) return json;
450
450
  return {
451
- "id": json["id"] == null ? void 0 : json["id"],
452
- "targets": TargetsFromJSON(json["targets"])
451
+ "type": json["type"] == null ? void 0 : json["type"],
452
+ "entities": EntitiesFromJSON(json["entities"])
453
453
  };
454
454
  }
455
- function SHA256TransformationToJSON(json) {
456
- return SHA256TransformationToJSONTyped(json, false);
455
+ function SHA256RuleToJSON(json) {
456
+ return SHA256RuleToJSONTyped(json, false);
457
457
  }
458
- function SHA256TransformationToJSONTyped(value, ignoreDiscriminator = false) {
458
+ function SHA256RuleToJSONTyped(value, ignoreDiscriminator = false) {
459
459
  if (value == null) return value;
460
460
  return {
461
- "id": value["id"],
462
- "targets": TargetsToJSON(value["targets"])
461
+ "type": value["type"],
462
+ "entities": EntitiesToJSON(value["entities"])
463
463
  };
464
464
  }
465
465
 
466
466
  //#endregion
467
- //#region src/models/SHA512Transformation.ts
467
+ //#region src/models/SHA512Rule.ts
468
468
  /**
469
469
  * @export
470
470
  */
471
- const SHA512TransformationIdEnum = { sha512: "sha512" };
471
+ const SHA512RuleTypeEnum = { sha512: "sha512" };
472
472
  /**
473
- * Check if a given object implements the SHA512Transformation interface.
473
+ * Check if a given object implements the SHA512Rule interface.
474
474
  */
475
- function instanceOfSHA512Transformation(value) {
476
- if (!("targets" in value) || value["targets"] === void 0) return false;
475
+ function instanceOfSHA512Rule(value) {
476
+ if (!("entities" in value) || value["entities"] === void 0) return false;
477
477
  return true;
478
478
  }
479
- function SHA512TransformationFromJSON(json) {
480
- return SHA512TransformationFromJSONTyped(json, false);
479
+ function SHA512RuleFromJSON(json) {
480
+ return SHA512RuleFromJSONTyped(json, false);
481
481
  }
482
- function SHA512TransformationFromJSONTyped(json, ignoreDiscriminator) {
482
+ function SHA512RuleFromJSONTyped(json, ignoreDiscriminator) {
483
483
  if (json == null) return json;
484
484
  return {
485
- "id": json["id"] == null ? void 0 : json["id"],
486
- "targets": TargetsFromJSON(json["targets"])
485
+ "type": json["type"] == null ? void 0 : json["type"],
486
+ "entities": EntitiesFromJSON(json["entities"])
487
487
  };
488
488
  }
489
- function SHA512TransformationToJSON(json) {
490
- return SHA512TransformationToJSONTyped(json, false);
489
+ function SHA512RuleToJSON(json) {
490
+ return SHA512RuleToJSONTyped(json, false);
491
491
  }
492
- function SHA512TransformationToJSONTyped(value, ignoreDiscriminator = false) {
492
+ function SHA512RuleToJSONTyped(value, ignoreDiscriminator = false) {
493
493
  if (value == null) return value;
494
494
  return {
495
- "id": value["id"],
496
- "targets": TargetsToJSON(value["targets"])
495
+ "type": value["type"],
496
+ "entities": EntitiesToJSON(value["entities"])
497
497
  };
498
498
  }
499
499
 
500
500
  //#endregion
501
- //#region src/models/AnonymizeRequestBodyTransformationsInner.ts
502
- function AnonymizeRequestBodyTransformationsInnerFromJSON(json) {
503
- return AnonymizeRequestBodyTransformationsInnerFromJSONTyped(json, false);
501
+ //#region src/models/AnonymizeRequestBodyRulesInner.ts
502
+ function AnonymizeRequestBodyRulesInnerFromJSON(json) {
503
+ return AnonymizeRequestBodyRulesInnerFromJSONTyped(json, false);
504
504
  }
505
- function AnonymizeRequestBodyTransformationsInnerFromJSONTyped(json, ignoreDiscriminator) {
505
+ function AnonymizeRequestBodyRulesInnerFromJSONTyped(json, ignoreDiscriminator) {
506
506
  if (json == null) return json;
507
- switch (json["id"]) {
508
- case "encrypt": return Object.assign({}, EncryptTransformationFromJSONTyped(json, true), { id: "encrypt" });
509
- case "mask": return Object.assign({}, MaskTransformationFromJSONTyped(json, true), { id: "mask" });
510
- case "redact": return Object.assign({}, RedactTransformationFromJSONTyped(json, true), { id: "redact" });
511
- case "replace": return Object.assign({}, ReplaceTransformationFromJSONTyped(json, true), { id: "replace" });
512
- case "sha256": return Object.assign({}, SHA256TransformationFromJSONTyped(json, true), { id: "sha256" });
513
- case "sha512": return Object.assign({}, SHA512TransformationFromJSONTyped(json, true), { id: "sha512" });
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 AnonymizeRequestBodyTransformationsInnerToJSON(json) {
518
- return AnonymizeRequestBodyTransformationsInnerToJSONTyped(json, false);
517
+ function AnonymizeRequestBodyRulesInnerToJSON(json) {
518
+ return AnonymizeRequestBodyRulesInnerToJSONTyped(json, false);
519
519
  }
520
- function AnonymizeRequestBodyTransformationsInnerToJSONTyped(value, ignoreDiscriminator = false) {
520
+ function AnonymizeRequestBodyRulesInnerToJSONTyped(value, ignoreDiscriminator = false) {
521
521
  if (value == null) return value;
522
- switch (value["id"]) {
523
- case "encrypt": return Object.assign({}, EncryptTransformationToJSON(value), { id: "encrypt" });
524
- case "mask": return Object.assign({}, MaskTransformationToJSON(value), { id: "mask" });
525
- case "redact": return Object.assign({}, RedactTransformationToJSON(value), { id: "redact" });
526
- case "replace": return Object.assign({}, ReplaceTransformationToJSON(value), { id: "replace" });
527
- case "sha256": return Object.assign({}, SHA256TransformationToJSON(value), { id: "sha256" });
528
- case "sha512": return Object.assign({}, SHA512TransformationToJSON(value), { id: "sha512" });
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 (!("transformations" in value) || value["transformations"] === void 0) return false;
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
- "transformations": json["transformations"].map(AnonymizeRequestBodyTransformationsInnerFromJSON)
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
- "transformations": value["transformations"].map(AnonymizeRequestBodyTransformationsInnerToJSON)
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/EntitySpanResult.ts
595
+ //#region src/models/ModelEntity.ts
596
596
  /**
597
597
  * @export
598
598
  */
599
- const EntitySpanResultTargetEnum = { entity: "entity" };
599
+ const ModelEntityTypeEnum = { model: "model" };
600
600
  /**
601
- * Check if a given object implements the EntitySpanResult interface.
601
+ * Check if a given object implements the ModelEntity interface.
602
602
  */
603
- function instanceOfEntitySpanResult(value) {
604
- if (!("start" in value) || value["start"] === void 0) return false;
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 EntitySpanResultFromJSON(json) {
611
- return EntitySpanResultFromJSONTyped(json, false);
607
+ function ModelEntityFromJSON(json) {
608
+ return ModelEntityFromJSONTyped(json, false);
612
609
  }
613
- function EntitySpanResultFromJSONTyped(json, ignoreDiscriminator) {
610
+ function ModelEntityFromJSONTyped(json, ignoreDiscriminator) {
614
611
  if (json == null) return json;
615
612
  return {
616
- "target": json["target"] == null ? void 0 : json["target"],
617
- "start": json["start"],
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 EntitySpanResultToJSON(json) {
625
- return EntitySpanResultToJSONTyped(json, false);
617
+ function ModelEntityToJSON(json) {
618
+ return ModelEntityToJSONTyped(json, false);
626
619
  }
627
- function EntitySpanResultToJSONTyped(value, ignoreDiscriminator = false) {
620
+ function ModelEntityToJSONTyped(value, ignoreDiscriminator = false) {
628
621
  if (value == null) return value;
629
622
  return {
630
- "target": value["target"],
631
- "start": value["start"],
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/EntityTarget.ts
629
+ //#region src/models/RegexEntity.ts
641
630
  /**
642
631
  * @export
643
632
  */
644
- const EntityTargetIdEnum = { entity: "entity" };
633
+ const RegexEntityTypeEnum = { regex: "regex" };
645
634
  /**
646
- * Check if a given object implements the EntityTarget interface.
635
+ * Check if a given object implements the RegexEntity interface.
647
636
  */
648
- function instanceOfEntityTarget(value) {
649
- if (!("entity_type" in value) || value["entity_type"] === void 0) return false;
637
+ function instanceOfRegexEntity(value) {
638
+ if (!("value" in value) || value["value"] === void 0) return false;
650
639
  return true;
651
640
  }
652
- function EntityTargetFromJSON(json) {
653
- return EntityTargetFromJSONTyped(json, false);
641
+ function RegexEntityFromJSON(json) {
642
+ return RegexEntityFromJSONTyped(json, false);
654
643
  }
655
- function EntityTargetFromJSONTyped(json, ignoreDiscriminator) {
644
+ function RegexEntityFromJSONTyped(json, ignoreDiscriminator) {
656
645
  if (json == null) return json;
657
646
  return {
658
- "id": json["id"] == null ? void 0 : json["id"],
659
- "entity_type": json["entity_type"]
647
+ "type": json["type"] == null ? void 0 : json["type"],
648
+ "value": json["value"]
660
649
  };
661
650
  }
662
- function EntityTargetToJSON(json) {
663
- return EntityTargetToJSONTyped(json, false);
651
+ function RegexEntityToJSON(json) {
652
+ return RegexEntityToJSONTyped(json, false);
664
653
  }
665
- function EntityTargetToJSONTyped(value, ignoreDiscriminator = false) {
654
+ function RegexEntityToJSONTyped(value, ignoreDiscriminator = false) {
666
655
  if (value == null) return value;
667
656
  return {
668
- "id": value["id"],
669
- "entity_type": value["entity_type"]
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/RegexSpanResult.ts
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 RegexSpanResultTargetEnum = { regex: "regex" };
815
+ const RegexSpanTypeEnum = { regex: "regex" };
757
816
  /**
758
- * Check if a given object implements the RegexSpanResult interface.
817
+ * Check if a given object implements the RegexSpan interface.
759
818
  */
760
- function instanceOfRegexSpanResult(value) {
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 (!("pattern" in value) || value["pattern"] === void 0) return false;
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 RegexSpanResultFromJSON(json) {
768
- return RegexSpanResultFromJSONTyped(json, false);
826
+ function RegexSpanFromJSON(json) {
827
+ return RegexSpanFromJSONTyped(json, false);
769
828
  }
770
- function RegexSpanResultFromJSONTyped(json, ignoreDiscriminator) {
829
+ function RegexSpanFromJSONTyped(json, ignoreDiscriminator) {
771
830
  if (json == null) return json;
772
831
  return {
773
- "target": json["target"] == null ? void 0 : json["target"],
832
+ "type": json["type"] == null ? void 0 : json["type"],
774
833
  "start": json["start"],
775
834
  "end": json["end"],
776
- "pattern": json["pattern"],
835
+ "value": json["value"],
777
836
  "text": json["text"]
778
837
  };
779
838
  }
780
- function RegexSpanResultToJSON(json) {
781
- return RegexSpanResultToJSONTyped(json, false);
839
+ function RegexSpanToJSON(json) {
840
+ return RegexSpanToJSONTyped(json, false);
782
841
  }
783
- function RegexSpanResultToJSONTyped(value, ignoreDiscriminator = false) {
842
+ function RegexSpanToJSONTyped(value, ignoreDiscriminator = false) {
784
843
  if (value == null) return value;
785
844
  return {
786
- "target": value["target"],
845
+ "type": value["type"],
787
846
  "start": value["start"],
788
847
  "end": value["end"],
789
- "pattern": value["pattern"],
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["target"]) {
802
- case "entity": return Object.assign({}, EntitySpanResultFromJSONTyped(json, true), { target: "entity" });
803
- case "regex": return Object.assign({}, RegexSpanResultFromJSONTyped(json, true), { target: "regex" });
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["target"]) {
813
- case "entity": return Object.assign({}, EntitySpanResultToJSON(value), { target: "entity" });
814
- case "regex": return Object.assign({}, RegexSpanResultToJSON(value), { target: "regex" });
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, AnonymizeRequestBodyToJSON, AnonymizeRequestBodyToJSONTyped, AnonymizeRequestBodyTransformationsInnerFromJSON, AnonymizeRequestBodyTransformationsInnerFromJSONTyped, AnonymizeRequestBodyTransformationsInnerToJSON, AnonymizeRequestBodyTransformationsInnerToJSONTyped, AnonymizeResponseBodyFromJSON, AnonymizeResponseBodyFromJSONTyped, AnonymizeResponseBodyToJSON, AnonymizeResponseBodyToJSONTyped, BASE_PATH, BaseAPI, BlobApiResponse, COLLECTION_FORMATS, Configuration, DefaultConfig, EncryptTransformationFromJSON, EncryptTransformationFromJSONTyped, EncryptTransformationIdEnum, EncryptTransformationToJSON, EncryptTransformationToJSONTyped, EntitySpanResultFromJSON, EntitySpanResultFromJSONTyped, EntitySpanResultTargetEnum, EntitySpanResultToJSON, EntitySpanResultToJSONTyped, EntityTargetFromJSON, EntityTargetFromJSONTyped, EntityTargetIdEnum, EntityTargetToJSON, EntityTargetToJSONTyped, FetchError, HTTPValidationErrorFromJSON, HTTPValidationErrorFromJSONTyped, HTTPValidationErrorToJSON, HTTPValidationErrorToJSONTyped, JSONApiResponse, MapValueInnerFromJSON, MapValueInnerFromJSONTyped, MapValueInnerToJSON, MapValueInnerToJSONTyped, MaskTransformationFromJSON, MaskTransformationFromJSONTyped, MaskTransformationIdEnum, MaskTransformationToJSON, MaskTransformationToJSONTyped, RedactTransformationFromJSON, RedactTransformationFromJSONTyped, RedactTransformationIdEnum, RedactTransformationToJSON, RedactTransformationToJSONTyped, RegexSpanResultFromJSON, RegexSpanResultFromJSONTyped, RegexSpanResultTargetEnum, RegexSpanResultToJSON, RegexSpanResultToJSONTyped, RegexTargetFromJSON, RegexTargetFromJSONTyped, RegexTargetIdEnum, RegexTargetToJSON, RegexTargetToJSONTyped, ReplaceTransformationFromJSON, ReplaceTransformationFromJSONTyped, ReplaceTransformationIdEnum, ReplaceTransformationToJSON, ReplaceTransformationToJSONTyped, RequiredError, ResponseError, SHA256TransformationFromJSON, SHA256TransformationFromJSONTyped, SHA256TransformationIdEnum, SHA256TransformationToJSON, SHA256TransformationToJSONTyped, SHA512TransformationFromJSON, SHA512TransformationFromJSONTyped, SHA512TransformationIdEnum, SHA512TransformationToJSON, SHA512TransformationToJSONTyped, ScanRequestBodyFromJSON, ScanRequestBodyFromJSONTyped, ScanRequestBodyToJSON, ScanRequestBodyToJSONTyped, ScanResponseBodyFromJSON, ScanResponseBodyFromJSONTyped, ScanResponseBodyToJSON, ScanResponseBodyToJSONTyped, ScanResultFromJSON, ScanResultFromJSONTyped, ScanResultToJSON, ScanResultToJSONTyped, SensitiveDataProtectionApi, TargetsAnyOfInnerFromJSON, TargetsAnyOfInnerFromJSONTyped, TargetsAnyOfInnerToJSON, TargetsAnyOfInnerToJSONTyped, TargetsFromJSON, TargetsFromJSONTyped, TargetsToJSON, TargetsToJSONTyped, TextApiResponse, ValidationErrorFromJSON, ValidationErrorFromJSONTyped, ValidationErrorLocInnerFromJSON, ValidationErrorLocInnerFromJSONTyped, ValidationErrorLocInnerToJSON, ValidationErrorLocInnerToJSONTyped, ValidationErrorToJSON, ValidationErrorToJSONTyped, VoidApiResponse, canConsumeForm, exists, instanceOfAnonymizeRequestBody, instanceOfAnonymizeResponseBody, instanceOfEncryptTransformation, instanceOfEntitySpanResult, instanceOfEntityTarget, instanceOfHTTPValidationError, instanceOfMaskTransformation, instanceOfRedactTransformation, instanceOfRegexSpanResult, instanceOfRegexTarget, instanceOfReplaceTransformation, instanceOfSHA256Transformation, instanceOfSHA512Transformation, instanceOfScanRequestBody, instanceOfScanResponseBody, instanceOfScanResult, instanceOfTargets, instanceOfValidationError, instanceOfValidationErrorLocInner, mapValues, querystring };
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 };