UNPKG

@cognigy/rest-api-client

Version:

Cognigy REST-Client

139 lines 4.25 kB
export var EPiiBehaviorType; (function (EPiiBehaviorType) { EPiiBehaviorType["PREDEFINED_ALIAS"] = "predefined-alias"; EPiiBehaviorType["CUSTOM_ALIAS"] = "custom-alias"; })(EPiiBehaviorType || (EPiiBehaviorType = {})); export const 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"] } }; export const 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]+$" }, }, }; export const piiDataRedactionSettingsSchema = { title: "piiDataRedactionSettingsSchema", type: "object", additionalProperties: false, required: [ "emailAddress", "phoneNumber", "creditCard", "ssn", "ipAddressV4", "ipAddressV6", ], properties: { emailAddress: piiFieldSettingsSchema, phoneNumber: piiFieldSettingsSchema, creditCard: piiFieldSettingsSchema, ssn: piiFieldSettingsSchema, ipAddressV4: piiFieldSettingsSchema, ipAddressV6: piiFieldSettingsSchema, customTypes: { type: ["object", "null"], additionalProperties: customPatternSettingsSchema }, }, }; //# sourceMappingURL=IPiiDataRedactionSettings.js.map