@vectora/contracts 1.0.0
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/LICENSE.md +25 -0
- package/dist/events/auth/index.d.ts +1 -0
- package/dist/events/auth/index.js +17 -0
- package/dist/events/auth/verification-request.interface.d.ts +5 -0
- package/dist/events/auth/verification-request.interface.js +2 -0
- package/dist/events/index.d.ts +1 -0
- package/dist/events/index.js +17 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +19 -0
- package/dist/proto/index.d.ts +1 -0
- package/dist/proto/index.js +17 -0
- package/dist/proto/paths.d.ts +18 -0
- package/dist/proto/paths.js +27 -0
- package/dist/utils/data-transformer.util.d.ts +55 -0
- package/dist/utils/data-transformer.util.js +141 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +17 -0
- package/gen/go/mapbox-direction-v1.pb.go +621 -0
- package/gen/go/mapbox-geocode-v1.pb.go +473 -0
- package/gen/go/mapbox-matrix-v1.pb.go +337 -0
- package/gen/go/mapbox-optimization-v1.pb.go +422 -0
- package/gen/go/mapbox-search-v1.pb.go +699 -0
- package/gen/ts/common-geocode-v1.ts +368 -0
- package/gen/ts/common-pagination-v1.ts +713 -0
- package/gen/ts/fleet-truck-v1.ts +1102 -0
- package/gen/ts/fleet-unit-v1.ts +9 -0
- package/gen/ts/google/protobuf/field_mask.ts +295 -0
- package/gen/ts/google/protobuf/wrappers.ts +544 -0
- package/gen/ts/identify-account-v1.ts +9 -0
- package/gen/ts/identify-auth-v1.ts +9 -0
- package/gen/ts/identify-company-v1.ts +1025 -0
- package/gen/ts/identify-role-v1.ts +9 -0
- package/gen/ts/identify-user-v1.ts +9 -0
- package/gen/ts/mapbox-direction-v1.ts +718 -0
- package/gen/ts/mapbox-geocode-v1.ts +511 -0
- package/gen/ts/mapbox-matrix-v1.ts +369 -0
- package/gen/ts/mapbox-optimization-v1.ts +472 -0
- package/gen/ts/mapbox-search-v1.ts +803 -0
- package/gen/ts/shipments-freight-v1.ts +9 -0
- package/gen/ts/shipments-loads-v1.ts +9 -0
- package/gen/ts/shipments-rate-v1.ts +9 -0
- package/gen/ts/shipments-stop-v1.ts +9 -0
- package/package.json +40 -0
- package/proto/common-geocode-v1.proto +10 -0
- package/proto/common-pagination-v1.proto +39 -0
- package/proto/fleet-truck-v1.proto +145 -0
- package/proto/fleet-unit-v1.proto +3 -0
- package/proto/identify-account-v1.proto +3 -0
- package/proto/identify-auth-v1.proto +3 -0
- package/proto/identify-company-v1.proto +114 -0
- package/proto/identify-role-v1.proto +3 -0
- package/proto/identify-user-v1.proto +3 -0
- package/proto/mapbox-direction-v1.proto +61 -0
- package/proto/mapbox-geocode-v1.proto +47 -0
- package/proto/mapbox-matrix-v1.proto +34 -0
- package/proto/mapbox-optimization-v1.proto +43 -0
- package/proto/mapbox-search-v1.proto +68 -0
- package/proto/shipments-freight-v1.proto +3 -0
- package/proto/shipments-loads-v1.proto +3 -0
- package/proto/shipments-rate-v1.proto +3 -0
- package/proto/shipments-stop-v1.proto +3 -0
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vectora/contracts",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Shared TypeSafe contracts, Protobuf definitions, and DTOs for Vectora OS cross-service communication.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc -p tsconfig.build.json",
|
|
10
|
+
"format": "prettier --write \"gen/**/*.ts\" \"proto/**/*.proto\"",
|
|
11
|
+
"generate:dir": "node -e \"const fs = require('fs'); fs.mkdirSync('gen/ts', { recursive: true }); fs.mkdirSync('gen/go', { recursive: true });\"",
|
|
12
|
+
"generate:ts": "protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./gen/ts --ts_proto_opt=esModuleInterop=true,outputJsonMethods=false --proto_path=./proto proto/*.proto",
|
|
13
|
+
"generate:go": "protoc --go_out=./gen/go --go_opt=paths=source_relative --proto_path=./proto proto/mapbox-*.proto",
|
|
14
|
+
"generate": "yarn generate:dir && yarn generate:ts && (yarn generate:go || true)"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"proto",
|
|
18
|
+
"gen",
|
|
19
|
+
"dist",
|
|
20
|
+
"LICENSE.md",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
27
|
+
"author": "Vectora Inc.",
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
|
|
30
|
+
"@types/node": "^25.2.3",
|
|
31
|
+
"@vectora/core": "^1.0.0",
|
|
32
|
+
"prettier": "latest",
|
|
33
|
+
"typescript": "^5.9.3"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@nestjs/microservices": "^11.1.13",
|
|
37
|
+
"rxjs": "^7.8.2",
|
|
38
|
+
"ts-proto": "^2.11.2"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
package common_geocode.v1;
|
|
3
|
+
|
|
4
|
+
option go_package = "github.com/vectora-os/contracts/gen/go/common;common_geocode_v1";
|
|
5
|
+
|
|
6
|
+
message Point { repeated double values = 1; }
|
|
7
|
+
message Coordinates { double longitude = 1; double latitude = 2; }
|
|
8
|
+
message Geometry { string type = 1; repeated double coordinates = 2; }
|
|
9
|
+
message LineString { string type = 1; repeated Point coordinates = 2; }
|
|
10
|
+
message ContextItem { string id = 1; string text = 2; optional string short_code = 3; }
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package common_pagination.v1;
|
|
4
|
+
message PaginateQuery {
|
|
5
|
+
optional int32 page = 1;
|
|
6
|
+
optional int32 limit = 2;
|
|
7
|
+
optional string search = 3;
|
|
8
|
+
optional string path = 4;
|
|
9
|
+
repeated string sort_by = 5;
|
|
10
|
+
map<string, string> filter = 6;
|
|
11
|
+
repeated string select = 7;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message PaginateMeta {
|
|
15
|
+
int32 items_per_page = 1;
|
|
16
|
+
int32 total_items = 2;
|
|
17
|
+
int32 current_page = 3;
|
|
18
|
+
int32 total_pages = 4;
|
|
19
|
+
|
|
20
|
+
repeated string sort_by = 5;
|
|
21
|
+
map<string, string> filter = 6;
|
|
22
|
+
|
|
23
|
+
message Links {
|
|
24
|
+
string first = 1;
|
|
25
|
+
string previous = 2;
|
|
26
|
+
string current = 3;
|
|
27
|
+
string next = 4;
|
|
28
|
+
string last = 5;
|
|
29
|
+
}
|
|
30
|
+
Links links = 7;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message FilterQuery {
|
|
34
|
+
optional string search = 1;
|
|
35
|
+
optional string path = 2;
|
|
36
|
+
repeated string sort_by = 3;
|
|
37
|
+
map<string, string> filter = 4;
|
|
38
|
+
repeated string select = 5;
|
|
39
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package truck.v1;
|
|
4
|
+
|
|
5
|
+
import "common-pagination-v1.proto";
|
|
6
|
+
import "google/protobuf/wrappers.proto";
|
|
7
|
+
import "google/protobuf/field_mask.proto";
|
|
8
|
+
|
|
9
|
+
// --- Enums ---
|
|
10
|
+
|
|
11
|
+
enum TruckDock {
|
|
12
|
+
TRUCK_DOCK_UNSPECIFIED = 0;
|
|
13
|
+
TRUCK_DOCK_NO = 1;
|
|
14
|
+
TRUCK_DOCK_RA = 2;
|
|
15
|
+
TRUCK_DOCK_LG = 3;
|
|
16
|
+
TRUCK_DOCK_TR = 4;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
enum TruckType {
|
|
20
|
+
TRUCK_TYPE_UNSPECIFIED = 0;
|
|
21
|
+
TRUCK_TYPE_CV = 1;
|
|
22
|
+
TRUCK_TYPE_SV = 2;
|
|
23
|
+
TRUCK_TYPE_SV_REF = 3;
|
|
24
|
+
TRUCK_TYPE_SS = 4;
|
|
25
|
+
TRUCK_TYPE_SS_REF = 5;
|
|
26
|
+
TRUCK_TYPE_LS = 6;
|
|
27
|
+
TRUCK_TYPE_LS_REF = 7;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
enum TruckEquipment {
|
|
31
|
+
TRUCK_EQUIPMENT_UNSPECIFIED = 0;
|
|
32
|
+
TRUCK_EQUIPMENT_LG = 1; // Liftgate
|
|
33
|
+
TRUCK_EQUIPMENT_PJ = 2; // Pallet Jack
|
|
34
|
+
TRUCK_EQUIPMENT_AR = 3; // Air Ride
|
|
35
|
+
TRUCK_EQUIPMENT_DL = 4; // Dolly
|
|
36
|
+
TRUCK_EQUIPMENT_ST = 5; // Straps
|
|
37
|
+
TRUCK_EQUIPMENT_BL = 6; // Blankets
|
|
38
|
+
TRUCK_EQUIPMENT_LB = 7; // Load Bars
|
|
39
|
+
TRUCK_EQUIPMENT_TP = 8; // Tarps
|
|
40
|
+
TRUCK_EQUIPMENT_ETW = 9; // Walls E-Track
|
|
41
|
+
TRUCK_EQUIPMENT_FTW = 10; // Floor E-Track
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// --- Service ---
|
|
45
|
+
service TrucksService {
|
|
46
|
+
// Creating one truck
|
|
47
|
+
rpc Create(CreateTruckRequest) returns (TruckResponse);
|
|
48
|
+
|
|
49
|
+
// Updating one truck by "id"
|
|
50
|
+
rpc Update(UpdateTruckRequest) returns (TruckResponse);
|
|
51
|
+
|
|
52
|
+
// Getting one truck by "id"
|
|
53
|
+
rpc GetOne(GetOneTruckRequest) returns (TruckResponse);
|
|
54
|
+
|
|
55
|
+
// Getting paginated response
|
|
56
|
+
rpc GetAllPaginated (common_pagination.v1.PaginateQuery) returns (TruckPaginatedResponse);
|
|
57
|
+
|
|
58
|
+
// Getting not paginated response
|
|
59
|
+
rpc GetAllNotPaginated (common_pagination.v1.FilterQuery) returns (TruckNotPaginatedResponse);
|
|
60
|
+
|
|
61
|
+
// Delete one truck by "id"
|
|
62
|
+
rpc Delete(DeleteTruckRequest) returns (DeleteTruckResponse);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// --- Messages ---
|
|
66
|
+
|
|
67
|
+
message CreateTruckRequest {
|
|
68
|
+
string make = 1;
|
|
69
|
+
string model = 2;
|
|
70
|
+
google.protobuf.Int32Value year = 3;
|
|
71
|
+
string vin = 4;
|
|
72
|
+
google.protobuf.StringValue plate = 5;
|
|
73
|
+
google.protobuf.StringValue plate_state = 6;
|
|
74
|
+
|
|
75
|
+
int32 length = 7;
|
|
76
|
+
int32 width = 8;
|
|
77
|
+
int32 height = 9;
|
|
78
|
+
int32 door_width = 10;
|
|
79
|
+
int32 door_height = 11;
|
|
80
|
+
|
|
81
|
+
int32 capacity = 12;
|
|
82
|
+
|
|
83
|
+
TruckDock dock_high = 13;
|
|
84
|
+
TruckType type = 14;
|
|
85
|
+
|
|
86
|
+
// Wrapper for equipment to distinguish null (not received) from [] (clear)
|
|
87
|
+
message EquipmentInput {
|
|
88
|
+
repeated TruckEquipment items = 1;
|
|
89
|
+
}
|
|
90
|
+
optional EquipmentInput equipment = 15;
|
|
91
|
+
|
|
92
|
+
string company = 16;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
message UpdateTruckRequest {
|
|
96
|
+
// Inside the truck, the id must be filled in.
|
|
97
|
+
TruckResponse truck = 1;
|
|
98
|
+
// The mask determines which fields from truck we save in the database.
|
|
99
|
+
google.protobuf.FieldMask update_mask = 2;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
message TruckResponse {
|
|
103
|
+
string id = 1;
|
|
104
|
+
string make = 2;
|
|
105
|
+
string model = 3;
|
|
106
|
+
google.protobuf.Int32Value year = 4;
|
|
107
|
+
string vin = 5;
|
|
108
|
+
google.protobuf.StringValue plate = 6;
|
|
109
|
+
google.protobuf.StringValue plate_state = 7;
|
|
110
|
+
|
|
111
|
+
int32 length = 8;
|
|
112
|
+
int32 width = 9;
|
|
113
|
+
int32 height = 10;
|
|
114
|
+
int32 door_width = 11;
|
|
115
|
+
int32 door_height = 12;
|
|
116
|
+
|
|
117
|
+
int32 capacity = 13;
|
|
118
|
+
|
|
119
|
+
TruckDock dock_high = 14;
|
|
120
|
+
TruckType type = 15;
|
|
121
|
+
|
|
122
|
+
repeated TruckEquipment equipment = 16;
|
|
123
|
+
string company = 17;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
message GetOneTruckRequest {
|
|
127
|
+
string id = 1;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
message TruckPaginatedResponse {
|
|
131
|
+
repeated TruckResponse data = 1;
|
|
132
|
+
common_pagination.v1.PaginateMeta meta = 2;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
message TruckNotPaginatedResponse {
|
|
136
|
+
repeated TruckResponse data = 1;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
message DeleteTruckRequest {
|
|
140
|
+
string id = 1;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
message DeleteTruckResponse {
|
|
144
|
+
bool success = 1;
|
|
145
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package company.v1;
|
|
4
|
+
|
|
5
|
+
import "common-pagination-v1.proto";
|
|
6
|
+
import "google/protobuf/wrappers.proto";
|
|
7
|
+
import "google/protobuf/field_mask.proto";
|
|
8
|
+
|
|
9
|
+
// --- Enums ---
|
|
10
|
+
enum CompanyType {
|
|
11
|
+
COMPANY_TYPE_UNSPECIFIED = 0;
|
|
12
|
+
COMPANY_TYPE_CUSTOMER = 1;
|
|
13
|
+
COMPANY_TYPE_CONTRACTOR = 2;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
enum CompanyStatus {
|
|
17
|
+
COMPANY_STATUS_UNSPECIFIED = 0;
|
|
18
|
+
COMPANY_STATUS_ONBOARDING = 1;
|
|
19
|
+
COMPANY_STATUS_PENDING = 2;
|
|
20
|
+
COMPANY_STATUS_ACTIVE = 3;
|
|
21
|
+
COMPANY_STATUS_SUSPECTED = 4;
|
|
22
|
+
COMPANY_STATUS_REJECTED = 5;
|
|
23
|
+
COMPANY_STATUS_BLOCKED = 6;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// --- Service ---
|
|
27
|
+
service CompaniesService {
|
|
28
|
+
// Creating one company
|
|
29
|
+
rpc Create(CreateCompanyRequest) returns (CompanyResponse);
|
|
30
|
+
// Updating one company by "id"
|
|
31
|
+
rpc Update(UpdateCompanyRequest) returns (CompanyResponse);
|
|
32
|
+
// Updating one company's status by "id"
|
|
33
|
+
rpc UpdateStatus(UpdateCompanyRequest) returns (CompanyResponse);
|
|
34
|
+
// Getting one company by "id"
|
|
35
|
+
rpc GetOne(GetOneCompanyRequest) returns (CompanyResponse);
|
|
36
|
+
// Getting paginated response
|
|
37
|
+
rpc GetAllPaginated (common_pagination.v1.PaginateQuery) returns (CompanyPaginatedResponse);
|
|
38
|
+
// Getting not paginated response
|
|
39
|
+
rpc GetAllNotPaginated (common_pagination.v1.FilterQuery) returns (CompanyNotPaginatedResponse);
|
|
40
|
+
// Delete one company by "id"
|
|
41
|
+
rpc Delete(DeleteCompanyRequest) returns (DeleteCompanyResponse);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// --- Messages ---
|
|
45
|
+
|
|
46
|
+
message CreateCompanyRequest {
|
|
47
|
+
string legal_name = 1;
|
|
48
|
+
google.protobuf.StringValue dba_name = 2;
|
|
49
|
+
google.protobuf.StringValue mc_number = 3;
|
|
50
|
+
google.protobuf.StringValue dot_number = 4;
|
|
51
|
+
CompanyType type = 5;
|
|
52
|
+
CompanyStatus status = 6;
|
|
53
|
+
string address = 7;
|
|
54
|
+
string city = 8;
|
|
55
|
+
string state = 9;
|
|
56
|
+
string zip = 10;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
message UpdateCompanyRequest {
|
|
60
|
+
string id = 1;
|
|
61
|
+
// Поля, которые разрешено обновлять
|
|
62
|
+
optional string legal_name = 2;
|
|
63
|
+
google.protobuf.StringValue dba_name = 3;
|
|
64
|
+
google.protobuf.StringValue mc_number = 4;
|
|
65
|
+
google.protobuf.StringValue dot_number = 5;
|
|
66
|
+
optional CompanyType type = 6;
|
|
67
|
+
optional string address = 7;
|
|
68
|
+
optional string city = 8;
|
|
69
|
+
optional string state = 9;
|
|
70
|
+
optional string zip = 10;
|
|
71
|
+
|
|
72
|
+
// Маска для частичного обновления
|
|
73
|
+
google.protobuf.FieldMask update_mask = 11;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
message UpdateCompanyStatusRequest {
|
|
77
|
+
string id = 1;
|
|
78
|
+
CompanyStatus status = 2;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
message CompanyResponse {
|
|
82
|
+
string id = 1;
|
|
83
|
+
string legal_name = 2;
|
|
84
|
+
google.protobuf.StringValue dba_name = 3;
|
|
85
|
+
google.protobuf.StringValue mc_number = 4;
|
|
86
|
+
google.protobuf.StringValue dot_number = 5;
|
|
87
|
+
CompanyType type = 6;
|
|
88
|
+
CompanyStatus status = 7;
|
|
89
|
+
string address = 8;
|
|
90
|
+
string city = 9;
|
|
91
|
+
string state = 10;
|
|
92
|
+
string zip = 11;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
message GetOneCompanyRequest {
|
|
96
|
+
string id = 1;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
message CompanyPaginatedResponse {
|
|
100
|
+
repeated CompanyResponse data = 1;
|
|
101
|
+
common_pagination.v1.PaginateMeta meta = 2;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
message CompanyNotPaginatedResponse {
|
|
105
|
+
repeated CompanyResponse data = 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
message DeleteCompanyRequest {
|
|
109
|
+
string id = 1;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
message DeleteCompanyResponse {
|
|
113
|
+
bool success = 1;
|
|
114
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package directions.v1;
|
|
4
|
+
|
|
5
|
+
import "common-geocode-v1.proto";
|
|
6
|
+
|
|
7
|
+
option go_package = "github.com/vectora-os/contracts/gen/go/directions;directions_v1";
|
|
8
|
+
|
|
9
|
+
service DirectionsService {
|
|
10
|
+
rpc GetRoute (DirectionsRequest) returns (DirectionsResponse);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
message DirectionsRequest {
|
|
14
|
+
repeated common_geocode.v1.Point coordinates = 1;
|
|
15
|
+
string profile = 2;
|
|
16
|
+
bool steps = 3;
|
|
17
|
+
string geometries = 4;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
message DirectionsResponse {
|
|
21
|
+
repeated Route routes = 1;
|
|
22
|
+
repeated Waypoint waypoints = 2;
|
|
23
|
+
string code = 3;
|
|
24
|
+
string uuid = 4;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message Route {
|
|
28
|
+
repeated RouteLeg legs = 1;
|
|
29
|
+
double distance = 2;
|
|
30
|
+
double duration = 3;
|
|
31
|
+
common_geocode.v1.LineString geometry = 4;
|
|
32
|
+
string weight_name = 5;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message RouteLeg {
|
|
36
|
+
repeated RouteStep steps = 1;
|
|
37
|
+
double distance = 2;
|
|
38
|
+
double duration = 3;
|
|
39
|
+
string summary = 4;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message RouteStep {
|
|
43
|
+
Maneuver maneuver = 1;
|
|
44
|
+
string name = 2;
|
|
45
|
+
double distance = 3;
|
|
46
|
+
double duration = 4;
|
|
47
|
+
string mode = 5;
|
|
48
|
+
string driving_side = 6;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message Maneuver {
|
|
52
|
+
string type = 1;
|
|
53
|
+
string instruction = 2;
|
|
54
|
+
repeated double location = 3;
|
|
55
|
+
optional string modifier = 4;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
message Waypoint {
|
|
59
|
+
string name = 1;
|
|
60
|
+
repeated double location = 2;
|
|
61
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package geocode.v1;
|
|
4
|
+
|
|
5
|
+
import "common-geocode-v1.proto";
|
|
6
|
+
|
|
7
|
+
option go_package = "github.com/vectora-os/contracts/gen/go/geocode;geocode_v1";
|
|
8
|
+
|
|
9
|
+
service GeocodingService {
|
|
10
|
+
rpc ForwardGeocoding (ForwardGeocodingRequest) returns (GeocodingResponse);
|
|
11
|
+
rpc ReverseGeocoding (ReverseGeocodingRequest) returns (GeocodingResponse);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message ForwardGeocodingRequest {
|
|
15
|
+
string query = 1;
|
|
16
|
+
repeated string types = 2;
|
|
17
|
+
optional int32 limit = 3;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
message ReverseGeocodingRequest {
|
|
21
|
+
double longitude = 1;
|
|
22
|
+
double latitude = 2;
|
|
23
|
+
repeated string types = 3;
|
|
24
|
+
optional int32 limit = 4;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message GeocodingResponse {
|
|
28
|
+
string type = 1;
|
|
29
|
+
repeated string query = 2;
|
|
30
|
+
repeated GeocodingFeature features = 3;
|
|
31
|
+
string attribution = 4;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message GeocodingFeature {
|
|
35
|
+
string id = 1;
|
|
36
|
+
string type = 2;
|
|
37
|
+
string place_name = 3;
|
|
38
|
+
GeocodingProperties properties = 4;
|
|
39
|
+
common_geocode.v1.Geometry geometry = 5;
|
|
40
|
+
repeated common_geocode.v1.ContextItem context = 6;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
message GeocodingProperties {
|
|
44
|
+
optional string mapbox_id = 1;
|
|
45
|
+
optional string wikidata = 2;
|
|
46
|
+
optional string address = 3;
|
|
47
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package matrix.v1;
|
|
4
|
+
|
|
5
|
+
import "common-geocode-v1.proto";
|
|
6
|
+
|
|
7
|
+
option go_package = "github.com/vectora-os/contracts/gen/go/matrix;matrix_v1";
|
|
8
|
+
|
|
9
|
+
service MatrixService {
|
|
10
|
+
rpc GetMatrix (MatrixRequest) returns (MatrixResponse);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
message MatrixRequest {
|
|
14
|
+
repeated common_geocode.v1.Point coordinates = 1;
|
|
15
|
+
string profile = 2;
|
|
16
|
+
repeated string annotations = 3;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message MatrixResponse {
|
|
20
|
+
string code = 1;
|
|
21
|
+
repeated MatrixRow durations = 2;
|
|
22
|
+
repeated MatrixRow distances = 3;
|
|
23
|
+
repeated MatrixWaypoint destinations = 4;
|
|
24
|
+
repeated MatrixWaypoint sources = 5;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message MatrixRow {
|
|
28
|
+
repeated double values = 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
message MatrixWaypoint {
|
|
32
|
+
string name = 1;
|
|
33
|
+
repeated double location = 2;
|
|
34
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package optimization.v1;
|
|
4
|
+
|
|
5
|
+
import "common-geocode-v1.proto";
|
|
6
|
+
import "mapbox-direction-v1.proto";
|
|
7
|
+
|
|
8
|
+
option go_package = "github.com/vectora-os/contracts/gen/go/optimization;optimization_v1";
|
|
9
|
+
|
|
10
|
+
service OptimizationService {
|
|
11
|
+
rpc GetOptimizedRoute (OptimizationRequest) returns (OptimizationResponse);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message OptimizationRequest {
|
|
15
|
+
repeated common_geocode.v1.Point coordinates = 1;
|
|
16
|
+
string profile = 2;
|
|
17
|
+
optional bool roundtrip = 3;
|
|
18
|
+
optional string source = 4;
|
|
19
|
+
optional string destination = 5;
|
|
20
|
+
optional string geometries = 6;
|
|
21
|
+
optional bool steps = 7;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message OptimizationResponse {
|
|
25
|
+
string code = 1;
|
|
26
|
+
repeated OptimizationWaypoint waypoints = 2;
|
|
27
|
+
repeated OptimizationTrip trips = 3;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message OptimizationTrip {
|
|
31
|
+
common_geocode.v1.LineString geometry = 1;
|
|
32
|
+
repeated directions.v1.RouteLeg legs = 2;
|
|
33
|
+
double distance = 3;
|
|
34
|
+
double duration = 4;
|
|
35
|
+
double weight = 5;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message OptimizationWaypoint {
|
|
39
|
+
string name = 1;
|
|
40
|
+
repeated double location = 2;
|
|
41
|
+
int32 waypoint_index = 3;
|
|
42
|
+
int32 trips_index = 4;
|
|
43
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package search.v1;
|
|
4
|
+
|
|
5
|
+
import "common-geocode-v1.proto";
|
|
6
|
+
|
|
7
|
+
option go_package = "github.com/vectora-os/contracts/gen/go/search;search_v1";
|
|
8
|
+
|
|
9
|
+
service SearchService {
|
|
10
|
+
rpc Suggest (SearchSuggestRequest) returns (SearchSuggestResponse);
|
|
11
|
+
rpc Retrieve (SearchRetrieveRequest) returns (SearchRetrieveResponse);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message SearchSuggestRequest {
|
|
15
|
+
string q = 1;
|
|
16
|
+
optional string session_token = 2;
|
|
17
|
+
optional int32 limit = 3;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
message SearchSuggestResponse {
|
|
21
|
+
repeated SearchSuggestion suggestions = 1;
|
|
22
|
+
string attribution = 2;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message SearchSuggestion {
|
|
26
|
+
string name = 1;
|
|
27
|
+
string mapbox_id = 2;
|
|
28
|
+
string feature_type = 3;
|
|
29
|
+
string place_name = 4;
|
|
30
|
+
SearchContext context = 5;
|
|
31
|
+
string language = 6;
|
|
32
|
+
optional string maki = 7;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message SearchRetrieveResponse {
|
|
36
|
+
string type = 1;
|
|
37
|
+
repeated SearchFeature features = 2;
|
|
38
|
+
string attribution = 3;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message SearchFeature {
|
|
42
|
+
string id = 1;
|
|
43
|
+
string type = 2;
|
|
44
|
+
common_geocode.v1.Geometry geometry = 3;
|
|
45
|
+
FeatureProperties properties = 4;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message FeatureProperties {
|
|
49
|
+
string name = 1;
|
|
50
|
+
string mapbox_id = 2;
|
|
51
|
+
string full_address = 3;
|
|
52
|
+
SearchContext context = 4;
|
|
53
|
+
common_geocode.v1.Coordinates coordinates = 5;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message SearchContext {
|
|
57
|
+
common_geocode.v1.ContextItem country = 1;
|
|
58
|
+
common_geocode.v1.ContextItem region = 2;
|
|
59
|
+
common_geocode.v1.ContextItem postcode = 3;
|
|
60
|
+
common_geocode.v1.ContextItem place = 4;
|
|
61
|
+
common_geocode.v1.ContextItem neighborhood = 5;
|
|
62
|
+
common_geocode.v1.ContextItem street = 6;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
message SearchRetrieveRequest {
|
|
66
|
+
string mapbox_id = 1;
|
|
67
|
+
string session_token = 2;
|
|
68
|
+
}
|