@restorecommerce/protos 0.4.11 → 0.5.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/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.5.0](https://github.com/restorecommerce/libs/compare/@restorecommerce/protos@0.4.11...@restorecommerce/protos@0.5.0) (2022-01-28)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **fix generated interfaces: convert snake_case to camelcase:** snake_case to camelCase ([bf78c27](https://github.com/restorecommerce/libs/commit/bf78c27a1e776d716c711c0b633acd7609ca4561))
12
+
13
+
14
+ ### Features
15
+
16
+ * **add protos for fulfillment-product solution proposals:** packsol ([ce6f78f](https://github.com/restorecommerce/libs/commit/ce6f78f34a39924aa30c50857ad751b9ac3be396))
17
+
18
+
19
+ ### BREAKING CHANGES
20
+
21
+ * **add protos for fulfillment-product solution proposals:** fulfillment.proto, fulfillment-courier.proto and fulfillment-product.proto have
22
+ changed completely
23
+
24
+
25
+
26
+
27
+
6
28
  ## [0.4.11](https://github.com/restorecommerce/libs/compare/@restorecommerce/protos@0.4.10...@restorecommerce/protos@0.4.11) (2021-12-09)
7
29
 
8
30
 
@@ -6,9 +6,9 @@ import "google/protobuf/any.proto";
6
6
  import "io/restorecommerce/resource_base.proto";
7
7
  import "io/restorecommerce/auth.proto";
8
8
  import "io/restorecommerce/status.proto";
9
+ import "io/restorecommerce/meta.proto";
9
10
  import "io/restorecommerce/address.proto";
10
11
  import "io/restorecommerce/country.proto";
11
- import "io/restorecommerce/meta.proto";
12
12
 
13
13
  /**
14
14
  Microservice definition.
@@ -20,25 +20,10 @@ service Service {
20
20
  rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (FulfillmentResponseList);
21
21
 
22
22
  /**
23
- Creates but does not execute fulfillment orders
23
+ Creates and executes fulfillment orders
24
24
  */
25
25
  rpc Create (FulfillmentRequestList) returns (FulfillmentResponseList);
26
26
 
27
- /**
28
- Updates but does not execute fulfillment orders
29
- */
30
- rpc Update (FulfillmentRequestList) returns (FulfillmentResponseList);
31
-
32
- /**
33
- Upserts but does not execute fulfillment orders
34
- */
35
- rpc Upsert (FulfillmentRequestList) returns (FulfillmentResponseList);
36
-
37
- /**
38
- Executes and Upserts fulfillment orders
39
- */
40
- rpc Order (FulfillmentRequestList) returns (FulfillmentResponseList);
41
-
42
27
  /**
43
28
  Track a batch of fulfillment orders
44
29
  */
@@ -47,7 +32,7 @@ service Service {
47
32
  /**
48
33
  Cancel a batch of fulfillment orders
49
34
  */
50
- rpc Cancel (CancelRequestList) returns (CancelResultList);
35
+ rpc Cancel (CancelRequestList) returns (FulfillmentResponseList);
51
36
 
52
37
  /**
53
38
  Delete a batch of fulfillments from the database
@@ -56,17 +41,13 @@ service Service {
56
41
  }
57
42
 
58
43
  enum State {
59
- Incomplete = 0;
60
- Ordered = 1;
61
- Processing = 2;
62
- Done=3;
63
- Cancelled = 4;
64
- Failed = 5;
65
- }
66
-
67
- message Origin {
68
- string country = 1;
69
- string iso_code = 2;
44
+ Undefined = 0;
45
+ Invalid = 1;
46
+ Ordered = 2;
47
+ Shipping = 3;
48
+ Done= 4;
49
+ Cancelled = 5;
50
+ Failed = 6;
70
51
  }
71
52
 
72
53
  message Contact {
@@ -76,13 +57,15 @@ message Contact {
76
57
  }
77
58
 
78
59
  message Branch {
79
- string branch_number = 1;
80
- string post_number = 2;
60
+ string provider = 1;
61
+ string branch_number = 2;
62
+ string post_number = 3;
81
63
  }
82
64
 
83
65
  message Packstation {
84
- string station_number = 1;
85
- string post_number = 2;
66
+ string provider = 1;
67
+ string station_number = 2;
68
+ string post_number = 3;
86
69
  }
87
70
 
88
71
  message Address {
@@ -98,17 +81,25 @@ message Address {
98
81
  }
99
82
 
100
83
  message Parcel {
101
- int32 quantity = 1;
102
- float weight = 2;
103
- float height = 3;
104
- float width = 4;
105
- float length = 5;
84
+ message Item {
85
+ string item_id = 1;
86
+ int32 quantity = 2;
87
+ }
88
+
89
+ string product_id = 1;
90
+ string product_variant_id = 2;
91
+ repeated Item items = 3;
92
+ float weight_in_kg = 4;
93
+ float height_in_cm = 5;
94
+ float width_in_cm = 6;
95
+ float length_in_cm = 7;
106
96
  }
107
97
 
108
98
  message Order {
109
- repeated Parcel parcels = 1;
110
- Address sender = 2;
111
- Address receiver = 3;
99
+ string reference_id = 1;
100
+ repeated Parcel parcels = 2;
101
+ Address sender = 3;
102
+ Address receiver = 4;
112
103
  string notify = 5;
113
104
  }
114
105
 
@@ -118,24 +109,15 @@ message Label {
118
109
  string pdf = 2;
119
110
  string png = 3;
120
111
  }
121
- string shipment_id = 4; //filled on Order
112
+ string shipment_number = 4; //filled on Order
122
113
  State state = 5; //update by Track
123
114
  io.restorecommerce.status.Status status = 6; //API status
124
115
  }
125
116
 
126
- message Event {
127
- io.restorecommerce.status.Status status = 1;
128
- string timestamp = 2;
129
- string location = 3;
130
- google.protobuf.Any details = 4;
131
- }
132
-
133
117
  message FulfillmentRequest {
134
118
  string id = 1;
135
- string courier_id = 2;
136
- string product_id = 3;
137
- Order order = 4;
138
- io.restorecommerce.meta.Meta meta = 5;
119
+ Order order = 2;
120
+ io.restorecommerce.meta.Meta meta = 3;
139
121
  }
140
122
 
141
123
  message FulfillmentRequestList {
@@ -149,11 +131,10 @@ This is the message how it get stored to the database
149
131
  */
150
132
  message Fulfillment {
151
133
  string id = 1;
152
- string courier_id = 2;
153
- string product_id = 3;
154
- Order order = 4;
155
- io.restorecommerce.meta.Meta meta = 5;
156
- Label label = 6; //filled on Order
134
+ Order order = 2;
135
+ io.restorecommerce.meta.Meta meta = 3;
136
+ repeated Label labels = 4; //filled by service
137
+ bool fulfilled = 5;
157
138
  }
158
139
 
159
140
  message FulfillmentResponse {
@@ -168,8 +149,9 @@ message FulfillmentResponseList {
168
149
  }
169
150
 
170
151
  message TrackingRequest {
171
- string order_id = 1;
172
- google.protobuf.Any options = 2;
152
+ string fulfillment_id = 1;
153
+ repeated string shipment_numbers = 2; //optional
154
+ google.protobuf.Any options = 3;
173
155
  }
174
156
 
175
157
  message TrackingRequestList {
@@ -177,15 +159,28 @@ message TrackingRequestList {
177
159
  io.restorecommerce.auth.Subject subject = 2;
178
160
  }
179
161
 
180
- message Tracking {
181
- string fulfillment_id = 1;
182
- repeated Event events = 2;
162
+ message Event {
163
+ int64 timestamp = 1;
164
+ string location = 2;
183
165
  google.protobuf.Any details = 3;
184
166
  io.restorecommerce.status.Status status = 4;
185
167
  }
186
168
 
169
+ message Tracking {
170
+ string shipment_number = 1;
171
+ repeated Event events = 3;
172
+ google.protobuf.Any details = 4;
173
+ io.restorecommerce.status.Status status = 5;
174
+ }
175
+
176
+ message TrackingResult {
177
+ Fulfillment fulfillment = 1;
178
+ repeated Tracking tracks = 2;
179
+ io.restorecommerce.status.Status status = 3;
180
+ }
181
+
187
182
  message TrackingResultList {
188
- repeated Tracking items = 1;
183
+ repeated TrackingResult items = 1;
189
184
  io.restorecommerce.status.OperationStatus operation_status = 2;
190
185
  }
191
186
 
@@ -194,11 +189,6 @@ message CancelRequestList {
194
189
  io.restorecommerce.auth.Subject subject = 2;
195
190
  }
196
191
 
197
- message CancelResultList {
198
- repeated io.restorecommerce.status.Status items = 1;
199
- io.restorecommerce.status.OperationStatus operation_status = 2;
200
- }
201
-
202
192
  message Deleted {
203
193
  string id = 1;
204
194
  }
@@ -2,48 +2,48 @@ syntax = "proto3";
2
2
 
3
3
  package io.restorecommerce.fulfillment_courier;
4
4
 
5
+ import "google/protobuf/any.proto";
5
6
  import "io/restorecommerce/resource_base.proto";
6
7
  import "io/restorecommerce/meta.proto";
7
8
  import "io/restorecommerce/auth.proto";
8
9
  import "io/restorecommerce/status.proto";
9
- import "google/protobuf/any.proto";
10
10
 
11
11
  /**
12
12
  Microservice defination
13
13
  */
14
14
 
15
15
  service Service {
16
- rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (CourierResponseList);
17
- rpc Create (CourierList) returns (CourierResponseList);
18
- rpc Update (CourierList) returns (CourierResponseList);
19
- rpc Upsert (CourierList) returns (CourierResponseList);
16
+ rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (FulfillmentCourierResponseList);
17
+ rpc Create (FulfillmentCourierList) returns (FulfillmentCourierResponseList);
18
+ rpc Update (FulfillmentCourierList) returns (FulfillmentCourierResponseList);
19
+ rpc Upsert (FulfillmentCourierList) returns (FulfillmentCourierResponseList);
20
20
  rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
21
21
  }
22
22
 
23
- message Courier {
23
+ message FulfillmentCourier {
24
24
  string id = 1;
25
25
  string name = 4;
26
26
  string description = 5;
27
27
  string logo = 6;
28
28
  string website = 7;
29
29
  string stub_type = 8;
30
- google.protobuf.Any configuration = 9;
31
- io.restorecommerce.meta.Meta meta = 10;
30
+ google.protobuf.Any configuration = 10;
31
+ io.restorecommerce.meta.Meta meta = 11;
32
32
  }
33
33
 
34
- message CourierList {
35
- repeated Courier items = 1;
34
+ message FulfillmentCourierList {
35
+ repeated FulfillmentCourier items = 1;
36
36
  uint32 total_count = 2;
37
37
  io.restorecommerce.auth.Subject subject = 3;
38
38
  }
39
39
 
40
- message CourierResponse {
41
- Courier payload = 1;
40
+ message FulfillmentCourierResponse {
41
+ FulfillmentCourier payload = 1;
42
42
  io.restorecommerce.status.Status status = 2;
43
43
  }
44
44
 
45
- message CourierResponseList {
46
- repeated CourierResponse items = 1;
45
+ message FulfillmentCourierResponseList {
46
+ repeated FulfillmentCourierResponse items = 1;
47
47
  uint32 total_count = 2;
48
48
  io.restorecommerce.status.OperationStatus operation_status = 3;
49
49
  }
@@ -6,44 +6,37 @@ import "io/restorecommerce/resource_base.proto";
6
6
  import "io/restorecommerce/meta.proto";
7
7
  import "io/restorecommerce/auth.proto";
8
8
  import "io/restorecommerce/status.proto";
9
- import "io/restorecommerce/fulfillment.proto";
10
- import "io/restorecommerce/country.proto";
11
9
  import "io/restorecommerce/attribute.proto";
10
+ import "io/restorecommerce/order.proto";
11
+ import "io/restorecommerce/fulfillment.proto";
12
+
12
13
 
13
14
  /**
14
15
  Microservice defination
15
16
  */
16
17
 
17
18
  service Service {
18
- rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (ProductResponseList);
19
- rpc Find (QueryList) returns (ProductResponseList);
20
- /* - start_address
21
- - destination_address
22
- - good[]:
23
- - quantity
24
- - weight
25
- - height
26
- - width
27
- - depth*/
28
-
29
- rpc Create (ProductList) returns (ProductResponseList);
30
- rpc Update (ProductList) returns (ProductResponseList);
31
- rpc Upsert (ProductList) returns (ProductResponseList);
19
+ rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (FulfillmentProductResponseList);
20
+ rpc Find (QueryList) returns (PackingSolutionResponseList);
21
+ rpc Create (FulfillmentProductList) returns (FulfillmentProductResponseList);
22
+ rpc Update (FulfillmentProductList) returns (FulfillmentProductResponseList);
23
+ rpc Upsert (FulfillmentProductList) returns (FulfillmentProductResponseList);
32
24
  rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
33
25
  }
34
26
 
35
- message Good {
36
- double quantity = 1;
37
- double weight = 2;
38
- double height = 3;
39
- double width = 4;
40
- double length = 5;
27
+ message Preferences {
28
+ repeated io.restorecommerce.attribute.Attribute couriers = 1; //ID, name or type
29
+ float pricing = 2;
30
+ float compactness = 3;
31
+ float homogeneity = 4;
41
32
  }
42
33
 
43
34
  message Query {
44
35
  io.restorecommerce.fulfillment.Address sender = 1;
45
- io.restorecommerce.fulfillment.Address receiver = 2;
46
- repeated Good good = 3;
36
+ io.restorecommerce.fulfillment.Address receiver = 2;
37
+ repeated io.restorecommerce.order.Item goods = 3;
38
+ Preferences preferences = 4;
39
+ string reference_id = 5;
47
40
  }
48
41
 
49
42
  message QueryList {
@@ -52,16 +45,16 @@ message QueryList {
52
45
  io.restorecommerce.auth.Subject subject = 3;
53
46
  }
54
47
 
55
- message Product {
48
+ message FulfillmentProduct {
56
49
  string id = 1;
57
50
  string name = 2;
58
51
  string description = 3;
59
52
  string courier_id = 4;
60
- repeated io.restorecommerce.country.Country start_country = 5;
61
- repeated string start_zone = 6;
62
- repeated io.restorecommerce.country.Country destination_country = 7;
63
- repeated string destination_zone = 8;
64
- repeated string tax_id = 9;
53
+ //repeated io.restorecommerce.country.Country start_country = 5;
54
+ repeated string start_zones = 6;
55
+ //repeated io.restorecommerce.country.Country destination_country = 7;
56
+ repeated string destination_zones = 8;
57
+ repeated string tax_ids = 9;
65
58
  repeated io.restorecommerce.attribute.Attribute attributes = 10;
66
59
  repeated Variant variants = 11;
67
60
  io.restorecommerce.meta.Meta meta = 12;
@@ -79,19 +72,39 @@ message Variant {
79
72
  double max_volume = 9;
80
73
  }
81
74
 
82
- message ProductList {
83
- repeated Product items = 1;
75
+ message FulfillmentProductList {
76
+ repeated FulfillmentProduct items = 1;
84
77
  uint32 total_count = 2;
85
78
  io.restorecommerce.auth.Subject subject = 3;
86
79
  }
87
80
 
88
- message ProductResponse {
89
- Product payload = 1;
81
+ message FulfillmentProductResponse {
82
+ FulfillmentProduct payload = 1;
83
+ io.restorecommerce.status.Status status = 2;
84
+ }
85
+
86
+ message FulfillmentProductResponseList {
87
+ repeated FulfillmentProductResponse items = 1;
88
+ uint32 total_count = 2;
89
+ io.restorecommerce.status.OperationStatus operation_status = 3;
90
+ }
91
+
92
+ message PackingSolution {
93
+ string reference_id = 1;
94
+ float price = 2;
95
+ float compactness = 3;
96
+ float homogeneity = 4;
97
+ float score = 5;
98
+ repeated io.restorecommerce.fulfillment.Parcel parcels = 6;
99
+ }
100
+
101
+ message PackingSolutionResponse {
102
+ repeated PackingSolution solutions = 1;
90
103
  io.restorecommerce.status.Status status = 2;
91
104
  }
92
105
 
93
- message ProductResponseList {
94
- repeated ProductResponse items = 1;
106
+ message PackingSolutionResponseList {
107
+ repeated PackingSolutionResponse items = 1;
95
108
  uint32 total_count = 2;
96
109
  io.restorecommerce.status.OperationStatus operation_status = 3;
97
110
  }
@@ -1,8 +1,10 @@
1
1
  syntax = "proto3";
2
2
  package io.restorecommerce.graph;
3
+
3
4
  import "google/protobuf/any.proto";
4
5
  import "io/restorecommerce/auth.proto";
5
6
  import "io/restorecommerce/status.proto";
7
+ import "io/restorecommerce/resource_base.proto";
6
8
 
7
9
  // Service provides the CRUD operations
8
10
  service Service {
@@ -10,69 +12,81 @@ service Service {
10
12
  }
11
13
 
12
14
  message TraversalRequest {
13
- message StartVertices {
14
- repeated string vertices = 1;
15
- }
16
-
17
15
  // Document handle either _id or _key value
18
16
  oneof vertex {
19
- string start_vertex = 1;
20
- StartVertices start_vertices = 2;
17
+ Vertices vertices = 1;
18
+ Collection collection = 2;
21
19
  }
22
-
23
- // Filter based on fieldName|operation, value|list
24
20
  Options opts = 3;
25
- string collection_name = 4;
26
- string edge_name = 5;
27
- bool data = 6;
28
- bool path = 7;
29
- bool aql = 8;
30
- io.restorecommerce.auth.Subject subject = 9;
21
+ bool path = 4;
22
+ io.restorecommerce.auth.Subject subject = 5;
23
+ repeated Filters filters = 6;
31
24
  }
32
25
 
33
- message TraversalResponse {
34
- repeated VertexFields vertex_fields = 1;
35
- google.protobuf.Any paths = 2;
36
- google.protobuf.Any data = 3;
37
- io.restorecommerce.status.OperationStatus operation_status = 4;
26
+ message Vertices {
27
+ string collection_name = 1;
28
+ repeated string start_vertex_id = 2;
38
29
  }
39
30
 
40
- message VertexFields {
41
- string id = 1;
42
- string key = 2;
43
- string rev = 3;
31
+ message Collection {
32
+ string collection_name = 1;
33
+ uint32 limit = 2;
34
+ uint32 offset = 3;
35
+ repeated io.restorecommerce.resourcebase.Sort sort = 4;
44
36
  }
45
37
 
46
38
  message Options {
47
- string sort = 1; // JS code
48
- string direction = 2; // either inbound or outbound
49
- uint32 min_depth = 3; // ANDed with any existing filters): visits only nodes in at least the given depth
50
- string start_vertex = 4; // id of the startVertex
51
- string visitor = 5; // JS code
52
- string item_order = 6; // item iteration order can be "forward" or "backward"
53
- string strategy = 7; // traversal strategy can be "depthfirst" or "breadthfirst"
54
- repeated Filter filter = 8; // JS code
55
- string init = 9; // JS code
56
- uint32 max_iterations = 10; // maximum number of iterations in each traversal
57
- uint32 max_depth = 11; // ANDed with any existing filters visits only nodes in at most the given depth
58
- Uniqueness uniqueness = 12; // specifies uniqueness for vertices and edges visited
59
- string order = 13; // "preorder", "postorder" or "preorder-expander"
60
- string graph_name = 14; // name of graph that contains the edges
61
- repeated Expander expander = 15; // JS code
62
- string edge_collection = 16; // name of the collection that contains the edges
63
- bool lowest_common_ancestor = 17;
39
+ repeated string include_vertex = 1; // to include vertices
40
+ repeated string exclude_vertex = 2; // to exclude vertices
41
+ repeated string include_edge = 3; // to include vertices
42
+ repeated string exclude_edge = 4; // to exclude vertices
43
+ Direction direction = 5; // either inbound or outbound, defaults to outbound direction
44
+ enum Direction {
45
+ OUTBOUND = 0;
46
+ INBOUND = 1;
47
+ }
64
48
  }
65
49
 
66
- message Filter {
67
- string vertex = 1; // exclude these vertices
68
- }
69
50
 
70
- message Expander {
71
- string edge = 1; // expand these edges
72
- string direction = 2;
51
+ message Filters {
52
+ string entity = 1; // entity on which the filters are applied
53
+ string edge = 2; // if edge is specified depending on the direction filter are applied only for those entities
54
+ repeated Filter filter = 3;
55
+ enum Operator {
56
+ and = 0;
57
+ or = 1;
58
+ }
59
+ Operator operator = 4;
73
60
  }
74
61
 
75
- message Uniqueness {
76
- string vertices = 1; // "none"|"global"|"path" for unique vertices
77
- string edges = 2; // "none"|"global"|"path" for unique edges
62
+ message Filter {
63
+ string field = 1;
64
+ enum Operation {
65
+ eq = 0;
66
+ lt = 1;
67
+ lte = 2;
68
+ gt = 3;
69
+ gte = 4;
70
+ isEmpty = 5;
71
+ iLike = 6;
72
+ in = 7;
73
+ neq = 8;
74
+ }
75
+ Operation operation = 2;
76
+ string value = 3;
77
+ enum ValueType {
78
+ STRING = 0; // default value type if not specified
79
+ NUMBER = 1;
80
+ BOOLEAN = 2;
81
+ DATE = 3;
82
+ ARRAY = 4;
83
+ }
84
+ ValueType type = 4;
85
+ repeated Filters filters = 5;
78
86
  }
87
+
88
+ message TraversalResponse {
89
+ google.protobuf.Any data = 1; // vertices
90
+ google.protobuf.Any paths = 2; // traversed vertices paths
91
+ io.restorecommerce.status.OperationStatus operation_status = 3;
92
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@restorecommerce/protos",
3
- "version": "0.4.11",
3
+ "version": "0.5.0",
4
4
  "description": "Protobuf descriptors for Restorecommerce services",
5
5
  "author": "n-fuse GmbH",
6
6
  "repository": {
@@ -15,5 +15,5 @@
15
15
  "protobufs"
16
16
  ],
17
17
  "scripts": {},
18
- "gitHead": "162ea83a0b06d629c84f760e69bb07ca412800fe"
18
+ "gitHead": "39da173ebfb2496f76bd0cb8f041925b2be775ea"
19
19
  }