@mestra-dev/contract 0.0.182 → 0.0.183

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.d.ts +257 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -4623,6 +4623,99 @@ declare const routes: import("hono/hono-base").HonoBase<{
4623
4623
  };
4624
4624
  };
4625
4625
  };
4626
+ readonly TaskPhaseFunnelItem: {
4627
+ readonly type: "object";
4628
+ readonly required: readonly [
4629
+ "phaseId",
4630
+ "phaseName",
4631
+ "sortOrder",
4632
+ "taskCount",
4633
+ "visitCount",
4634
+ "averageDurationDays",
4635
+ "averageCurrentDurationDays"
4636
+ ];
4637
+ readonly properties: {
4638
+ readonly phaseId: {
4639
+ readonly type: "string";
4640
+ readonly format: "uuid";
4641
+ };
4642
+ readonly phaseName: {
4643
+ readonly type: "string";
4644
+ readonly description: "Workspace-defined task phase name.";
4645
+ };
4646
+ readonly sortOrder: {
4647
+ readonly type: "integer";
4648
+ readonly description: "Phase position in the workspace funnel.";
4649
+ };
4650
+ readonly taskCount: {
4651
+ readonly type: "integer";
4652
+ readonly description: "Tasks currently in this phase, optionally limited to tasks created in the reporting period.";
4653
+ };
4654
+ readonly visitCount: {
4655
+ readonly type: "integer";
4656
+ readonly description: "Recorded entries into this phase in the reporting period.";
4657
+ };
4658
+ readonly averageDurationDays: {
4659
+ readonly type: "number";
4660
+ readonly nullable: true;
4661
+ readonly description: "Average elapsed days for recorded phase visits. Active visits end at now, or at the to timestamp when supplied.";
4662
+ };
4663
+ readonly averageCurrentDurationDays: {
4664
+ readonly type: "number";
4665
+ readonly nullable: true;
4666
+ readonly description: "Average days that tasks currently in this phase have been there. Null when no tracked task is currently in the phase.";
4667
+ };
4668
+ };
4669
+ };
4670
+ readonly TaskPhaseFunnelAnalysisSuccess: {
4671
+ readonly type: "object";
4672
+ readonly required: readonly [
4673
+ "success",
4674
+ "workspaceId",
4675
+ "category",
4676
+ "period",
4677
+ "phases"
4678
+ ];
4679
+ readonly properties: {
4680
+ readonly success: {
4681
+ readonly type: "boolean";
4682
+ readonly const: true;
4683
+ };
4684
+ readonly workspaceId: {
4685
+ readonly type: "string";
4686
+ readonly format: "uuid";
4687
+ };
4688
+ readonly category: {
4689
+ readonly type: "string";
4690
+ readonly description: "Workspace category.";
4691
+ };
4692
+ readonly period: {
4693
+ readonly type: "object";
4694
+ readonly required: readonly [
4695
+ "from",
4696
+ "to"
4697
+ ];
4698
+ readonly properties: {
4699
+ readonly from: {
4700
+ readonly type: "string";
4701
+ readonly format: "date-time";
4702
+ readonly nullable: true;
4703
+ };
4704
+ readonly to: {
4705
+ readonly type: "string";
4706
+ readonly format: "date-time";
4707
+ readonly nullable: true;
4708
+ };
4709
+ };
4710
+ };
4711
+ readonly phases: {
4712
+ readonly type: "array";
4713
+ readonly items: {
4714
+ readonly $ref: "#/components/schemas/TaskPhaseFunnelItem";
4715
+ };
4716
+ };
4717
+ };
4718
+ };
4626
4719
  readonly CHistory: {
4627
4720
  readonly type: "object";
4628
4721
  readonly required: readonly [
@@ -13433,6 +13526,102 @@ declare const routes: import("hono/hono-base").HonoBase<{
13433
13526
  };
13434
13527
  };
13435
13528
  };
