( capability: CapabilityCreate, attribute: CapabilityAttribute, commandName: string, type: Type, value: unknown, )
| 120 | } |
| 121 | |
| 122 | const addBasicCommand = ( |
| 123 | capability: CapabilityCreate, |
| 124 | attribute: CapabilityAttribute, |
| 125 | commandName: string, |
| 126 | type: Type, |
| 127 | value: unknown, |
| 128 | ): void => { |
| 129 | if (!attribute.enumCommands) { |
| 130 | attribute.enumCommands = [] |
| 131 | } |
| 132 | attribute.enumCommands.push({ command: commandName, value }) |
| 133 | |
| 134 | const capabilityCommand = { |
| 135 | name: commandName, |
| 136 | arguments: [{ |
| 137 | name: 'value', |
| 138 | optional: false, |
| 139 | schema: buildSchemaMatchingAttributeType(attribute, type), |
| 140 | }], |
| 141 | } |
| 142 | addCommand(capability, commandName, capabilityCommand) |
| 143 | } |
| 144 | |
| 145 | const promptAndAddBasicCommands = async ( |
| 146 | capability: CapabilityCreate, |
no test coverage detected