@mestra-dev/contract 0.0.184 → 0.0.185
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/dist/index.d.ts +273 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4612,6 +4612,113 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
4612
4612
|
};
|
|
4613
4613
|
};
|
|
4614
4614
|
};
|
|
4615
|
+
readonly EmployeeConversionRate: {
|
|
4616
|
+
readonly type: "object";
|
|
4617
|
+
readonly required: readonly [
|
|
4618
|
+
"collaboratorId",
|
|
4619
|
+
"userId",
|
|
4620
|
+
"firstName",
|
|
4621
|
+
"lastName",
|
|
4622
|
+
"profilePicture",
|
|
4623
|
+
"status",
|
|
4624
|
+
"assignedCustomerCount",
|
|
4625
|
+
"convertedCustomerCount",
|
|
4626
|
+
"conversionRate"
|
|
4627
|
+
];
|
|
4628
|
+
readonly properties: {
|
|
4629
|
+
readonly collaboratorId: {
|
|
4630
|
+
readonly type: "string";
|
|
4631
|
+
readonly format: "uuid";
|
|
4632
|
+
readonly description: "Workspace collaborator identifier.";
|
|
4633
|
+
};
|
|
4634
|
+
readonly userId: {
|
|
4635
|
+
readonly type: "string";
|
|
4636
|
+
readonly format: "uuid";
|
|
4637
|
+
readonly description: "Underlying user identifier.";
|
|
4638
|
+
};
|
|
4639
|
+
readonly firstName: {
|
|
4640
|
+
readonly type: "string";
|
|
4641
|
+
readonly nullable: true;
|
|
4642
|
+
readonly description: "Collaborator first name.";
|
|
4643
|
+
};
|
|
4644
|
+
readonly lastName: {
|
|
4645
|
+
readonly type: "string";
|
|
4646
|
+
readonly nullable: true;
|
|
4647
|
+
readonly description: "Collaborator last name.";
|
|
4648
|
+
};
|
|
4649
|
+
readonly profilePicture: {
|
|
4650
|
+
readonly type: "string";
|
|
4651
|
+
readonly nullable: true;
|
|
4652
|
+
readonly description: "Collaborator profile image URL.";
|
|
4653
|
+
};
|
|
4654
|
+
readonly status: {
|
|
4655
|
+
readonly type: "string";
|
|
4656
|
+
readonly description: "Collaborator status, including active or inactive states.";
|
|
4657
|
+
};
|
|
4658
|
+
readonly assignedCustomerCount: {
|
|
4659
|
+
readonly type: "integer";
|
|
4660
|
+
readonly description: "Distinct non-deleted customers linked to this collaborator's qualifying tasks.";
|
|
4661
|
+
};
|
|
4662
|
+
readonly convertedCustomerCount: {
|
|
4663
|
+
readonly type: "integer";
|
|
4664
|
+
readonly description: "Assigned customers with at least one qualifying paid CInvoice.";
|
|
4665
|
+
};
|
|
4666
|
+
readonly conversionRate: {
|
|
4667
|
+
readonly type: "number";
|
|
4668
|
+
readonly description: "Converted customers divided by assigned customers, expressed as a percentage.";
|
|
4669
|
+
};
|
|
4670
|
+
};
|
|
4671
|
+
};
|
|
4672
|
+
readonly EmployeeConversionRateAnalysisSuccess: {
|
|
4673
|
+
readonly type: "object";
|
|
4674
|
+
readonly required: readonly [
|
|
4675
|
+
"success",
|
|
4676
|
+
"workspaceId",
|
|
4677
|
+
"category",
|
|
4678
|
+
"period",
|
|
4679
|
+
"employees"
|
|
4680
|
+
];
|
|
4681
|
+
readonly properties: {
|
|
4682
|
+
readonly success: {
|
|
4683
|
+
readonly type: "boolean";
|
|
4684
|
+
readonly const: true;
|
|
4685
|
+
};
|
|
4686
|
+
readonly workspaceId: {
|
|
4687
|
+
readonly type: "string";
|
|
4688
|
+
readonly format: "uuid";
|
|
4689
|
+
};
|
|
4690
|
+
readonly category: {
|
|
4691
|
+
readonly type: "string";
|
|
4692
|
+
readonly description: "Workspace category.";
|
|
4693
|
+
};
|
|
4694
|
+
readonly period: {
|
|
4695
|
+
readonly type: "object";
|
|
4696
|
+
readonly required: readonly [
|
|
4697
|
+
"from",
|
|
4698
|
+
"to"
|
|
4699
|
+
];
|
|
4700
|
+
readonly properties: {
|
|
4701
|
+
readonly from: {
|
|
4702
|
+
readonly type: "string";
|
|
4703
|
+
readonly format: "date-time";
|
|
4704
|
+
readonly nullable: true;
|
|
4705
|
+
};
|
|
4706
|
+
readonly to: {
|
|
4707
|
+
readonly type: "string";
|
|
4708
|
+
readonly format: "date-time";
|
|
4709
|
+
readonly nullable: true;
|
|
4710
|
+
};
|
|
4711
|
+
};
|
|
4712
|
+
};
|
|
4713
|
+
readonly employees: {
|
|
4714
|
+
readonly type: "array";
|
|
4715
|
+
readonly items: {
|
|
4716
|
+
readonly $ref: "#/components/schemas/EmployeeConversionRate";
|
|
4717
|
+
};
|
|
4718
|
+
readonly description: "Active and inactive collaborators with at least one task linked to a customer.";
|
|
4719
|
+
};
|
|
4720
|
+
};
|
|
4721
|
+
};
|
|
4615
4722
|
readonly ForecastRevenueTotal: {
|
|
4616
4723
|
readonly type: "object";
|
|
4617
4724
|
readonly required: readonly [
|
|
@@ -14103,6 +14210,102 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
14103
14210
|
};
|
|
14104
14211
|
};
|
|
14105
14212
|
};
|
|
14213
|
+
readonly "/analytics/{workspace}/employee-conversion-rate": {
|
|
14214
|
+
readonly get: {
|
|
14215
|
+
readonly tags: readonly [
|
|
14216
|
+
"Analytics"
|
|
14217
|
+
];
|
|
14218
|
+
readonly summary: "Get real-estate employee conversion rates";
|
|
14219
|
+
readonly description: "Returns a customer-level conversion rate for each active or inactive collaborator with at least one qualifying task linked to a non-deleted real-estate customer. Assigned customers are distinct customers on the collaborator's tasks created within the optional period. A converted customer has at least one non-deleted paid CInvoice in the period. When several collaborators worked on the same customer, each receives full credit; multiple tasks or invoices for that customer do not increase counts. The rate is zero when a returned collaborator has no assigned customers after filtering. Requires workspace access and read access to crm::analytics. Other workspace categories return 400.";
|
|
14220
|
+
readonly security: readonly [
|
|
14221
|
+
never
|
|
14222
|
+
];
|
|
14223
|
+
readonly parameters: readonly [
|
|
14224
|
+
{
|
|
14225
|
+
readonly name: "workspace";
|
|
14226
|
+
readonly in: "path";
|
|
14227
|
+
readonly required: true;
|
|
14228
|
+
readonly schema: {
|
|
14229
|
+
readonly type: "string";
|
|
14230
|
+
readonly format: "uuid";
|
|
14231
|
+
};
|
|
14232
|
+
readonly description: "Workspace identifier.";
|
|
14233
|
+
},
|
|
14234
|
+
{
|
|
14235
|
+
readonly name: "from";
|
|
14236
|
+
readonly in: "query";
|
|
14237
|
+
readonly required: false;
|
|
14238
|
+
readonly schema: {
|
|
14239
|
+
readonly type: "string";
|
|
14240
|
+
readonly format: "date-time";
|
|
14241
|
+
};
|
|
14242
|
+
readonly description: "Include tasks created and CInvoices paid at or after this timestamp.";
|
|
14243
|
+
},
|
|
14244
|
+
{
|
|
14245
|
+
readonly name: "to";
|
|
14246
|
+
readonly in: "query";
|
|
14247
|
+
readonly required: false;
|
|
14248
|
+
readonly schema: {
|
|
14249
|
+
readonly type: "string";
|
|
14250
|
+
readonly format: "date-time";
|
|
14251
|
+
};
|
|
14252
|
+
readonly description: "Include tasks created and CInvoices paid before this timestamp.";
|
|
14253
|
+
}
|
|
14254
|
+
];
|
|
14255
|
+
readonly responses: {
|
|
14256
|
+
readonly 200: {
|
|
14257
|
+
readonly description: "Employee conversion rates fetched successfully.";
|
|
14258
|
+
readonly content: {
|
|
14259
|
+
readonly "application/json": {
|
|
14260
|
+
readonly schema: {
|
|
14261
|
+
readonly $ref: "#/components/schemas/EmployeeConversionRateAnalysisSuccess";
|
|
14262
|
+
};
|
|
14263
|
+
};
|
|
14264
|
+
};
|
|
14265
|
+
};
|
|
14266
|
+
readonly 400: {
|
|
14267
|
+
readonly description: "Invalid query, invalid workspace ID, or unsupported workspace category.";
|
|
14268
|
+
readonly content: {
|
|
14269
|
+
readonly "application/json": {
|
|
14270
|
+
readonly schema: {
|
|
14271
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
14272
|
+
};
|
|
14273
|
+
};
|
|
14274
|
+
};
|
|
14275
|
+
};
|
|
14276
|
+
readonly 401: {
|
|
14277
|
+
readonly description: "Unauthorized - Missing or invalid access token.";
|
|
14278
|
+
readonly content: {
|
|
14279
|
+
readonly "application/json": {
|
|
14280
|
+
readonly schema: {
|
|
14281
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
14282
|
+
};
|
|
14283
|
+
};
|
|
14284
|
+
};
|
|
14285
|
+
};
|
|
14286
|
+
readonly 403: {
|
|
14287
|
+
readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks read access to crm::analytics resource.";
|
|
14288
|
+
readonly content: {
|
|
14289
|
+
readonly "application/json": {
|
|
14290
|
+
readonly schema: {
|
|
14291
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
14292
|
+
};
|
|
14293
|
+
};
|
|
14294
|
+
};
|
|
14295
|
+
};
|
|
14296
|
+
readonly 404: {
|
|
14297
|
+
readonly description: "Workspace not found.";
|
|
14298
|
+
readonly content: {
|
|
14299
|
+
readonly "application/json": {
|
|
14300
|
+
readonly schema: {
|
|
14301
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
14302
|
+
};
|
|
14303
|
+
};
|
|
14304
|
+
};
|
|
14305
|
+
};
|
|
14306
|
+
};
|
|
14307
|
+
};
|
|
14308
|
+
};
|
|
14106
14309
|
readonly "/analytics/{workspace}/forecast-revenue": {
|
|
14107
14310
|
readonly get: {
|
|
14108
14311
|
readonly tags: readonly [
|
|
@@ -26564,6 +26767,76 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
26564
26767
|
status: 200;
|
|
26565
26768
|
};
|
|
26566
26769
|
};
|
|
26770
|
+
} & {
|
|
26771
|
+
"/:workspace/employee-conversion-rate": {
|
|
26772
|
+
$get: {
|
|
26773
|
+
input: {
|
|
26774
|
+
param: {
|
|
26775
|
+
workspace: string;
|
|
26776
|
+
};
|
|
26777
|
+
};
|
|
26778
|
+
output: {
|
|
26779
|
+
success: false;
|
|
26780
|
+
error: {
|
|
26781
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
26782
|
+
};
|
|
26783
|
+
};
|
|
26784
|
+
outputFormat: "json";
|
|
26785
|
+
status: 400;
|
|
26786
|
+
} | {
|
|
26787
|
+
input: {
|
|
26788
|
+
param: {
|
|
26789
|
+
workspace: string;
|
|
26790
|
+
};
|
|
26791
|
+
};
|
|
26792
|
+
output: {
|
|
26793
|
+
success: false;
|
|
26794
|
+
error: string;
|
|
26795
|
+
};
|
|
26796
|
+
outputFormat: "json";
|
|
26797
|
+
status: 400;
|
|
26798
|
+
} | {
|
|
26799
|
+
input: {
|
|
26800
|
+
param: {
|
|
26801
|
+
workspace: string;
|
|
26802
|
+
};
|
|
26803
|
+
};
|
|
26804
|
+
output: {
|
|
26805
|
+
success: false;
|
|
26806
|
+
error: string;
|
|
26807
|
+
};
|
|
26808
|
+
outputFormat: "json";
|
|
26809
|
+
status: 404;
|
|
26810
|
+
} | {
|
|
26811
|
+
input: {
|
|
26812
|
+
param: {
|
|
26813
|
+
workspace: string;
|
|
26814
|
+
};
|
|
26815
|
+
};
|
|
26816
|
+
output: {
|
|
26817
|
+
success: true;
|
|
26818
|
+
workspaceId: string;
|
|
26819
|
+
category: string;
|
|
26820
|
+
period: {
|
|
26821
|
+
from: string | null;
|
|
26822
|
+
to: string | null;
|
|
26823
|
+
};
|
|
26824
|
+
employees: {
|
|
26825
|
+
collaboratorId: string;
|
|
26826
|
+
userId: string;
|
|
26827
|
+
firstName: string | null;
|
|
26828
|
+
lastName: string | null;
|
|
26829
|
+
profilePicture: string | null;
|
|
26830
|
+
status: string;
|
|
26831
|
+
assignedCustomerCount: number;
|
|
26832
|
+
convertedCustomerCount: number;
|
|
26833
|
+
conversionRate: number;
|
|
26834
|
+
}[];
|
|
26835
|
+
};
|
|
26836
|
+
outputFormat: "json";
|
|
26837
|
+
status: 200;
|
|
26838
|
+
};
|
|
26839
|
+
};
|
|
26567
26840
|
} & {
|
|
26568
26841
|
"/:workspace/channel-performance": {
|
|
26569
26842
|
$get: {
|