13529
+ readonly "/analytics/{workspace}/task-phase-funnel": {
13530
+ readonly get: {
13531
+ readonly tags: readonly [
13532
+ "Analytics"
13533
+ ];
13534
+ readonly summary: "Get real-estate task-phase funnel and durations";
13535
+ readonly description: "Returns the current task funnel and time-in-phase analytics for a real-estate workspace. taskCount is the number of tasks currently in each phase; when supplied, from and to limit it to tasks created in that period. visitCount and duration averages use phase entries recorded in the period. Active phase visits are measured through now, or through to when supplied. Tracking begins when this API version is deployed, so tasks that have not changed phase since then have no duration sample. Requires workspace access and read access to crm::analytics. Other workspace categories return 400.";
13536
+ readonly security: readonly [
13537
+ never
13538
+ ];
13539
+ readonly parameters: readonly [
13540
+ {
13541
+ readonly name: "workspace";
13542
+ readonly in: "path";
13543
+ readonly required: true;
13544
+ readonly schema: {
13545
+ readonly type: "string";
13546
+ readonly format: "uuid";
13547
+ };
13548
+ readonly description: "Workspace identifier.";
13549
+ },
13550
+ {
13551
+ readonly name: "from";
13552
+ readonly in: "query";
13553
+ readonly required: false;
13554
+ readonly schema: {
13555
+ readonly type: "string";
13556
+ readonly format: "date-time";
13557
+ };
13558
+ readonly description: "Include phase entries and tasks created at or after this timestamp.";
13559
+ },
13560
+ {
13561
+ readonly name: "to";
13562
+ readonly in: "query";
13563
+ readonly required: false;
13564
+ readonly schema: {
13565
+ readonly type: "string";
13566
+ readonly format: "date-time";
13567
+ };
13568
+ readonly description: "Include phase entries and tasks created before this timestamp; active durations are measured through this timestamp.";
13569
+ }
13570
+ ];
13571
+ readonly responses: {
13572
+ readonly 200: {
13573
+ readonly description: "Task-phase funnel fetched successfully.";
13574
+ readonly content: {
13575
+ readonly "application/json": {
13576
+ readonly schema: {
13577
+ readonly $ref: "#/components/schemas/TaskPhaseFunnelAnalysisSuccess";
13578
+ };
13579
+ };
13580
+ };
13581
+ };
13582
+ readonly 400: {
13583
+ readonly description: "Invalid query, invalid workspace ID, or unsupported workspace category.";
13584
+ readonly content: {
13585
+ readonly "application/json": {
13586
+ readonly schema: {
13587
+ readonly $ref: "#/components/schemas/ErrorResponse";
13588
+ };
13589
+ };
13590
+ };
13591
+ };
13592
+ readonly 401: {
13593
+ readonly description: "Unauthorized - Missing or invalid access token.";
13594
+ readonly content: {
13595
+ readonly "application/json": {
13596
+ readonly schema: {
13597
+ readonly $ref: "#/components/schemas/ErrorResponse";
13598
+ };
13599
+ };
13600
+ };
13601
+ };
13602
+ readonly 403: {
13603
+ readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks read access to crm::analytics resource.";
13604
+ readonly content: {
13605
+ readonly "application/json": {
13606
+ readonly schema: {
13607
+ readonly $ref: "#/components/schemas/ErrorResponse";
13608
+ };
13609
+ };
13610
+ };
13611
+ };
13612
+ readonly 404: {
13613
+ readonly description: "Workspace not found.";
13614
+ readonly content: {
13615
+ readonly "application/json": {
13616
+ readonly schema: {
13617
+ readonly $ref: "#/components/schemas/ErrorResponse";
13618
+ };
13619
+ };
13620
+ };
13621
+ };
13622
+ };
13623
+ };
13624
+ };
13436
13625
  readonly "/analytics/{workspace}/total-revenue": {
13437
13626
  readonly get: {
13438
13627
  readonly tags: readonly [
@@ -25926,6 +26115,74 @@ declare const routes: import("hono/hono-base").HonoBase<{
25926
26115
  };
25927
26116
  };
25928
26117
  }, "/payments"> | import("hono/types").MergeSchemaPath<{
26118
+ "/:workspace/task-phase-funnel": {
26119
+ $get: {
26120
+ input: {
26121
+ param: {
26122
+ workspace: string;
26123
+ };
26124
+ };
26125
+ output: {
26126
+ success: false;
26127
+ error: {
26128
+ [x: string]: import("hono/utils/types").JSONValue;
26129
+ };
26130
+ };
26131
+ outputFormat: "json";
26132
+ status: 400;
26133
+ } | {
26134
+ input: {
26135
+ param: {
26136
+ workspace: string;
26137
+ };
26138
+ };
26139
+ output: {
26140
+ success: false;
26141
+ error: string;
26142
+ };
26143
+ outputFormat: "json";
26144
+ status: 400;
26145
+ } | {
26146
+ input: {
26147
+ param: {
26148
+ workspace: string;
26149
+ };
26150
+ };
26151
+ output: {
26152
+ success: false;
26153
+ error: string;
26154
+ };
26155
+ outputFormat: "json";
26156
+ status: 404;
26157
+ } | {
26158
+ input: {
26159
+ param: {
26160
+ workspace: string;
26161
+ };
26162
+ };
26163
+ output: {
26164
+ success: true;
26165
+ workspaceId: string;
26166
+ category: string;
26167
+ period: {
26168
+ from: string | null;
26169
+ to: string | null;
26170
+ };
26171
+ phases: {
26172
+ averageDurationDays: number | null;
26173
+ averageCurrentDurationDays: number | null;
26174
+ phaseId: string;
26175
+ phaseName: string;
26176
+ sortOrder: number;
26177
+ taskCount: number;
26178
+ visitCount: number;
26179
+ }[];
26180
+ };
26181
+ outputFormat: "json";
26182
+ status: 200;
26183
+ };
26184
+ };
26185
+ } & {
25929
26186
  "/:workspace/total-revenue": {
25930
26187
  $get: {
25931
26188
  input: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.182",
3
+ "version": "0.0.183",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,