@cognigy/rest-api-client
Version:
Cognigy REST-Client
142 lines • 4.55 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.piiDataRedactionSettingsSchema = exports.customPatternSettingsSchema = exports.piiFieldSettingsSchema = exports.EPiiBehaviorType = void 0;
var EPiiBehaviorType;
(function (EPiiBehaviorType) {
EPiiBehaviorType["PREDEFINED_ALIAS"] = "predefined-alias";
EPiiBehaviorType["CUSTOM_ALIAS"] = "custom-alias";
})(EPiiBehaviorType = exports.EPiiBehaviorType || (exports.EPiiBehaviorType = {}));
exports.piiFieldSettingsSchema = {
title: "piiFieldSettingsSchema",
type: "object",
additionalProperties: false,
required: ["enabled", "name"],
properties: {
enabled: { type: "boolean" },
behavior: {
oneOf: [
{
type: "object",
additionalProperties: false,
required: ["type"],
properties: {
type: {
type: "string",
enum: [EPiiBehaviorType.PREDEFINED_ALIAS],
},
customAlias: { type: "null" },
},
},
{
type: "object",
additionalProperties: false,
// @ts-ignore
required: ["type", "customAlias"],
properties: {
type: {
type: "string",
enum: [EPiiBehaviorType.CUSTOM_ALIAS],
},
customAlias: {
type: "string",
minLength: 3,
maxLength: 100
},
},
},
],
},
scope: {
type: ["object", "null"],
additionalProperties: false,
required: ["logs", "analytics"],
properties: {
logs: { type: "boolean" },
analytics: { type: "boolean" },
},
},
name: { type: "string", minLength: 3, maxLength: 100, pattern: "^[a-zA-Z0-9_\\s]+$" },
},
if: {
properties: {
enabled: { const: true }
}
},
then: {
required: ["enabled", "name", "behavior", "scope"]
},
else: {
required: ["enabled", "name"]
}
};
exports.customPatternSettingsSchema = {
title: "customPatternSettingsSchema",
type: "object",
additionalProperties: false,
required: ["name", "regex", "behavior", "scope"],
properties: {
regex: {
type: "string",
minLength: 1,
maxLength: 1000
},
behavior: {
type: "object",
additionalProperties: false,
// @ts-ignore
required: ["type", "customAlias"],
properties: {
type: {
type: "string",
enum: [EPiiBehaviorType.CUSTOM_ALIAS],
},
customAlias: {
type: "string",
minLength: 3,
maxLength: 100
},
},
},
scope: {
type: ["object", "null"],
additionalProperties: false,
required: ["logs", "analytics"],
properties: {
logs: { type: "boolean" },
analytics: { type: "boolean" },
},
},
name: {
type: "string",
minLength: 3,
maxLength: 100,
pattern: "^[a-zA-Z0-9_\\s]+$"
},
},
};
exports.piiDataRedactionSettingsSchema = {
title: "piiDataRedactionSettingsSchema",
type: "object",
additionalProperties: false,
required: [
"emailAddress",
"phoneNumber",
"creditCard",
"ssn",
"ipAddressV4",
"ipAddressV6",
],
properties: {
emailAddress: exports.piiFieldSettingsSchema,
phoneNumber: exports.piiFieldSettingsSchema,
creditCard: exports.piiFieldSettingsSchema,
ssn: exports.piiFieldSettingsSchema,
ipAddressV4: exports.piiFieldSettingsSchema,
ipAddressV6: exports.piiFieldSettingsSchema,
customTypes: {
type: ["object", "null"],
additionalProperties: exports.customPatternSettingsSchema
},
},
};
//# sourceMappingURL=IPiiDataRedactionSettings.js.map