diff --git a/npm-alias/package.json b/npm-alias/package.json index 9acfaa7..9151826 100644 --- a/npm-alias/package.json +++ b/npm-alias/package.json @@ -1,6 +1,6 @@ { "name": "dealmachine", - "version": "0.4.1-rc.2", + "version": "0.4.1", "description": "Short install alias for the DealMachine property intelligence CLI", "author": "DealMachine", "license": "MIT", @@ -23,7 +23,7 @@ "LICENSE" ], "dependencies": { - "@dealmachine/cli": "0.4.1-rc.2" + "@dealmachine/cli": "0.4.1" }, "engines": { "node": ">=18" diff --git a/package-lock.json b/package-lock.json index c4223ee..a38dde4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dealmachine/cli", - "version": "0.4.1-rc.2", + "version": "0.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dealmachine/cli", - "version": "0.4.1-rc.2", + "version": "0.4.1", "license": "MIT", "dependencies": { "chalk": "^5.3.0", diff --git a/package.json b/package.json index f230193..b5777d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dealmachine/cli", - "version": "0.4.1-rc.2", + "version": "0.4.1", "description": "DealMachine CLI for property intelligence, people lookup, and enrichment through the public API", "author": "DealMachine", "license": "MIT", diff --git a/src/lib/api.ts b/src/lib/api.ts index 461a8f6..68f359b 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -141,6 +141,8 @@ export async function verifyCredentials(apiKey: string): Promise<{ headers: { 'Authorization': `Bearer ${apiKey}`, 'User-Agent': CLI_USER_AGENT, + // Counts this check as CLI use in the API's request log. + 'X-DealMachine-Source': 'cli', }, }); diff --git a/src/version.ts b/src/version.ts index d4bb406..c6f8f26 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,2 +1,2 @@ -export const CLI_VERSION = '0.4.1-rc.2'; +export const CLI_VERSION = '0.4.1'; export const CLI_USER_AGENT = `dm-cli/${CLI_VERSION}`; diff --git a/tests/factory/FW-1829.json b/tests/factory/FW-1829.json new file mode 100644 index 0000000..c3f21b6 --- /dev/null +++ b/tests/factory/FW-1829.json @@ -0,0 +1,29 @@ +{ + "version": 1, + "issue": "FW-1829", + "criteria": [ + { + "id": "AC-1", + "text": "GIVEN a person uses the CLI with an API key, WHEN they sign in with that key or ask the CLI to verify who they are signed in as, THEN the request that checks the key tells the API it came from the CLI, so it is counted as CLI use and not as plain API use." + } + ], + "checks": [ + { + "title": "CLI key check tells the API it came from the CLI", + "surface": "cli", + "repository": "cli", + "preconditions": [ + "Run the reviewed CLI candidate with the approved Factory executor. No API credentials are needed." + ], + "steps": [ + "Run the CLI check suite. The CLI API helpers test in tests/lib/api.test.ts checks a key and inspects the request that was sent." + ], + "expected": "The request that checks a key carries the CLI source marker alongside the key and the CLI version, so the API counts it as CLI use.", + "criterionId": "AC-1", + "execution": "automated", + "automation": { + "taskId": "cli:check" + } + } + ] +} diff --git a/tests/lib/api.test.ts b/tests/lib/api.test.ts index a5d21a2..60b641d 100644 --- a/tests/lib/api.test.ts +++ b/tests/lib/api.test.ts @@ -37,6 +37,7 @@ describe('CLI API helpers', () => { headers: { 'Authorization': 'Bearer dm_sk_live_test', 'User-Agent': `dm-cli/${manifest.version}`, + 'X-DealMachine-Source': 'cli', }, }); });