MCPcopy Index your code
hub / github.com/simstudioai/sim / mapAssetObject

Function mapAssetObject

apps/sim/tools/jsm/utils.ts:32–55  ·  view source on GitHub ↗
(data: RawAssetObject)

Source from the content-addressed store, hash-verified

30 * @param data - The raw object payload from the Assets API
31 */
32export function mapAssetObject(data: RawAssetObject): AssetObject {
33 return {
34 id: data.id,
35 label: data.label ?? null,
36 objectKey: data.objectKey ?? null,
37 globalId: data.globalId ?? null,
38 created: data.created ?? null,
39 updated: data.updated ?? null,
40 hasAvatar: data.hasAvatar ?? false,
41 objectType: data.objectType ?? null,
42 attributes: (data.attributes ?? []).map((attr) => ({
43 id: attr.id ?? '',
44 objectTypeAttributeId: attr.objectTypeAttributeId ?? '',
45 objectAttributeValues: (attr.objectAttributeValues ?? []).map((v) => ({
46 value: v.value ?? null,
47 displayValue: v.displayValue ?? null,
48 searchValue: v.searchValue ?? null,
49 referencedType: v.referencedType ?? false,
50 referencedObject: v.referencedObject ?? null,
51 })),
52 })),
53 link: data._links?.self ?? null,
54 }
55}
56
57/**
58 * Build the base URL for JSM Service Desk API

Callers 3

route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected