@dench.com/cli 2.9.3-staging.225 → 2.9.4
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/crm.ts +14 -0
- package/lib/api-schemas.ts +13 -2
- package/package.json +1 -1
package/crm.ts
CHANGED
|
@@ -4466,6 +4466,20 @@ Cells (single-field updates):
|
|
|
4466
4466
|
|
|
4467
4467
|
Query DSL:
|
|
4468
4468
|
dench crm query <object> --where '{"Status":"New"}' --select Name,Email --sort -Score --limit 100
|
|
4469
|
+
Operators: $eq $ne $in $nin $gt $gte $lt $lte $exists
|
|
4470
|
+
$startsWith $endsWith $contains, plus logical $and / $or.
|
|
4471
|
+
Date operators (work on date fields and the system timestamps
|
|
4472
|
+
created_at / updated_at):
|
|
4473
|
+
$datePreset — dynamic calendar range: today, yesterday, tomorrow,
|
|
4474
|
+
this_week, last_week, next_week, this_month,
|
|
4475
|
+
last_month, next_month, this_quarter, last_quarter,
|
|
4476
|
+
this_year, last_year
|
|
4477
|
+
$inLast / $inNext — rolling window: a day count (7) or
|
|
4478
|
+
{"amount":2,"unit":"weeks"} (days|weeks|months|quarters|years)
|
|
4479
|
+
Examples:
|
|
4480
|
+
dench crm query lead --where '{"created_at":{"$inLast":7}}'
|
|
4481
|
+
dench crm query lead --where '{"updated_at":{"$datePreset":"this_month"}}'
|
|
4482
|
+
dench crm query deal --where '{"Close Date":{"$inNext":{"amount":1,"unit":"quarters"}}}'
|
|
4469
4483
|
|
|
4470
4484
|
Aggregates:
|
|
4471
4485
|
dench crm aggregate <object> --field Status
|
package/lib/api-schemas.ts
CHANGED
|
@@ -746,7 +746,12 @@ const savedViewDefinition = z
|
|
|
746
746
|
.record(z.string(), z.unknown())
|
|
747
747
|
.optional()
|
|
748
748
|
.describe(
|
|
749
|
-
'FilterGroup, e.g. {"id":"g1","conjunction":"and","rules":[{"id":"r1","field":"Status","operator":"is","value":"Hot"}]}.'
|
|
749
|
+
'FilterGroup, e.g. {"id":"g1","conjunction":"and","rules":[{"id":"r1","field":"Status","operator":"is","value":"Hot"}]}. ' +
|
|
750
|
+
'Date rules support operator "date_preset" with value "today", "yesterday", "this_week", ' +
|
|
751
|
+
'"last_week", "this_month", "last_month", "this_quarter", "last_quarter", "this_year", or ' +
|
|
752
|
+
'"last_year", plus "relative_past"/"relative_next" with relativeAmount + relativeUnit ' +
|
|
753
|
+
"(days|weeks|months|quarters|years). Rules may target the system timestamps " +
|
|
754
|
+
'"created_at" / "updated_at", e.g. {"field":"created_at","operator":"relative_past","relativeAmount":7,"relativeUnit":"days"}.',
|
|
750
755
|
),
|
|
751
756
|
sort: z.array(savedViewSortRule).optional(),
|
|
752
757
|
columns: z
|
|
@@ -2623,7 +2628,13 @@ export const requestSchemas: Record<string, ZodTypeAny> = {
|
|
|
2623
2628
|
.string()
|
|
2624
2629
|
.optional()
|
|
2625
2630
|
.describe(
|
|
2626
|
-
"JSON string of the DSL when filters use operators like $gt/$in/$contains/$and/$or."
|
|
2631
|
+
"JSON string of the DSL when filters use operators like $gt/$in/$contains/$and/$or. " +
|
|
2632
|
+
"Date fields and the system timestamps created_at/updated_at also accept " +
|
|
2633
|
+
'$datePreset ("today", "yesterday", "this_week", "last_week", "this_month", ' +
|
|
2634
|
+
'"last_month", "this_quarter", "last_quarter", "this_year", "last_year"), and ' +
|
|
2635
|
+
'$inLast/$inNext rolling windows (a day count like 7, or {"amount":2,"unit":"weeks"} ' +
|
|
2636
|
+
"with unit days|weeks|months|quarters|years). " +
|
|
2637
|
+
'Example: {"filter":{"updated_at":{"$datePreset":"this_month"}}}.',
|
|
2627
2638
|
),
|
|
2628
2639
|
}),
|
|
2629
2640
|
"crm.sql": z.object({
|