()
| 62 | * Delete all entities from the Graph. |
| 63 | */ |
| 64 | export const deleteEntities = async () => { |
| 65 | await fetch(`http://127.0.0.1:${port}/entities/delete`, { |
| 66 | method: "POST", |
| 67 | headers: { |
| 68 | "Content-Type": "application/json", |
| 69 | "X-Authenticated-User-Actor-Id": "00000000-0000-0000-0000-000000000000", |
| 70 | }, |
| 71 | body: JSON.stringify({ |
| 72 | filter: { all: [] }, |
| 73 | temporalAxes: { |
| 74 | pinned: { |
| 75 | axis: "transactionTime", |
| 76 | timestamp: null, |
| 77 | }, |
| 78 | variable: { |
| 79 | axis: "decisionTime", |
| 80 | interval: { |
| 81 | start: { kind: "unbounded" }, |
| 82 | end: null, |
| 83 | }, |
| 84 | }, |
| 85 | }, |
| 86 | includeDrafts: true, |
| 87 | scope: "erase", |
| 88 | }), |
| 89 | }).then(async (response) => { |
| 90 | if (!response.ok) { |
| 91 | const body = await response.text(); |
| 92 | throw new Error(`Could not remove entities: ${body}`); |
| 93 | } |
| 94 | }); |
| 95 | }; |
| 96 | |
| 97 | /** |
| 98 | * Restore a snapshot from a file. |
no test coverage detected