@opsrev/acculynx-cli 1.9.1 → 1.10.0

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.
Files changed (2) hide show
  1. package/dist/index.js +19 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -278,11 +278,15 @@ function registerContactsCommands(parentCmd, getClient2) {
278
278
  const result = await getClient2().post("/contacts", body);
279
279
  console.log(JSON.stringify(result));
280
280
  });
281
- contacts.command("search").description("Search contacts").requiredOption("--query <text>", "Search term (required)").option("--sort-by <field>", "Sort by field (default: LastName)", "LastName").option("--sort-order <order>", "Ascending or Descending (default: Ascending)", "Ascending").action(async (opts) => {
281
+ contacts.command("search").description("Search contacts").requiredOption("--query <text>", "Search term (required)").requiredOption("--start-date <date>", "Start date (YYYY-MM-DD, required)").requiredOption("--end-date <date>", "End date (YYYY-MM-DD, required)").option("--sort-by <field>", "Sort by: CreatedDate, firstName, lastName", "lastName").option("--sort-order <order>", "Ascending or Descending", "Ascending").action(async (opts) => {
282
282
  const result = await getClient2().post("/contacts/search", {
283
- SearchTerm: opts.query,
284
- SortBy: opts.sortBy,
285
- SortOrder: opts.sortOrder
283
+ searchTerm: opts.query,
284
+ startDate: opts.startDate,
285
+ endDate: opts.endDate,
286
+ sort: {
287
+ sortColumn: opts.sortBy,
288
+ sortDirection: opts.sortOrder
289
+ }
286
290
  });
287
291
  console.log(JSON.stringify(result));
288
292
  });
@@ -294,6 +298,17 @@ function registerContactsCommands(parentCmd, getClient2) {
294
298
  const result = await getClient2().get(`/contacts/${contactId}/phone-numbers`);
295
299
  console.log(JSON.stringify(result));
296
300
  });
301
+ contacts.command("phone-add").argument("<contactId>", "Contact ID").description("Add a phone number to a contact (omit --sms-opt-out to opt in to SMS)").requiredOption("--type <type>", "Phone type: Mobile, Home, Work").requiredOption("--number <number>", "Phone number").option("--sms-opt-out", "Opt this number out of SMS").action(async (contactId, opts) => {
302
+ const result = await getClient2().post(
303
+ `/contacts/${contactId}/phone-numbers`,
304
+ {
305
+ type: opts.type,
306
+ number: opts.number,
307
+ smsOptOut: Boolean(opts.smsOptOut)
308
+ }
309
+ );
310
+ console.log(JSON.stringify(result));
311
+ });
297
312
  }
298
313
 
299
314
  // src/commands/estimates.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opsrev/acculynx-cli",
3
- "version": "1.9.1",
3
+ "version": "1.10.0",
4
4
  "description": "CLI for the AccuLynx roofing CRM API",
5
5
  "type": "module",
6
6
  "bin": {