Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ dm properties export --body '{"locations": [...]}' --mobile-only --json
| `--mobile-only` | Only include wireless phone numbers |
| `--landline-only` | Only include landline phone numbers |
| `--scrub-dnc` | Exclude contacts on the Do Not Call registry |
| `--active-phones-only` | Exclude phone numbers with inactive or unknown reported activity |
| `--json` | Output as JSON |

---
Expand Down Expand Up @@ -1280,3 +1281,5 @@ node dist/index.js mycommand --json
### Used By

The **Playbook** at `packages/playbooks/playbook/` uses `dm` commands to execute property intelligence workflows. The CLI is the primary interface through which the Playbook interacts with DealMachine data. Agents can load the bundled Playbook directly with `dm agents playbook`.

Both `dm properties export` and `dm people export` accept `--active-phones-only`. It combines with existing phone-type and Do Not Call controls.
4 changes: 2 additions & 2 deletions npm-alias/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dealmachine",
"version": "0.4.0-rc.1",
"version": "0.4.0-rc.4",
"description": "Short install alias for the DealMachine property intelligence CLI",
"author": "DealMachine",
"license": "MIT",
Expand All @@ -23,7 +23,7 @@
"LICENSE"
],
"dependencies": {
"@dealmachine/cli": "0.4.0-rc.1"
"@dealmachine/cli": "0.4.0-rc.4"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dealmachine/cli",
"version": "0.4.0-rc.1",
"version": "0.4.0-rc.4",
"description": "DealMachine CLI for property intelligence, people lookup, and enrichment through the public API",
"author": "DealMachine",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/commands/lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export async function listsBuild(
'Progress': `${l.progress}%`,
});
console.log();
console.log(chalk.dim(' Poll with: dm lists get ' + listId));
console.log(chalk.dim(' Poll with: dm lists get ' + l.list_id));
console.log();
}

Expand Down Expand Up @@ -366,7 +366,7 @@ export async function listsImport(
'Progress': `${l.progress}%`,
});
console.log();
console.log(chalk.dim(' Poll with: dm lists get ' + listId));
console.log(chalk.dim(' Poll with: dm lists get ' + l.list_id));
console.log();
}

Expand Down
2 changes: 2 additions & 0 deletions src/commands/people.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ export async function peopleExport(
mobileOnly?: boolean;
landlineOnly?: boolean;
scrubDnc?: boolean;
activePhonesOnly?: boolean;
} & SearchProtocolCliOptions
): Promise<void> {
const requestBody = await parseRequestBody(options);
Expand All @@ -364,6 +365,7 @@ export async function peopleExport(
if (options.mobileOnly) requestBody.mobile_only = true;
if (options.landlineOnly) requestBody.landline_only = true;
if (options.scrubDnc) requestBody.scrub_dnc = true;
if (options.activePhonesOnly) requestBody.active_phones_only = true;

const spinner = createSpinner('Exporting people (this may take 30-60 seconds)...').start();
const data = await apiRequest<ExportResponse>('/people/export', {
Expand Down
2 changes: 2 additions & 0 deletions src/commands/properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ export async function propertiesExport(
mobileOnly?: boolean;
landlineOnly?: boolean;
scrubDnc?: boolean;
activePhonesOnly?: boolean;
contactAudience?: string;
anchor?: string;
} & SearchProtocolCliOptions
Expand All @@ -349,6 +350,7 @@ export async function propertiesExport(
if (options.mobileOnly) requestBody.mobile_only = true;
if (options.landlineOnly) requestBody.landline_only = true;
if (options.scrubDnc) requestBody.scrub_dnc = true;
if (options.activePhonesOnly) requestBody.active_phones_only = true;

const spinner = createSpinner('Exporting properties (this may take 30-60 seconds)...').start();
const data = await apiRequest<ExportResponse>('/properties/export', {
Expand Down
8 changes: 8 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,10 @@ propertiesCmd
.option('--mobile-only', 'Only include wireless phone numbers')
.option('--landline-only', 'Only include landline phone numbers')
.option('--scrub-dnc', 'Exclude contacts on the Do Not Call registry')
.option(
'--active-phones-only',
'Only include phone numbers with active reported phone activity (inactive/unknown excluded)'
)
.option('--json', 'Output as JSON')
.addHelpText(
'after',
Expand Down Expand Up @@ -1164,6 +1168,10 @@ peopleCmd
.option('--mobile-only', 'Only include wireless phone numbers')
.option('--landline-only', 'Only include landline phone numbers')
.option('--scrub-dnc', 'Exclude contacts on the Do Not Call registry')
.option(
'--active-phones-only',
'Only include phone numbers with active reported phone activity (inactive/unknown excluded)'
)
.option('--json', 'Output as JSON')
.addHelpText(
'after',
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const CLI_VERSION = '0.4.0-rc.1';
export const CLI_VERSION = '0.4.0-rc.4';
export const CLI_USER_AGENT = `dm-cli/${CLI_VERSION}`;
23 changes: 21 additions & 2 deletions tests/commands/publicApiExtensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ vi.mock('../../src/lib/output.js', () => ({
}));

import { printJson, printTable } from '../../src/lib/output.js';
import { peopleGet, peopleIds, peopleSearch } from '../../src/commands/people.js';
import { propertiesGet, propertiesIds, propertiesSearch } from '../../src/commands/properties.js';
import { peopleGet, peopleIds, peopleSearch, peopleExport } from '../../src/commands/people.js';
import { propertiesGet, propertiesIds, propertiesSearch, propertiesExport } from '../../src/commands/properties.js';
import {
enrichAddress,
enrichApn,
Expand Down Expand Up @@ -571,3 +571,22 @@ describe('CLI phone carrier (DEA-2144)', () => {
});

});


describe.each([
['people', peopleExport],
['properties', propertiesExport],
] as const)('%s active phone exports', (source, exportRecords) => {
it.each([true, undefined])('preserves active phone selection %s at the API boundary', async (activePhonesOnly) => {
mockParseRequestBody.mockResolvedValue({ fields: ['phone_1'] });
await exportRecords({ activePhonesOnly, json: true });
expect(mockApiRequest).toHaveBeenCalledWith(`/${source}/export`, {
method: 'POST',
body: {
fields: ['phone_1'],
...(source === 'properties' ? { anchor: 'person', contact_audience: 'owners' } : {}),
...(activePhonesOnly ? { active_phones_only: true } : {}),
},
});
});
});
Loading