UNPKG

scim-patch-with-remove

Version:
61 lines 2.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NoTarget = exports.InvalidScimPatchRequest = exports.NoPathInScimPatchOp = exports.InvalidScimPatchOp = exports.UnsupportedBlueprintEntities = exports.DeepArrayRemovalNotSupported = exports.InvalidScimValueRemoval = exports.InvalidScimPatch = exports.ScimError = void 0; class ScimError extends Error { constructor(scimCode) { super(); this.scimCode = scimCode; } } exports.ScimError = ScimError; class InvalidScimPatch extends ScimError { constructor(message, scimCode = 'invalidSyntax') { super(scimCode); this.message = `Invalid SCIM Patch: ${message}`; } } exports.InvalidScimPatch = InvalidScimPatch; class InvalidScimValueRemoval extends ScimError { constructor(message, scimCode = 'invalidSyntax') { super(scimCode); this.message = `Invalid SCIM Remove Operation: ${message}`; } } exports.InvalidScimValueRemoval = InvalidScimValueRemoval; class DeepArrayRemovalNotSupported extends InvalidScimValueRemoval { constructor() { super('Array inside array values to remove not supported for now'); } } exports.DeepArrayRemovalNotSupported = DeepArrayRemovalNotSupported; class UnsupportedBlueprintEntities extends InvalidScimValueRemoval { constructor() { super('Can`t remove item from non array like property'); } } exports.UnsupportedBlueprintEntities = UnsupportedBlueprintEntities; class InvalidScimPatchOp extends InvalidScimPatch { constructor(message) { super(`${message}`, 'invalidSyntax'); } } exports.InvalidScimPatchOp = InvalidScimPatchOp; class NoPathInScimPatchOp extends InvalidScimPatch { constructor() { super('Missing path in "remove" patch operation', 'noTarget'); } } exports.NoPathInScimPatchOp = NoPathInScimPatchOp; class InvalidScimPatchRequest extends InvalidScimPatch { constructor(message) { super(`The SCIM patch request is invalid: ${message}`); } } exports.InvalidScimPatchRequest = InvalidScimPatchRequest; class NoTarget extends InvalidScimPatch { constructor(valuePath) { super(`Target location is a multi-valued attribute for which a value selection filter (${valuePath}) has been supplied and no record match was made.`, 'noTarget'); } } exports.NoTarget = NoTarget; //# sourceMappingURL=scimErrors.js.map