From 9f17e34c539bea289c231d5e69dd4fb85f41c36e Mon Sep 17 00:00:00 2001 From: ricardo-fierro-sp <131704256+ricardo-fierro-sp@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:46:50 -0600 Subject: [PATCH] Update SDK to allow the new result field (#46) merging on behalf of Fangming --- lib/commands/command.ts | 32 ++++++++++++++++++++++++++++++ lib/commands/std-account-create.ts | 5 +++-- lib/commands/std-account-update.ts | 9 +++++++-- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/lib/commands/command.ts b/lib/commands/command.ts index c9a5982..40621e2 100644 --- a/lib/commands/command.ts +++ b/lib/commands/command.ts @@ -166,3 +166,35 @@ export type EntitlementSchema = Schema & { type: string, includePermissions?: boolean } + +/** + * Granular result for an attribute to indicate partial attribule level success & warning & failure + */ +export type Result = { + attribute: string, + status?: ResultStatus, + messages?: ResultMessage[] +} + +/** + * Status for result + */ +export enum ResultStatus { + Error = 'error', +} + +/** + * Warning or error message for a result + */ +export type ResultMessage = { + level: ResultMessageLevel, + message: string +} + +/** + * Level for result message + */ +export enum ResultMessageLevel { + WARN = 'WARN', + ERROR = 'ERROR', +} \ No newline at end of file diff --git a/lib/commands/std-account-create.ts b/lib/commands/std-account-create.ts index 5cc884b..6eec4e2 100644 --- a/lib/commands/std-account-create.ts +++ b/lib/commands/std-account-create.ts @@ -1,6 +1,6 @@ /* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */ -import { AccountSchema, Attributes, ObjectOutput } from './command' +import { AccountSchema, Attributes, ObjectOutput, Result } from './command' /** * Input object of `std:account:create` command @@ -17,5 +17,6 @@ export type StdAccountCreateInput = { export type StdAccountCreateOutput = ObjectOutput & { disabled?: boolean locked?: boolean - attributes: Attributes + attributes: Attributes, + results?: Result[] } diff --git a/lib/commands/std-account-update.ts b/lib/commands/std-account-update.ts index 2031d5e..ad9afda 100644 --- a/lib/commands/std-account-update.ts +++ b/lib/commands/std-account-update.ts @@ -1,6 +1,6 @@ /* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */ -import { AccountSchema, Attributes, ObjectInput, ObjectOutput } from './command' +import { AccountSchema, Attributes, ObjectInput, ObjectOutput, Result } from './command' export enum AttributeChangeOp { Add = 'Add', @@ -30,4 +30,9 @@ export type StdAccountUpdateInput = ObjectInput & { * * All properties are optional for this output */ -export type StdAccountUpdateOutput = ObjectOutput & { disabled?: boolean, locked?: boolean, attributes?: Attributes } +export type StdAccountUpdateOutput = ObjectOutput & { + disabled?: boolean, + locked?: boolean, + attributes?: Attributes, + results?: Result[] +}