@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';
const recordTypesAPI = new RecordTypesAPI(
makeCitGraphQlApiRequest,
process.env.RECORD_TYPES_SERVICE_URL,
);
const response = await recordTypesAPI.getRecordTypeById(1, 'user@example.com');
Constructor Parameters
- makeRequest (required): The GraphQL API request function that matches the
MakeCitGraphQlApiRequest type signature.
- serviceUrl (optional): The service URL. Defaults to:
process.env.RECORD_TYPES_SERVICE_URL if set
- Otherwise:
https://record-types.${process.env.PLC_GRAPHQL ?? 'vpctest'}.com/graphql
Building
cd qa-package
npm install
npm run build
This 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
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 bump
fix: → patch version bump
BREAKING CHANGE: or feat!: → major version bump
For more information, see the release-please documentation.