@tenderlead/cli 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/tenderlead.js CHANGED
@@ -10,7 +10,7 @@ const PROFILE_FIELDS = [
10
10
  'company_name', 'legal_name', 'company_number', 'title', 'website', 'team_size', 'specialisms',
11
11
  'past_contracts', 'sectors', 'keywords', 'size_min', 'size_max', 'frameworks',
12
12
  'clearance_capability', 'region', 'market_watch_enabled', 'market_watch_terms',
13
- 'market_watch_buyers', 'market_watch_note', 'us_readiness_profile', 'no_bid_rules',
13
+ 'market_watch_buyers', 'market_watch_note', 'us_readiness_profile', 'eu_readiness_profile', 'no_bid_rules',
14
14
  ];
15
15
 
16
16
  function usage() {
@@ -392,7 +392,7 @@ function formatBrief(payload) {
392
392
  const lines = ['# TenderLead daily brief', '', `Generated: ${line(payload.generated_at, 'Not recorded')}`, `Plan: ${line(payload.tier, 'Not recorded')}`, '', '## Opportunities', ''];
393
393
  if (!rows.length) lines.push('No current scored opportunities.');
394
394
  for (const row of rows) {
395
- const score = Number.isFinite(Number(row.score)) ? ` ${Math.round(Number(row.score))}/100` : '';
395
+ const score = row.score != null && row.score !== '' && Number.isFinite(Number(row.score)) ? ` ${Math.round(Number(row.score))}/100` : '';
396
396
  lines.push(`- **${line(row.recommendation, 'alert').toUpperCase()}${score}** ${line(row.title, 'Untitled notice')}`);
397
397
  lines.push(` ${line(row.buyer, 'Buyer not listed')} · ${line(row.source, 'Source not recorded')} · Deadline: ${line(row.deadline, 'Not recorded')}`);
398
398
  if (Array.isArray(row.reasoning) && row.reasoning.length) lines.push(` Why: ${row.reasoning.slice(0, 3).map(String).join(' ')}`);
@@ -418,7 +418,8 @@ function formatTenders(payload) {
418
418
  }
419
419
 
420
420
  function formatScore(payload) {
421
- const score = Number.isFinite(Number(payload.score)) ? `${Math.round(Number(payload.score))}/100` : 'not recorded';
421
+ if (payload.status === 'processing') return `Fit check in progress. Check its status with GET ${line(payload.status_url, '/v1/tenders/' + encodeURIComponent(payload.contract_id) + '/score')}.`;
422
+ const score = payload.score != null && payload.score !== '' && Number.isFinite(Number(payload.score)) ? `${Math.round(Number(payload.score))}/100` : 'not recorded';
422
423
  const lines = [`# TenderLead tender score`, '', `Contract: ${line(payload.contract_id, 'Not recorded')}`, `Recommendation: ${line(payload.recommendation, 'Not recorded').toUpperCase()}`, `Score: ${score}`];
423
424
  if (Array.isArray(payload.reasoning) && payload.reasoning.length) lines.push('', 'Why:', ...payload.reasoning.map(item => `- ${String(item)}`));
424
425
  if (payload.no_bid_reason) lines.push('', `No-bid reason: ${payload.no_bid_reason}`);
@@ -614,6 +615,7 @@ function validateProfile(profile) {
614
615
  }
615
616
  if ('market_watch_enabled' in profile && typeof profile.market_watch_enabled !== 'boolean') throw new Error('market_watch_enabled must be a boolean');
616
617
  if ('us_readiness_profile' in profile && !isPlainObject(profile.us_readiness_profile)) throw new Error('us_readiness_profile must be an object');
618
+ if ('eu_readiness_profile' in profile && !isPlainObject(profile.eu_readiness_profile)) throw new Error('eu_readiness_profile must be an object');
617
619
  for (const field of ['size_min', 'size_max']) {
618
620
  if (field in profile && !Number.isFinite(Number(profile[field]))) throw new Error(`${field} must be a number`);
619
621
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenderlead/cli",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "private": false,
5
5
  "description": "Run TenderLead tender, profile, pipeline, insight and bid-workspace workflows from the terminal",
6
6
  "homepage": "https://tenderlead.co.uk",