| 74 | |
| 75 | // biome-ignore lint/suspicious/noExplicitAny: walking arbitrary JSON schema structure |
| 76 | function stripBlocksFromFile(schema: any) { |
| 77 | // Navigate to project.properties.notebooks.items.properties.blocks and replace |
| 78 | // the items with a $ref comment |
| 79 | try { |
| 80 | const projectProps = schema.properties?.project?.properties |
| 81 | if (!projectProps?.notebooks?.items?.properties?.blocks) { |
| 82 | return |
| 83 | } |
| 84 | projectProps.notebooks.items.properties.blocks = { |
| 85 | type: 'array', |
| 86 | description: 'Array of DeepnoteBlock objects (see DeepnoteBlock type above)', |
| 87 | items: {}, |
| 88 | } |
| 89 | } catch { |
| 90 | // If structure doesn't match, leave as-is |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | run() |
| 95 | .then(() => { |