QAWolf CI SDK
:warning: This is an experimental package. Please report any
issues you encounter to your support channel. It should still
provide a better experience than using our internal GraphQL
API directly.
This package provides a TypeScript (CSM and ESM compatible) SDK
to interact with the QAWolf Customer-facing API.
Example: Trigger Run on Deployment
import { type DeployConfig, makeQaWolfSdk } from "@qawolf/ci-sdk";
const deployConfig: DeployConfig = {
branch: undefined,
commitUrl: undefined,
deduplicationKey: undefined,
deploymentType: undefined,
deploymentUrl: undefined,
hostingService: undefined,
sha: undefined,
variables: undefined,
};
const { attemptDeploy } = makeQaWolfSdk({
apiKey: "qawolf_xxxxx",
});
(async () => {
const runId = await attemptDeploy(deployConfig);
})();
Example: Poll for CI Greenlight Status
import { makeQaWolfSdk } from "@qawolf/ci-sdk";
const { pollCiGreenlightStatus } = makeQaWolfSdk({
apiKey: "qawolf_xxxxx",
});
(async () => {
await pollCiGreenlightStatus({
runId,
onRunStageChanged: (current, previous) => {
console.log(current, previous);
},
});
})();
Versioning
This package follows the SemVer versioning scheme. Additional notes:
- Versions below 1.0.0 still follow this scheme.
- We recommend depending on the
^
range operator for this package, as it will not introduce breaking changes and guarantee
an up-to-date API usage version. - We will provide a changelog for each release, which will be available in the CHANGELOG.md file.
- This package major version will be bumped when an API breaking change is introduced. This won't
happen too often, and we will reach out to you and give advance notice when it does.
- Only top-level exports are considered part of the public API and covered by SemVer.
- Addition of new fields in the API response types are not considered breaking changes.