@smokeballdev/smokeball-client-sdk


Interface: Api

Entry point for matter types to Smokeball.

Methods

get()

get(matterTypeId?): Promise<MatterType>

Gets the matter type of the matter associated to the current context or the specified matter type id if provided.

Parameters

matterTypeId?

string

the matter to retrieve, use null to get matter type of the matter in the current context.

Returns

Promise<MatterType>

the specified matter type.

Example

// Returns the matter type of the matter associated to the current context.
const matterType = await sdk.matterTypes.get();
// Returns the matter type with the specified matter type id.
const matterType = await sdk.matterTypes.get('027fc73d-fcc6-4769-953e-9a11aaf9c73c');

getMany()

getMany(request): Promise<GetMatterTypesResponse>

Get matter types associated with matter type ids provided.

Parameters

request

GetMatterTypesRequest

set optional filters for matter types to retrieve.

Returns

Promise<GetMatterTypesResponse>

specified matter types.

Example

const request: matterTypes.GetMatterTypesRequest = {
   ids: ['027fc73d-fcc6-4769-953e-9a11aaf9c73c','d2e8aea9-e201-4be7-bbe6-a4f64cc491ac'],
   locationIds: ['NSW','QLD'],
   categories: ['Litigation','Estate Administration'],
   type: 'MatterType'
}

const matterTypes = await sdk.matterTypes.getMany(request);

select()

select(request): Promise<string[]>

Opens a matter type picker to multi-select matter types. Returns the selected matter type ids.

Parameters

request

SelectMatterTypesRequest

set default location for matter types picker.

Returns

Promise<string[]>

selected matter types.

Example

const request: SelectMatterTypesRequest = {
   defaultLocationId: 'NSW'
}
const matterTypeIds = await sdk.matterTypes.select(request);