@mestra-dev/contract 0.0.183 → 0.0.184
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 +260 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4458,6 +4458,103 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
4458
4458
|
};
|
|
4459
4459
|
};
|
|
4460
4460
|
};
|
|
4461
|
+
readonly ChannelPerformanceTotal: {
|
|
4462
|
+
readonly type: "object";
|
|
4463
|
+
readonly required: readonly [
|
|
4464
|
+
"leadSource",
|
|
4465
|
+
"currency",
|
|
4466
|
+
"paidAmountMinor",
|
|
4467
|
+
"paidInvoiceCount",
|
|
4468
|
+
"pendingAmountMinor",
|
|
4469
|
+
"pendingInvoiceCount"
|
|
4470
|
+
];
|
|
4471
|
+
readonly properties: {
|
|
4472
|
+
readonly leadSource: {
|
|
4473
|
+
readonly type: "string";
|
|
4474
|
+
readonly enum: readonly [
|
|
4475
|
+
"cian",
|
|
4476
|
+
"avito",
|
|
4477
|
+
"vk",
|
|
4478
|
+
"yandex",
|
|
4479
|
+
"website",
|
|
4480
|
+
"referral",
|
|
4481
|
+
"walk_in",
|
|
4482
|
+
"unattributed"
|
|
4483
|
+
];
|
|
4484
|
+
readonly description: "Lead acquisition source, or unattributed when no source was recorded.";
|
|
4485
|
+
};
|
|
4486
|
+
readonly currency: {
|
|
4487
|
+
readonly type: "string";
|
|
4488
|
+
readonly description: "Invoice currency.";
|
|
4489
|
+
};
|
|
4490
|
+
readonly paidAmountMinor: {
|
|
4491
|
+
readonly type: "integer";
|
|
4492
|
+
readonly description: "Paid invoice revenue in minor units after discount, excluding VAT.";
|
|
4493
|
+
};
|
|
4494
|
+
readonly paidInvoiceCount: {
|
|
4495
|
+
readonly type: "integer";
|
|
4496
|
+
readonly description: "Number of paid invoices included in the total.";
|
|
4497
|
+
};
|
|
4498
|
+
readonly pendingAmountMinor: {
|
|
4499
|
+
readonly type: "integer";
|
|
4500
|
+
readonly description: "Pending invoice value in minor units after discount, excluding VAT.";
|
|
4501
|
+
};
|
|
4502
|
+
readonly pendingInvoiceCount: {
|
|
4503
|
+
readonly type: "integer";
|
|
4504
|
+
readonly description: "Number of pending invoices included in the total.";
|
|
4505
|
+
};
|
|
4506
|
+
};
|
|
4507
|
+
};
|
|
4508
|
+
readonly ChannelPerformanceAnalysisSuccess: {
|
|
4509
|
+
readonly type: "object";
|
|
4510
|
+
readonly required: readonly [
|
|
4511
|
+
"success",
|
|
4512
|
+
"workspaceId",
|
|
4513
|
+
"category",
|
|
4514
|
+
"period",
|
|
4515
|
+
"channels"
|
|
4516
|
+
];
|
|
4517
|
+
readonly properties: {
|
|
4518
|
+
readonly success: {
|
|
4519
|
+
readonly type: "boolean";
|
|
4520
|
+
readonly const: true;
|
|
4521
|
+
};
|
|
4522
|
+
readonly workspaceId: {
|
|
4523
|
+
readonly type: "string";
|
|
4524
|
+
readonly format: "uuid";
|
|
4525
|
+
};
|
|
4526
|
+
readonly category: {
|
|
4527
|
+
readonly type: "string";
|
|
4528
|
+
readonly description: "Workspace category.";
|
|
4529
|
+
};
|
|
4530
|
+
readonly period: {
|
|
4531
|
+
readonly type: "object";
|
|
4532
|
+
readonly required: readonly [
|
|
4533
|
+
"from",
|
|
4534
|
+
"to"
|
|
4535
|
+
];
|
|
4536
|
+
readonly properties: {
|
|
4537
|
+
readonly from: {
|
|
4538
|
+
readonly type: "string";
|
|
4539
|
+
readonly format: "date-time";
|
|
4540
|
+
readonly nullable: true;
|
|
4541
|
+
};
|
|
4542
|
+
readonly to: {
|
|
4543
|
+
readonly type: "string";
|
|
4544
|
+
readonly format: "date-time";
|
|
4545
|
+
readonly nullable: true;
|
|
4546
|
+
};
|
|
4547
|
+
};
|
|
4548
|
+
};
|
|
4549
|
+
readonly channels: {
|
|
4550
|
+
readonly type: "array";
|
|
4551
|
+
readonly items: {
|
|
4552
|
+
readonly $ref: "#/components/schemas/ChannelPerformanceTotal";
|
|
4553
|
+
};
|
|
4554
|
+
readonly description: "Revenue grouped by lead source and invoice currency. Empty when no paid or pending invoices match the period.";
|
|
4555
|
+
};
|
|
4556
|
+
};
|
|
4557
|
+
};
|
|
4461
4558
|
readonly ConversionRateAnalysisSuccess: {
|
|
4462
4559
|
readonly type: "object";
|
|
4463
4560
|
readonly required: readonly [
|
|
@@ -13814,6 +13911,102 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
13814
13911
|
};
|
|
13815
13912
|
};
|
|
13816
13913
|
};
|
|
13914
|
+
readonly "/analytics/{workspace}/channel-performance": {
|
|
13915
|
+
readonly get: {
|
|
13916
|
+
readonly tags: readonly [
|
|
13917
|
+
"Analytics"
|
|
13918
|
+
];
|
|
13919
|
+
readonly summary: "Get real-estate channel performance";
|
|
13920
|
+
readonly description: "Returns paid and pending CInvoice revenue grouped by the linked customer's acquisition source and invoice currency. Paid invoices are filtered by paidAt; pending invoices are filtered by invoice date; both period bounds are from inclusive and to exclusive. Amounts are post-discount minor units and exclude VAT. Customers without a recorded source are grouped as unattributed. Soft-deleted invoices and customers, plus cancelled and refunded invoices, are excluded. Requires workspace access and read access to crm::analytics. Other workspace categories return 400.";
|
|
13921
|
+
readonly security: readonly [
|
|
13922
|
+
never
|
|
13923
|
+
];
|
|
13924
|
+
readonly parameters: readonly [
|
|
13925
|
+
{
|
|
13926
|
+
readonly name: "workspace";
|
|
13927
|
+
readonly in: "path";
|
|
13928
|
+
readonly required: true;
|
|
13929
|
+
readonly schema: {
|
|
13930
|
+
readonly type: "string";
|
|
13931
|
+
readonly format: "uuid";
|
|
13932
|
+
};
|
|
13933
|
+
readonly description: "Workspace identifier.";
|
|
13934
|
+
},
|
|
13935
|
+
{
|
|
13936
|
+
readonly name: "from";
|
|
13937
|
+
readonly in: "query";
|
|
13938
|
+
readonly required: false;
|
|
13939
|
+
readonly schema: {
|
|
13940
|
+
readonly type: "string";
|
|
13941
|
+
readonly format: "date-time";
|
|
13942
|
+
};
|
|
13943
|
+
readonly description: "Include pending invoices dated and paid invoices paid at or after this timestamp.";
|
|
13944
|
+
},
|
|
13945
|
+
{
|
|
13946
|
+
readonly name: "to";
|
|
13947
|
+
readonly in: "query";
|
|
13948
|
+
readonly required: false;
|
|
13949
|
+
readonly schema: {
|
|
13950
|
+
readonly type: "string";
|
|
13951
|
+
readonly format: "date-time";
|
|
13952
|
+
};
|
|
13953
|
+
readonly description: "Include pending invoices dated and paid invoices paid before this timestamp.";
|
|
13954
|
+
}
|
|
13955
|
+
];
|
|
13956
|
+
readonly responses: {
|
|
13957
|
+
readonly 200: {
|
|
13958
|
+
readonly description: "Channel performance fetched successfully.";
|
|
13959
|
+
readonly content: {
|
|
13960
|
+
readonly "application/json": {
|
|
13961
|
+
readonly schema: {
|
|
13962
|
+
readonly $ref: "#/components/schemas/ChannelPerformanceAnalysisSuccess";
|
|
13963
|
+
};
|
|
13964
|
+
};
|
|
13965
|
+
};
|
|
13966
|
+
};
|
|
13967
|
+
readonly 400: {
|
|
13968
|
+
readonly description: "Invalid query, invalid workspace ID, or unsupported workspace category.";
|
|
13969
|
+
readonly content: {
|
|
13970
|
+
readonly "application/json": {
|
|
13971
|
+
readonly schema: {
|
|
13972
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
13973
|
+
};
|
|
13974
|
+
};
|
|
13975
|
+
};
|
|
13976
|
+
};
|
|
13977
|
+
readonly 401: {
|
|
13978
|
+
readonly description: "Unauthorized - Missing or invalid access token.";
|
|
13979
|
+
readonly content: {
|
|
13980
|
+
readonly "application/json": {
|
|
13981
|
+
readonly schema: {
|
|
13982
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
13983
|
+
};
|
|
13984
|
+
};
|
|
13985
|
+
};
|
|
13986
|
+
};
|
|
13987
|
+
readonly 403: {
|
|
13988
|
+
readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks read access to crm::analytics resource.";
|
|
13989
|
+
readonly content: {
|
|
13990
|
+
readonly "application/json": {
|
|
13991
|
+
readonly schema: {
|
|
13992
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
13993
|
+
};
|
|
13994
|
+
};
|
|
13995
|
+
};
|
|
13996
|
+
};
|
|
13997
|
+
readonly 404: {
|
|
13998
|
+
readonly description: "Workspace not found.";
|
|
13999
|
+
readonly content: {
|
|
14000
|
+
readonly "application/json": {
|
|
14001
|
+
readonly schema: {
|
|
14002
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
14003
|
+
};
|
|
14004
|
+
};
|
|
14005
|
+
};
|
|
14006
|
+
};
|
|
14007
|
+
};
|
|
14008
|
+
};
|
|
14009
|
+
};
|
|
13817
14010
|
readonly "/analytics/{workspace}/conversion-rate": {
|
|
13818
14011
|
readonly get: {
|
|
13819
14012
|
readonly tags: readonly [
|
|
@@ -26371,6 +26564,73 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
26371
26564
|
status: 200;
|
|
26372
26565
|
};
|
|
26373
26566
|
};
|
|
26567
|
+
} & {
|
|
26568
|
+
"/:workspace/channel-performance": {
|
|
26569
|
+
$get: {
|
|
26570
|
+
input: {
|
|
26571
|
+
param: {
|
|
26572
|
+
workspace: string;
|
|
26573
|
+
};
|
|
26574
|
+
};
|
|
26575
|
+
output: {
|
|
26576
|
+
success: false;
|
|
26577
|
+
error: {
|
|
26578
|
+
[x: string]: import("hono/utils/types").JSONValue;
|
|
26579
|
+
};
|
|
26580
|
+
};
|
|
26581
|
+
outputFormat: "json";
|
|
26582
|
+
status: 400;
|
|
26583
|
+
} | {
|
|
26584
|
+
input: {
|
|
26585
|
+
param: {
|
|
26586
|
+
workspace: string;
|
|
26587
|
+
};
|
|
26588
|
+
};
|
|
26589
|
+
output: {
|
|
26590
|
+
success: false;
|
|
26591
|
+
error: string;
|
|
26592
|
+
};
|
|
26593
|
+
outputFormat: "json";
|
|
26594
|
+
status: 400;
|
|
26595
|
+
} | {
|
|
26596
|
+
input: {
|
|
26597
|
+
param: {
|
|
26598
|
+
workspace: string;
|
|
26599
|
+
};
|
|
26600
|
+
};
|
|
26601
|
+
output: {
|
|
26602
|
+
success: false;
|
|
26603
|
+
error: string;
|
|
26604
|
+
};
|
|
26605
|
+
outputFormat: "json";
|
|
26606
|
+
status: 404;
|
|
26607
|
+
} | {
|
|
26608
|
+
input: {
|
|
26609
|
+
param: {
|
|
26610
|
+
workspace: string;
|
|
26611
|
+
};
|
|
26612
|
+
};
|
|
26613
|
+
output: {
|
|
26614
|
+
success: true;
|
|
26615
|
+
workspaceId: string;
|
|
26616
|
+
category: string;
|
|
26617
|
+
period: {
|
|
26618
|
+
from: string | null;
|
|
26619
|
+
to: string | null;
|
|
26620
|
+
};
|
|
26621
|
+
channels: {
|
|
26622
|
+
leadSource: string;
|
|
26623
|
+
currency: string;
|
|
26624
|
+
paidAmountMinor: number;
|
|
26625
|
+
paidInvoiceCount: number;
|
|
26626
|
+
pendingAmountMinor: number;
|
|
26627
|
+
pendingInvoiceCount: number;
|
|
26628
|
+
}[];
|
|
26629
|
+
};
|
|
26630
|
+
outputFormat: "json";
|
|
26631
|
+
status: 200;
|
|
26632
|
+
};
|
|
26633
|
+
};
|
|
26374
26634
|
} & {
|
|
26375
26635
|
"/:workspace/forecast-revenue": {
|
|
26376
26636
|
$get: {
|