@mestra-dev/contract 0.0.185 → 0.0.186

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 +261 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -4719,6 +4719,103 @@ declare const routes: import("hono/hono-base").HonoBase<{
4719
4719
  };
4720
4720
  };
4721
4721
  };
4722
+ readonly WorkloadDistributionEmployee: {
4723
+ readonly type: "object";
4724
+ readonly required: readonly [
4725
+ "collaboratorId",
4726
+ "userId",
4727
+ "firstName",
4728
+ "lastName",
4729
+ "profilePicture",
4730
+ "status",
4731
+ "taskCount"
4732
+ ];
4733
+ readonly properties: {
4734
+ readonly collaboratorId: {
4735
+ readonly type: "string";
4736
+ readonly format: "uuid";
4737
+ readonly description: "Workspace collaborator identifier.";
4738
+ };
4739
+ readonly userId: {
4740
+ readonly type: "string";
4741
+ readonly format: "uuid";
4742
+ readonly description: "Underlying user identifier.";
4743
+ };
4744
+ readonly firstName: {
4745
+ readonly type: "string";
4746
+ readonly nullable: true;
4747
+ readonly description: "Collaborator first name.";
4748
+ };
4749
+ readonly lastName: {
4750
+ readonly type: "string";
4751
+ readonly nullable: true;
4752
+ readonly description: "Collaborator last name.";
4753
+ };
4754
+ readonly profilePicture: {
4755
+ readonly type: "string";
4756
+ readonly nullable: true;
4757
+ readonly description: "Collaborator profile image URL.";
4758
+ };
4759
+ readonly status: {
4760
+ readonly type: "string";
4761
+ readonly description: "Collaborator status, including active or inactive states.";
4762
+ };
4763
+ readonly taskCount: {
4764
+ readonly type: "integer";
4765
+ readonly description: "Distinct tasks assigned to this collaborator in the reporting period.";
4766
+ };
4767
+ };
4768
+ };
4769
+ readonly WorkloadDistributionAnalysisSuccess: {
4770
+ readonly type: "object";
4771
+ readonly required: readonly [
4772
+ "success",
4773
+ "workspaceId",
4774
+ "category",
4775
+ "period",
4776
+ "employees"
4777
+ ];
4778
+ readonly properties: {
4779
+ readonly success: {
4780
+ readonly type: "boolean";
4781
+ readonly const: true;
4782
+ };
4783
+ readonly workspaceId: {
4784
+ readonly type: "string";
4785
+ readonly format: "uuid";
4786
+ };
4787
+ readonly category: {
4788
+ readonly type: "string";
4789
+ readonly description: "Workspace category.";
4790
+ };
4791
+ readonly period: {
4792
+ readonly type: "object";
4793
+ readonly required: readonly [
4794
+ "from",
4795
+ "to"
4796
+ ];
4797
+ readonly properties: {
4798
+ readonly from: {
4799
+ readonly type: "string";
4800
+ readonly format: "date-time";
4801
+ readonly nullable: true;
4802
+ };
4803
+ readonly to: {
4804
+ readonly type: "string";
4805
+ readonly format: "date-time";
4806
+ readonly nullable: true;
4807
+ };
4808
+ };
4809
+ };
4810
+ readonly employees: {
4811
+ readonly type: "array";
4812
+ readonly items: {
4813
+ readonly $ref: "#/components/schemas/WorkloadDistributionEmployee";
4814
+ };
4815
+ readonly description: "All workspace collaborators, ordered by assigned task count descending.";
4816
+ };
4817
+ };
4818
+ };
4722
4819
  readonly ForecastRevenueTotal: {
4723
4820
  readonly type: "object";
4724
4821
  readonly required: readonly [
@@ -14306,6 +14403,102 @@ declare const routes: import("hono/hono-base").HonoBase<{
14306
14403
  };
14307
14404
  };
14308
14405
  };
