(
entityTypeId: string,
properties: PropRecord,
outgoingLinks: LinkSpec[] = [],
draft = false,
)
| 1185 | }; |
| 1186 | |
| 1187 | const makeEntity = ( |
| 1188 | entityTypeId: string, |
| 1189 | properties: PropRecord, |
| 1190 | outgoingLinks: LinkSpec[] = [], |
| 1191 | draft = false, |
| 1192 | ) => |
| 1193 | // Entities are owned by the example-org web and created as the org owner, |
| 1194 | // so all members of the org can see them. |
| 1195 | createEntity(memberContext, memberAuthentication, { |
| 1196 | webId: entityWebId, |
| 1197 | entityTypeIds: [entityTypeId] as never, |
| 1198 | properties: { value: properties }, |
| 1199 | draft, |
| 1200 | outgoingLinks: outgoingLinks.map((spec) => ({ |
| 1201 | webId: entityWebId, |
| 1202 | entityTypeIds: [spec.linkTypeId] as never, |
| 1203 | properties: { value: spec.properties ?? {} }, |
| 1204 | linkData: { rightEntityId: spec.rightEntityId }, |
| 1205 | })), |
| 1206 | }); |
| 1207 | |
| 1208 | /** Runs an async mapper over items with bounded concurrency. */ |
| 1209 | const batchMap = async <T, R>( |
no test coverage detected