diff --git a/lib/commands/command.ts b/lib/commands/command.ts index a574699..4748d40 100644 --- a/lib/commands/command.ts +++ b/lib/commands/command.ts @@ -41,6 +41,7 @@ export type SchemaAttribute = { name: string, description: string, type: string, + required?: boolean, multi?: boolean, managed?: boolean, entitlement?: boolean @@ -132,3 +133,26 @@ export type ObjectOutput = { identity: string, uuid?: string } | { key: Key } export type CommandState = { [key: string]: any } + +/** + * The common schema + */ +export type Schema = { + displayAttribute: string + identityAttribute: string + attributes: SchemaAttribute[] +} + +/** + * Account schema + */ +export type AccountSchema = Schema & { + groupAttribute: string +} + +/** + * Entitlement schema + */ +export type EntitlementSchema = Schema & { + type: string +} diff --git a/lib/commands/std-account-create.ts b/lib/commands/std-account-create.ts index ecf5a38..5cc884b 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 { Attributes, ObjectOutput } from './command' +import { AccountSchema, Attributes, ObjectOutput } from './command' /** * Input object of `std:account:create` command @@ -8,6 +8,7 @@ import { Attributes, ObjectOutput } from './command' export type StdAccountCreateInput = { identity?: string attributes: any + schema?: AccountSchema } /** diff --git a/lib/commands/std-account-delete.ts b/lib/commands/std-account-delete.ts index 58983a9..0c85ff1 100644 --- a/lib/commands/std-account-delete.ts +++ b/lib/commands/std-account-delete.ts @@ -1,11 +1,13 @@ /* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */ -import {ObjectInput} from "./command" +import {AccountSchema, ObjectInput} from "./command" /** * Input object of `std:account:delete` command */ -export type StdAccountDeleteInput = ObjectInput +export type StdAccountDeleteInput = ObjectInput & { + schema?: AccountSchema +} /** * Output object of `std:account:delete` command diff --git a/lib/commands/std-account-disable.ts b/lib/commands/std-account-disable.ts index 1aec456..30ce169 100644 --- a/lib/commands/std-account-disable.ts +++ b/lib/commands/std-account-disable.ts @@ -1,11 +1,13 @@ /* Copyright (c) 2022. SailPoint Technologies, Inc. All rights reserved. */ -import { Attributes, ObjectInput, ObjectOutput } from './command' +import { AccountSchema, Attributes, ObjectInput, ObjectOutput } from './command' /** * Input object of `std:account:disable` command */ -export type StdAccountDisableInput = ObjectInput +export type StdAccountDisableInput = ObjectInput & { + schema?: AccountSchema +} /** * Output object of `std:account:disable` command diff --git a/lib/commands/std-account-discover-schema.ts b/lib/commands/std-account-discover-schema.ts index 9f6e15c..a2c9ed8 100644 --- a/lib/commands/std-account-discover-schema.ts +++ b/lib/commands/std-account-discover-schema.ts @@ -1,13 +1,8 @@ /* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */ -import { SchemaAttribute } from "./command"; +import { AccountSchema } from "./command"; /** * Output object of `std:account:discover-schema` command */ -export type StdAccountDiscoverSchemaOutput = { - displayAttribute: string - groupAttribute: string - identityAttribute: string - attributes: SchemaAttribute[] -} +export type StdAccountDiscoverSchemaOutput = AccountSchema diff --git a/lib/commands/std-account-enable.ts b/lib/commands/std-account-enable.ts index 3418933..0c73445 100644 --- a/lib/commands/std-account-enable.ts +++ b/lib/commands/std-account-enable.ts @@ -1,11 +1,13 @@ /* Copyright (c) 2022. SailPoint Technologies, Inc. All rights reserved. */ -import { Attributes, ObjectInput, ObjectOutput } from './command' +import { AccountSchema, Attributes, ObjectInput, ObjectOutput } from './command' /** * Input object of `std:account:enable` command */ -export type StdAccountEnableInput = ObjectInput +export type StdAccountEnableInput = ObjectInput & { + schema?: AccountSchema +} /** * Output object of `std:account:enable` command diff --git a/lib/commands/std-account-list.ts b/lib/commands/std-account-list.ts index e00fab9..9917f13 100644 --- a/lib/commands/std-account-list.ts +++ b/lib/commands/std-account-list.ts @@ -1,6 +1,6 @@ /* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */ -import { Attributes, CommandState, ObjectOutput } from './command' +import { AccountSchema, Attributes, CommandState, ObjectOutput } from './command' /** * Input object of `std:account:list` command @@ -8,6 +8,7 @@ import { Attributes, CommandState, ObjectOutput } from './command' export type StdAccountListInput = { stateful?: boolean state?: CommandState + schema?: AccountSchema } /** diff --git a/lib/commands/std-account-read.ts b/lib/commands/std-account-read.ts index ac11f72..86d2ae1 100644 --- a/lib/commands/std-account-read.ts +++ b/lib/commands/std-account-read.ts @@ -1,11 +1,13 @@ /* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */ -import { Attributes, ObjectInput, ObjectOutput } from './command' +import { AccountSchema, Attributes, ObjectInput, ObjectOutput } from './command' /** * Input object of `std:account:read` command */ -export type StdAccountReadInput = ObjectInput +export type StdAccountReadInput = ObjectInput & { + schema?: AccountSchema +} /** * Output object of `std:account:read` command diff --git a/lib/commands/std-account-unlock.ts b/lib/commands/std-account-unlock.ts index 85b67af..844f339 100644 --- a/lib/commands/std-account-unlock.ts +++ b/lib/commands/std-account-unlock.ts @@ -1,11 +1,13 @@ /* Copyright (c) 2022. SailPoint Technologies, Inc. All rights reserved. */ -import { Attributes, ObjectInput, ObjectOutput } from './command' +import { AccountSchema, Attributes, ObjectInput, ObjectOutput } from './command' /** * Input object of `std:account:unlock` command */ -export type StdAccountUnlockInput = ObjectInput +export type StdAccountUnlockInput = ObjectInput & { + schema?: AccountSchema +} /** * Output object of `std:account:unlock` command diff --git a/lib/commands/std-account-update.ts b/lib/commands/std-account-update.ts index dd2b977..4efdd64 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 { Attributes, ObjectInput, ObjectOutput } from './command' +import { AccountSchema, Attributes, ObjectInput, ObjectOutput } from './command' export enum AttributeChangeOp { Add = 'Add', @@ -22,6 +22,7 @@ export type AttributeChange = { */ export type StdAccountUpdateInput = ObjectInput & { changes: AttributeChange[] + schema?: AccountSchema } /** diff --git a/lib/commands/std-entitlement-list.ts b/lib/commands/std-entitlement-list.ts index d18eae2..fa92831 100644 --- a/lib/commands/std-entitlement-list.ts +++ b/lib/commands/std-entitlement-list.ts @@ -1,6 +1,6 @@ /* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */ -import { Attributes, CommandState, ObjectOutput } from './command' +import { Attributes, CommandState, EntitlementSchema, ObjectOutput } from './command' /** * Input object of `std:entitlement:list` command @@ -9,6 +9,7 @@ export type StdEntitlementListInput = { type: string stateful?: boolean state?: CommandState + schema?: EntitlementSchema } /** diff --git a/lib/commands/std-entitlement-read.ts b/lib/commands/std-entitlement-read.ts index 95a7e1d..1a47543 100644 --- a/lib/commands/std-entitlement-read.ts +++ b/lib/commands/std-entitlement-read.ts @@ -1,12 +1,13 @@ /* Copyright (c) 2021. SailPoint Technologies, Inc. All rights reserved. */ -import { Attributes, ObjectInput, ObjectOutput } from './command' +import { Attributes, EntitlementSchema, ObjectInput, ObjectOutput } from './command' /** * Input object of `std:entitlement:read` command */ export type StdEntitlementReadInput = ObjectInput & { type: string + schema?: EntitlementSchema } /**