14406
+ readonly "/analytics/{workspace}/workload-distribution": {
14407
+ readonly get: {
14408
+ readonly tags: readonly [
14409
+ "Analytics"
14410
+ ];
14411
+ readonly summary: "Get real-estate workload distribution";
14412
+ readonly description: "Returns every workspace collaborator with their distinct assigned-task count, ordered from highest to lowest workload. Tasks are filtered by creation time when a reporting period is supplied (from inclusive, to exclusive). A task assigned to several collaborators contributes once to each assignee's workload. Requires workspace access and read access to crm::analytics. Other workspace categories return 400.";
14413
+ readonly security: readonly [
14414
+ never
14415
+ ];
14416
+ readonly parameters: readonly [
14417
+ {
14418
+ readonly name: "workspace";
14419
+ readonly in: "path";
14420
+ readonly required: true;
14421
+ readonly schema: {
14422
+ readonly type: "string";
14423
+ readonly format: "uuid";
14424
+ };
14425
+ readonly description: "Workspace identifier.";
14426
+ },
14427
+ {
14428
+ readonly name: "from";
14429
+ readonly in: "query";
14430
+ readonly required: false;
14431
+ readonly schema: {
14432
+ readonly type: "string";
14433
+ readonly format: "date-time";
14434
+ };
14435
+ readonly description: "Include tasks created at or after this timestamp.";
14436
+ },
14437
+ {
14438
+ readonly name: "to";
14439
+ readonly in: "query";
14440
+ readonly required: false;
14441
+ readonly schema: {
14442
+ readonly type: "string";
14443
+ readonly format: "date-time";
14444
+ };
14445
+ readonly description: "Include tasks created before this timestamp.";
14446
+ }
14447
+ ];
14448
+ readonly responses: {
14449
+ readonly 200: {
14450
+ readonly description: "Workload distribution fetched successfully.";
14451
+ readonly content: {
14452
+ readonly "application/json": {
14453
+ readonly schema: {
14454
+ readonly $ref: "#/components/schemas/WorkloadDistributionAnalysisSuccess";
14455
+ };
14456
+ };
14457
+ };
14458
+ };
14459
+ readonly 400: {
14460
+ readonly description: "Invalid query, invalid workspace ID, or unsupported workspace category.";
14461
+ readonly content: {
14462
+ readonly "application/json": {
14463
+ readonly schema: {
14464
+ readonly $ref: "#/components/schemas/ErrorResponse";
14465
+ };
14466
+ };
14467
+ };
14468
+ };
14469
+ readonly 401: {
14470
+ readonly description: "Unauthorized - Missing or invalid access token.";
14471
+ readonly content: {
14472
+ readonly "application/json": {
14473
+ readonly schema: {
14474
+ readonly $ref: "#/components/schemas/ErrorResponse";
14475
+ };
14476
+ };
14477
+ };
14478
+ };
14479
+ readonly 403: {
14480
+ readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks read access to crm::analytics resource.";
14481
+ readonly content: {
14482
+ readonly "application/json": {
14483
+ readonly schema: {
14484
+ readonly $ref: "#/components/schemas/ErrorResponse";
14485
+ };
14486
+ };
14487
+ };
14488
+ };
14489
+ readonly 404: {
14490
+ readonly description: "Workspace not found.";
14491
+ readonly content: {
14492
+ readonly "application/json": {
14493
+ readonly schema: {
14494
+ readonly $ref: "#/components/schemas/ErrorResponse";
14495
+ };
14496
+ };
14497
+ };
14498
+ };
14499
+ };
14500
+ };
14501
+ };
14309
14502
  readonly "/analytics/{workspace}/forecast-revenue": {
14310
14503
  readonly get: {
14311
14504
  readonly tags: readonly [
@@ -26837,6 +27030,74 @@ declare const routes: import("hono/hono-base").HonoBase<{
26837
27030
  status: 200;
26838
27031
  };
26839
27032
  };
27033
+ } & {
27034
+ "/:workspace/workload-distribution": {
27035
+ $get: {
27036
+ input: {
27037
+ param: {
27038
+ workspace: string;
27039
+ };
27040
+ };
27041
+ output: {
27042
+ success: false;
27043
+ error: {
27044
+ [x: string]: import("hono/utils/types").JSONValue;
27045
+ };
27046
+ };
27047
+ outputFormat: "json";
27048
+ status: 400;
27049
+ } | {
27050
+ input: {
27051
+ param: {
27052
+ workspace: string;
27053
+ };
27054
+ };
27055
+ output: {
27056
+ success: false;
27057
+ error: string;
27058
+ };
27059
+ outputFormat: "json";
27060
+ status: 400;
27061
+ } | {
27062
+ input: {
27063
+ param: {
27064
+ workspace: string;
27065
+ };
27066
+ };
27067
+ output: {
27068
+ success: false;
27069
+ error: string;
27070
+ };
27071
+ outputFormat: "json";
27072
+ status: 404;
27073
+ } | {
27074
+ input: {
27075
+ param: {
27076
+ workspace: string;
27077
+ };
27078
+ };
27079
+ output: {
27080
+ success: true;
27081
+ workspaceId: string;
27082
+ category: string;
27083
+ period: {
27084
+ from: string | null;
27085
+ to: string | null;
27086
+ };
27087
+ employees: {
27088
+ taskCount: number;
27089
+ collaboratorId: string;
27090
+ userId: string;
27091
+ firstName: string | null;
27092
+ lastName: string | null;
27093
+ profilePicture: string | null;
27094
+ status: string;
27095
+ }[];
27096
+ };
27097
+ outputFormat: "json";
27098
+ status: 200;
27099
+ };
27100
+ };
26840
27101
  } & {
26841
27102
  "/:workspace/channel-performance": {
26842
27103
  $get: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.185",
3
+ "version": "0.0.186",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,