|
2 | 2 |
|
3 | 3 | import fs from 'node:fs'; |
4 | 4 | import path from 'node:path'; |
5 | | -import { zodToJsonSchema } from 'zod-to-json-schema'; |
| 5 | +import { zodToJsonSchema } from 'zod-to-json-schema'; // eslint-disable-line import/no-extraneous-dependencies |
6 | 6 | import { $TemplateDeletedEvent } from '../src/templates/events/template-deleted.event'; |
7 | 7 | import { $UserCreatedEvent } from '../src/auth/events/user-created.event'; |
8 | 8 |
|
9 | 9 | // Create template service golden contracts |
10 | | -const templateSchemasPath = path.resolve(__dirname, '../src/templates/events/.schemas'); |
| 10 | +const templateSchemasPath = path.resolve( |
| 11 | + __dirname, |
| 12 | + '../src/templates/events/.schemas' |
| 13 | +); |
11 | 14 | fs.mkdirSync(templateSchemasPath, { recursive: true }); |
12 | 15 |
|
13 | | -const TemplateDeletedSchema = zodToJsonSchema($TemplateDeletedEvent, 'TemplateDeletedEvent'); |
14 | | -const templateDeletedPath = path.join(templateSchemasPath, 'template-deleted.schema.json'); |
15 | | -fs.writeFileSync(templateDeletedPath, JSON.stringify(TemplateDeletedSchema, null, 2)); |
16 | | -console.log('Created JSONSchema file at', templateDeletedPath) |
| 16 | +const TemplateDeletedSchema = zodToJsonSchema( |
| 17 | + $TemplateDeletedEvent, |
| 18 | + 'TemplateDeletedEvent' |
| 19 | +); |
| 20 | +const templateDeletedPath = path.join( |
| 21 | + templateSchemasPath, |
| 22 | + 'template-deleted.schema.json' |
| 23 | +); |
| 24 | +fs.writeFileSync( |
| 25 | + templateDeletedPath, |
| 26 | + JSON.stringify(TemplateDeletedSchema, null, 2) |
| 27 | +); |
| 28 | +console.log('Created JSONSchema file at', templateDeletedPath); |
17 | 29 |
|
18 | 30 | // Create auth service golden contracts |
19 | 31 | const authSchemasPath = path.resolve(__dirname, '../src/auth/events/.schemas'); |
20 | 32 | fs.mkdirSync(authSchemasPath, { recursive: true }); |
21 | 33 |
|
22 | | -const UserCreatedSchema = zodToJsonSchema($UserCreatedEvent, 'UserCreatedEvent'); |
| 34 | +const UserCreatedSchema = zodToJsonSchema( |
| 35 | + $UserCreatedEvent, |
| 36 | + 'UserCreatedEvent' |
| 37 | +); |
23 | 38 | const userCreatedPath = path.join(authSchemasPath, 'user-created.schema.json'); |
24 | 39 | fs.writeFileSync(userCreatedPath, JSON.stringify(UserCreatedSchema, null, 2)); |
25 | | -console.log('Created JSONSchema file at', userCreatedPath) |
| 40 | +console.log('Created JSONSchema file at', userCreatedPath); |
0 commit comments