@dench.com/cli 3.11.9-staging.507 → 3.11.10-staging.519

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/app-sdk.d.ts CHANGED
@@ -1759,6 +1759,11 @@ export interface ApiRequests {
1759
1759
  objectName?: string;
1760
1760
  entryId?: string;
1761
1761
  };
1762
+ /** Delete a CRM document page; its workspace file stays and nested pages move up. — `dench crm docs delete` — DELETE /api/v1/crm/docs/{documentId} */
1763
+ "crm.docs.delete": {
1764
+ /** The id crm docs create returned. */
1765
+ documentId: string;
1766
+ };
1762
1767
  /** List CRM actions. — `dench crm actions list` — GET /api/v1/crm/actions */
1763
1768
  "crm.actions.list": {
1764
1769
  entryId: string;
@@ -5682,6 +5687,9 @@ export interface ApiResponses {
5682
5687
  "crm.docs.link": {
5683
5688
  ok: boolean;
5684
5689
  };
5690
+ "crm.docs.delete": {
5691
+ ok: boolean;
5692
+ };
5685
5693
  "crm.actions.list": Array<{
5686
5694
  _id: string;
5687
5695
  _creationTime: number;
@@ -9154,6 +9162,8 @@ export type DenchApiTree = {
9154
9162
  docs: {
9155
9163
  /** Create a CRM document. (`dench crm docs create`) */
9156
9164
  create(args: Req<"crm.docs.create">): Promise<Res<"crm.docs.create">>;
9165
+ /** Delete a CRM document page; its workspace file stays and nested pages move up. (`dench crm docs delete`) */
9166
+ delete(args: Req<"crm.docs.delete">): Promise<Res<"crm.docs.delete">>;
9157
9167
  /** Link a CRM document. (`dench crm docs link`) */
9158
9168
  link(args: Req<"crm.docs.link">): Promise<Res<"crm.docs.link">>;
9159
9169
  /** List CRM documents. (`dench crm docs list`) */
package/crm.ts CHANGED
@@ -26,7 +26,7 @@
26
26
  * crm aggregate <object> --field …
27
27
  * crm batch --file ops.jsonl
28
28
  * crm statuses list / set
29
- * crm docs list / create / link
29
+ * crm docs list / create / link / delete
30
30
  * crm actions list / run / runs
31
31
  */
32
32
 
@@ -1092,6 +1092,7 @@ const api = {
1092
1092
  list: makeFunctionReference<"query">("functions/crm/documents:list"),
1093
1093
  create: makeFunctionReference<"mutation">("functions/crm/documents:create"),
1094
1094
  link: makeFunctionReference<"mutation">("functions/crm/documents:link"),
1095
+ remove: makeFunctionReference<"mutation">("functions/crm/documents:remove"),
1095
1096
  },
1096
1097
  actions: {
1097
1098
  list: makeFunctionReference<"query">("functions/crm/actions:list"),
@@ -3509,7 +3510,11 @@ async function runDocsCommand(ctx: CrmCliContext): Promise<void> {
3509
3510
  return;
3510
3511
  }
3511
3512
  case "create": {
3512
- const filePath = shift(ctx.args, "file path");
3513
+ const filePath = shiftName(
3514
+ ctx.args,
3515
+ "file path",
3516
+ "dench crm docs create <path> [--title ...] [--icon ...] [--link-entry <id>]",
3517
+ );
3513
3518
  const title = getFlag(ctx.args, "--title") ?? filePath.split("/").pop()!;
3514
3519
  const icon = getFlag(ctx.args, "--icon");
3515
3520
  const linkEntryId = getFlag(ctx.args, "--link-entry");
@@ -3526,7 +3531,11 @@ async function runDocsCommand(ctx: CrmCliContext): Promise<void> {
3526
3531
  return;
3527
3532
  }
3528
3533
  case "link": {
3529
- const filePath = shift(ctx.args, "file path");
3534
+ const filePath = shiftName(
3535
+ ctx.args,
3536
+ "file path",
3537
+ "dench crm docs link <path> --object <name> --entry <id>",
3538
+ );
3530
3539
  const objectName = getFlag(ctx.args, "--object");
3531
3540
  const entryId = getFlag(ctx.args, "--entry");
3532
3541
  assertNoUnknownFlags(ctx.args, "crm docs link");
@@ -3540,6 +3549,12 @@ async function runDocsCommand(ctx: CrmCliContext): Promise<void> {
3540
3549
  );
3541
3550
  return;
3542
3551
  }
3552
+ case "delete": {
3553
+ const documentId = shift(ctx.args, "document id");
3554
+ assertNoUnknownFlags(ctx.args, "crm docs delete");
3555
+ out(ctx, await callMutation(ctx, api.documents.remove, { documentId }));
3556
+ return;
3557
+ }
3543
3558
  default:
3544
3559
  throw new CrmCliError(`Unknown crm docs verb: ${verb ?? "<none>"}`);
3545
3560
  }
@@ -5369,6 +5384,8 @@ Docs:
5369
5384
  dench crm docs list
5370
5385
  dench crm docs create <path> [--title ...] [--icon ...] [--link-entry <id>]
5371
5386
  dench crm docs link <path> --object <name> --entry <id>
5387
+ dench crm docs delete <documentId>
5388
+ Deletes the page; its workspace file stays and nested pages move up.
5372
5389
 
5373
5390
  Templates (one-click CRM setups: objects + automations + sample rows):
5374
5391
  dench crm templates list [--json]
@@ -4759,6 +4759,9 @@ export const requestSchemas: Record<string, ZodTypeAny> = {
4759
4759
  objectName: z.string().optional(),
4760
4760
  entryId: z.string().optional(),
4761
4761
  }),
4762
+ "crm.docs.delete": z.object({
4763
+ documentId: z.string().describe("The id crm docs create returned."),
4764
+ }),
4762
4765
  "crm.actions.list": z.object({ entryId: z.string() }),
4763
4766
  "crm.actions.create": z
4764
4767
  .object({
@@ -6264,6 +6267,7 @@ export const responseSchemas: Record<string, ZodTypeAny> = {
6264
6267
  ),
6265
6268
  "crm.docs.create": z.object({ id: z.string() }),
6266
6269
  "crm.docs.link": okResponse,
6270
+ "crm.docs.delete": okResponse,
6267
6271
  "crm.actions.list": z.array(
6268
6272
  z
6269
6273
  .object({
@@ -8056,6 +8060,7 @@ export const responseExamples: Record<string, unknown> = {
8056
8060
  ],
8057
8061
  "crm.docs.create": { id: "doc_q2notes" },
8058
8062
  "crm.docs.link": { ok: true },
8063
+ "crm.docs.delete": { ok: true },
8059
8064
  "crm.actions.list": [
8060
8065
  {
8061
8066
  _id: "arun_01",
@@ -276,6 +276,7 @@ export const APP_SDK_OPERATIONS: readonly AppSdkOperationInfo[] = [
276
276
  {"id":"crm.docs.list","group":"crm","summary":"List CRM documents.","cli":"dench crm docs list","method":"GET","path":"/crm/docs","permission":"crm:read","pathParams":[]},
277
277
  {"id":"crm.docs.create","group":"crm","summary":"Create a CRM document.","cli":"dench crm docs create","method":"POST","path":"/crm/docs","permission":"crm:write","pathParams":[]},
278
278
  {"id":"crm.docs.link","group":"crm","summary":"Link a CRM document.","cli":"dench crm docs link","method":"POST","path":"/crm/docs/link","permission":"crm:write","pathParams":[]},
279
+ {"id":"crm.docs.delete","group":"crm","summary":"Delete a CRM document page; its workspace file stays and nested pages move up.","cli":"dench crm docs delete","method":"DELETE","path":"/crm/docs/{documentId}","permission":"crm:write","pathParams":["documentId"]},
279
280
  {"id":"crm.actions.list","group":"crm","summary":"List CRM actions.","cli":"dench crm actions list","method":"GET","path":"/crm/actions","permission":"crm:read","pathParams":[]},
280
281
  {"id":"crm.actions.create","group":"crm","summary":"Create or upsert an action button on a named action column (fieldName is the column header; a column can hold multiple buttons — reuse fieldName to add more).","cli":"dench crm actions create","method":"POST","path":"/crm/actions","permission":"crm:write","pathParams":[]},
281
282
  {"id":"crm.actions.update","group":"crm","summary":"Update an action button on a CRM field.","cli":"dench crm actions edit","method":"PATCH","path":"/crm/actions/{actionId}","permission":"crm:write","pathParams":["actionId"]},
@@ -2858,6 +2858,18 @@ const rawApiOperations = [
2858
2858
  responseSchema: anyResponse,
2859
2859
  backend: convex("mutation", "functions/crm/documents:link"),
2860
2860
  }),
2861
+ op({
2862
+ id: "crm.docs.delete",
2863
+ group: "crm",
2864
+ summary:
2865
+ "Delete a CRM document page; its workspace file stays and nested pages move up.",
2866
+ cli: "dench crm docs delete",
2867
+ method: "DELETE",
2868
+ path: "/crm/docs/{documentId}",
2869
+ requestSchema: anyObject,
2870
+ responseSchema: anyResponse,
2871
+ backend: convex("mutation", "functions/crm/documents:remove"),
2872
+ }),
2861
2873
  op({
2862
2874
  id: "crm.actions.list",
2863
2875
  group: "crm",
@@ -1413,6 +1413,36 @@ export async function searchPeople(
1413
1413
  });
1414
1414
  }
1415
1415
 
1416
+ /**
1417
+ * Roughly how many people a people search matches (free; an estimate for
1418
+ * "N+ more", never the search's total). `scope: "roles"` counts only the
1419
+ * person side (roles, locations) when company filters can't be counted.
1420
+ * `null` when the source can't count.
1421
+ */
1422
+ export async function countPeople(
1423
+ body: SearchPeopleBody,
1424
+ options: EnrichmentGatewayOptions = {},
1425
+ ): Promise<{
1426
+ estimatedTotal: number | null;
1427
+ scope: "profile" | "roles" | null;
1428
+ }> {
1429
+ const response = await callGatewayJson("/v1/enrichment/people/count", {
1430
+ method: "POST",
1431
+ body: buildPeopleSearchRequest(body),
1432
+ options,
1433
+ });
1434
+ return {
1435
+ estimatedTotal:
1436
+ typeof response.estimatedTotal === "number"
1437
+ ? response.estimatedTotal
1438
+ : null,
1439
+ scope:
1440
+ response.scope === "profile" || response.scope === "roles"
1441
+ ? response.scope
1442
+ : null,
1443
+ };
1444
+ }
1445
+
1416
1446
  export async function searchCompanies(
1417
1447
  body: SearchCompaniesBody,
1418
1448
  options: EnrichmentGatewayOptions = {},