(file: string)
| 191 | } |
| 192 | |
| 193 | async function createMock(file: string) { |
| 194 | for (const project of domains) { |
| 195 | await db.project.create({ |
| 196 | data: { |
| 197 | organizationId: 'openpanel-dev', |
| 198 | name: project.domain, |
| 199 | cors: [project.domain], |
| 200 | domain: project.domain, |
| 201 | crossDomain: true, |
| 202 | clients: { |
| 203 | create: { |
| 204 | organizationId: 'openpanel-dev', |
| 205 | name: project.domain, |
| 206 | secret: await hashPassword('secret'), |
| 207 | id: project.clientId, |
| 208 | type: ClientType.write, |
| 209 | }, |
| 210 | }, |
| 211 | }, |
| 212 | }); |
| 213 | } |
| 214 | |
| 215 | fs.writeFileSync( |
| 216 | file, |
| 217 | JSON.stringify(insertFakeEvents(scrambleEvents(generateEvents())), null, 2), |
| 218 | 'utf-8', |
| 219 | ); |
| 220 | } |
| 221 | |
| 222 | function insertFakeEvents(events: Event[]) { |
| 223 | const blueprint = { |
no test coverage detected