This is a plugin for the CAP framework that allows you to import data from spreadsheets into your CAP project.
By default, the importer keeps the existing behavior and allows uploads for all entities. To limit uploads to selected entities, annotate the allowed service entities with @spreadsheetimporter.enabled in your CDS model:
using my.bookshop as my from '../db/schema';
using from 'cds-spreadsheetimporter-plugin';
service CatalogService {
@spreadsheetimporter.enabled
entity Books as projection on my.Books;
entity Authors as projection on my.Authors;
}When at least one entity is annotated, the importer rejects uploads for every other entity with 403 SPREADSHEET_IMPORT_ENTITY_NOT_ENABLED. Annotating a service projection also enables uploads for its underlying persistence entity, so existing URLs such as /odata/v4/importer/Spreadsheet(entity='my.bookshop.Books')/content keep working. Short entity names resolved by CAP, such as Books, are supported as well.
Use this annotation only to control which entities the importer may target. For user or role-based authorization, continue to use CAP authorization annotations such as @requires or @restrict on the importer service or your application services. For example:
annotate ImporterService with @requires: 'Admin';This project uses release-it to automate version management and package publishing. The release workflow is configured through GitHub Actions and can be triggered in two ways:
- Go to the GitHub repository's "Actions" tab
- Select the "Release" workflow
- Click "Run workflow"
- You can either:
- Leave the version field empty for automatic versioning based on conventional commits
- Specify a specific version (e.g., "1.2.0")
If you prefer to release from your local machine:
- Ensure you have the necessary credentials:
NPM_TOKENfor publishing to npmGITHUB_TOKENfor creating GitHub releases
- Run one of the following commands:
npm run release # For automatic versioning npm run release X.Y.Z # For specific version
The release process will:
- Determine the next version number (based on conventional commits or manual input)
- Update the package.json version
- Generate/update the CHANGELOG.md file
- Create a git tag
- Push changes to GitHub
- Create a GitHub release with release notes
- Publish the package to npm
The release configuration uses the Angular conventional commit preset for changelog generation and requires commit messages to follow the conventional commits specification.