Skip to content

Function: createProfileShadowAdapter() ​

ts
function createProfileShadowAdapter(params): object;

Defined in: application/services/adapters/profile-shadow-adapter.ts:16

Creates helpers that look up document profiles and their schemas, and provide a cached ShadowApplicationService per profile. A cached service is rebuilt when the profile schema or the workspace type library object changes.

Profiles are looked up in profileCache first, then in workspace.value.profiles.

Parameters ​

ParameterType
params{ profileCache: Record<string, any>; workspace: { value: any; }; }
params.profileCacheRecord<string, any>
params.workspace{ value: any; }
params.workspace.valueany

Returns ​

object

getDocumentDisplayLabel ​

ts
getDocumentDisplayLabel: (doc) => any;

Parameters ​

ParameterType
docany

Returns ​

any

getProfileById ​

ts
getProfileById: (profileId) => any;

Parameters ​

ParameterType
profileIdstring | null | undefined

Returns ​

any

getProfileSchemaById ​

ts
getProfileSchemaById: (profileId) => any;

Parameters ​

ParameterType
profileIdstring | null | undefined

Returns ​

any

getProfileSchemaForDocument ​

ts
getProfileSchemaForDocument: (doc) => any;

Parameters ​

ParameterType
docany

Returns ​

any

getSeedFieldAndValue ​

ts
getSeedFieldAndValue: (profileId, text) => object;

Parameters ​

ParameterType
profileIdstring | null | undefined
textstring

Returns ​

object

fieldName ​
ts
fieldName: string | null;
seedValue ​
ts
seedValue: any;

getShadowServiceForProfile ​

ts
getShadowServiceForProfile: (profileId) => 
  | ShadowApplicationService
  | null;

Parameters ​

ParameterType
profileIdstring | null | undefined

Returns ​

| ShadowApplicationService | null