@opengov/qa-record-types-api
v1.0.2
Published
Record Types API client for QA tests
Maintainers
Keywords
Readme
@opengov/qa-record-types-api
Record Types API client for QA tests with dependency injection support.
Installation
This package is part of the monorepo and can be used by other packages in the qa-tests directory.
Usage
The RecordTypesAPI class uses dependency injection for the GraphQL request function, allowing you to inject makeCitGraphQlApiRequest from @opengov/cit-api-base without creating a direct package dependency.
This was made with cit-api-base version 1.32.0 so as long as that didn't change this should work.
Example
import {RecordTypesAPI, MakeCitGraphQlApiRequest} from '@opengov/qa-record-types-api';
import {makeCitGraphQlApiRequest} from '@opengov/cit-api-base/build/api-support/citApiHelper';
// Inject the request function
const recordTypesAPI = new RecordTypesAPI(
makeCitGraphQlApiRequest,
process.env.RECORD_TYPES_SERVICE_URL, // optional service URL
);
// Use the API
const response = await recordTypesAPI.getRecordTypeById(1, '[email protected]');Constructor Parameters
- makeRequest (required): The GraphQL API request function that matches the
MakeCitGraphQlApiRequesttype signature. - serviceUrl (optional): The service URL. Defaults to:
process.env.RECORD_TYPES_SERVICE_URLif set- Otherwise:
https://record-types.${process.env.PLC_GRAPHQL ?? 'vpctest'}.com/graphql
Building
cd qa-package
npm install
npm run buildThis will compile TypeScript to the dist/ directory.
Publishing
This package uses release-please to automate versioning and publishing to NPM.
How to Release a New Version
Make your changes to the code in the
qa-packagedirectory.Commit your changes to the
mainbranch. The release-please workflow will automatically:- Detect changes in the
qa-package/**path - Create or update a release PR with version bumps and changelog updates
- The PR will be titled something like:
chore(main): release 1.0.1
- Detect changes in the
Review the release PR:
- Check that the version number is correct (patch, minor, or major bump)
- Review the automatically generated changelog entries
- Ensure all changes are included
Merge the release PR:
- Once merged, release-please will:
- Create a git tag (e.g.,
qa-record-types-api-v1.0.1) - Trigger the publish workflow to build and publish to NPM
- Create a git tag (e.g.,
- The package will be published to
@opengov/qa-record-types-apion NPM
- Once merged, release-please will:
Verify the release:
- Check the GitHub Actions workflow to ensure the publish step completed successfully
- Verify the package is available on NPM
Manual Release (if needed)
If you need to manually trigger a release, you can use the workflow_dispatch trigger in the GitHub Actions workflow.
Version Bumping
Release-please automatically determines the version bump based on conventional commit messages:
feat:→ minor version bumpfix:→ patch version bumpBREAKING CHANGE:orfeat!:→ major version bump
For more information, see the release-please documentation.
