@restorecommerce/protos 0.4.5
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 +214 -0
- package/LICENSE +19 -0
- package/README.md +9 -0
- package/google/protobuf/any.proto +133 -0
- package/google/protobuf/descriptor.proto +805 -0
- package/google/protobuf/empty.proto +53 -0
- package/google/protobuf/struct.proto +96 -0
- package/google/protobuf/wrappers.proto +123 -0
- package/grpc/health/v1/health.proto +50 -0
- package/grpc/reflection/v1alpha/reflection.proto +154 -0
- package/io/restorecommerce/access_control.proto +48 -0
- package/io/restorecommerce/address.proto +65 -0
- package/io/restorecommerce/attribute.proto +13 -0
- package/io/restorecommerce/auth.proto +48 -0
- package/io/restorecommerce/authentication_log.proto +56 -0
- package/io/restorecommerce/command.proto +57 -0
- package/io/restorecommerce/commandinterface.proto +30 -0
- package/io/restorecommerce/contact_point.proto +49 -0
- package/io/restorecommerce/contact_point_type.proto +46 -0
- package/io/restorecommerce/country.proto +49 -0
- package/io/restorecommerce/credential.proto +51 -0
- package/io/restorecommerce/customer.proto +63 -0
- package/io/restorecommerce/filter.proto +38 -0
- package/io/restorecommerce/fulfillment.proto +199 -0
- package/io/restorecommerce/fulfillment_courier.proto +54 -0
- package/io/restorecommerce/fulfillment_product.proto +49 -0
- package/io/restorecommerce/graph.proto +76 -0
- package/io/restorecommerce/image.proto +24 -0
- package/io/restorecommerce/invoice.proto +121 -0
- package/io/restorecommerce/job.proto +173 -0
- package/io/restorecommerce/locale.proto +47 -0
- package/io/restorecommerce/location.proto +53 -0
- package/io/restorecommerce/manufacturer.proto +45 -0
- package/io/restorecommerce/meta.proto +15 -0
- package/io/restorecommerce/notification.proto +52 -0
- package/io/restorecommerce/notification_channel.proto +50 -0
- package/io/restorecommerce/notification_req.proto +49 -0
- package/io/restorecommerce/order.proto +121 -0
- package/io/restorecommerce/organization.proto +63 -0
- package/io/restorecommerce/ostorage.proto +154 -0
- package/io/restorecommerce/payment.proto +115 -0
- package/io/restorecommerce/payment_method.proto +60 -0
- package/io/restorecommerce/policy.proto +59 -0
- package/io/restorecommerce/policy_set.proto +53 -0
- package/io/restorecommerce/price_group.proto +45 -0
- package/io/restorecommerce/product.proto +101 -0
- package/io/restorecommerce/product_category.proto +53 -0
- package/io/restorecommerce/product_prototype.proto +47 -0
- package/io/restorecommerce/rendering.proto +34 -0
- package/io/restorecommerce/resource_base.proto +137 -0
- package/io/restorecommerce/role.proto +45 -0
- package/io/restorecommerce/rule.proto +86 -0
- package/io/restorecommerce/search.proto +21 -0
- package/io/restorecommerce/status.proto +26 -0
- package/io/restorecommerce/tax.proto +49 -0
- package/io/restorecommerce/tax_type.proto +47 -0
- package/io/restorecommerce/timezone.proto +46 -0
- package/io/restorecommerce/token.proto +36 -0
- package/io/restorecommerce/user.proto +258 -0
- package/package.json +19 -0
- package/test/test.proto +71 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package io.restorecommerce.policy_set;
|
|
4
|
+
|
|
5
|
+
import "io/restorecommerce/resource_base.proto";
|
|
6
|
+
import "io/restorecommerce/meta.proto";
|
|
7
|
+
import "io/restorecommerce/policy.proto";
|
|
8
|
+
import "io/restorecommerce/auth.proto";
|
|
9
|
+
import "io/restorecommerce/rule.proto";
|
|
10
|
+
import "io/restorecommerce/status.proto";
|
|
11
|
+
|
|
12
|
+
message PolicySet {
|
|
13
|
+
string id = 1;
|
|
14
|
+
io.restorecommerce.meta.Meta meta = 2;
|
|
15
|
+
string name = 3;
|
|
16
|
+
string description = 4;
|
|
17
|
+
io.restorecommerce.rule.Target target = 5;
|
|
18
|
+
string combining_algorithm = 6;
|
|
19
|
+
repeated string policies = 7; // policy IDs
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message PolicySetList {
|
|
23
|
+
repeated PolicySet items = 1;
|
|
24
|
+
uint32 total_count = 2;
|
|
25
|
+
io.restorecommerce.auth.Subject subject = 3;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message PolicySetListResponse {
|
|
29
|
+
repeated PolicySetResponse items = 1;
|
|
30
|
+
uint32 total_count = 2;
|
|
31
|
+
io.restorecommerce.status.OperationStatus operation_status = 3;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message PolicySetResponse {
|
|
35
|
+
PolicySet payload = 1;
|
|
36
|
+
io.restorecommerce.status.Status status = 2;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message PolicySetRQ {
|
|
40
|
+
string id = 1;
|
|
41
|
+
io.restorecommerce.rule.Target target = 2;
|
|
42
|
+
string combining_algorithm = 3;
|
|
43
|
+
repeated io.restorecommerce.policy.PolicyRQ policies = 4;
|
|
44
|
+
io.restorecommerce.rule.Effect effect = 5;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
service Service {
|
|
48
|
+
rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (PolicySetListResponse);
|
|
49
|
+
rpc Create (PolicySetList) returns (PolicySetListResponse);
|
|
50
|
+
rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
|
|
51
|
+
rpc Update (PolicySetList) returns (PolicySetListResponse);
|
|
52
|
+
rpc Upsert (PolicySetList) returns (PolicySetListResponse);
|
|
53
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package io.restorecommerce.price_group;
|
|
4
|
+
|
|
5
|
+
import "io/restorecommerce/resource_base.proto";
|
|
6
|
+
import "io/restorecommerce/meta.proto";
|
|
7
|
+
import "io/restorecommerce/auth.proto";
|
|
8
|
+
import "io/restorecommerce/status.proto";
|
|
9
|
+
|
|
10
|
+
// PriceGroup resource
|
|
11
|
+
message PriceGroup {
|
|
12
|
+
string id = 1;
|
|
13
|
+
io.restorecommerce.meta.Meta meta = 2;
|
|
14
|
+
string name = 3;
|
|
15
|
+
string description = 4;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message PriceGroupList {
|
|
19
|
+
repeated PriceGroup items = 1;
|
|
20
|
+
uint32 total_count = 2;
|
|
21
|
+
io.restorecommerce.auth.Subject subject = 3;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message PriceGroupListResponse {
|
|
25
|
+
repeated PriceGroupResponse items = 1;
|
|
26
|
+
uint32 total_count = 2;
|
|
27
|
+
io.restorecommerce.status.OperationStatus operation_status = 3;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message PriceGroupResponse {
|
|
31
|
+
PriceGroup payload = 1;
|
|
32
|
+
io.restorecommerce.status.Status status = 3;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message Deleted {
|
|
36
|
+
string id = 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
service Service {
|
|
40
|
+
rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (PriceGroupListResponse);
|
|
41
|
+
rpc Create (PriceGroupList) returns (PriceGroupListResponse);
|
|
42
|
+
rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
|
|
43
|
+
rpc Update (PriceGroupList) returns (PriceGroupListResponse);
|
|
44
|
+
rpc Upsert (PriceGroupList) returns (PriceGroupListResponse);
|
|
45
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package io.restorecommerce.product;
|
|
4
|
+
|
|
5
|
+
import "io/restorecommerce/resource_base.proto";
|
|
6
|
+
import "io/restorecommerce/meta.proto";
|
|
7
|
+
import "io/restorecommerce/image.proto";
|
|
8
|
+
import "io/restorecommerce/auth.proto";
|
|
9
|
+
import "io/restorecommerce/status.proto";
|
|
10
|
+
|
|
11
|
+
service Service {
|
|
12
|
+
rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (ProductListResponse);
|
|
13
|
+
rpc Create (ProductList) returns (ProductListResponse);
|
|
14
|
+
rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
|
|
15
|
+
rpc Update (ProductList) returns (ProductListResponse);
|
|
16
|
+
rpc Upsert (ProductList) returns (ProductListResponse);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Product resource
|
|
20
|
+
message MainProduct {
|
|
21
|
+
string id = 1;
|
|
22
|
+
oneof product_type {
|
|
23
|
+
Product product = 2;
|
|
24
|
+
Bundle bundle = 3;
|
|
25
|
+
}
|
|
26
|
+
bool active = 4;
|
|
27
|
+
io.restorecommerce.meta.Meta meta = 5;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message Product {
|
|
31
|
+
string id = 1;
|
|
32
|
+
string name = 2;
|
|
33
|
+
string description = 3;
|
|
34
|
+
string manufacturer_id = 4;
|
|
35
|
+
string taric_code = 5;
|
|
36
|
+
oneof classification {
|
|
37
|
+
Identifier prototype = 6;
|
|
38
|
+
Identifier category = 7;
|
|
39
|
+
}
|
|
40
|
+
repeated string tax_type_id = 8;
|
|
41
|
+
repeated Variant variants = 9;
|
|
42
|
+
string gtin = 10;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message Identifier {
|
|
46
|
+
string id = 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message ProductList {
|
|
50
|
+
repeated MainProduct items = 1;
|
|
51
|
+
uint32 total_count = 2;
|
|
52
|
+
io.restorecommerce.auth.Subject subject = 3;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message ProductListResponse {
|
|
56
|
+
repeated ProductResponse items = 1;
|
|
57
|
+
uint32 total_count = 2;
|
|
58
|
+
io.restorecommerce.status.OperationStatus operation_status = 3;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message ProductResponse {
|
|
62
|
+
MainProduct payload = 1;
|
|
63
|
+
io.restorecommerce.status.Status status = 3;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message Variant {
|
|
67
|
+
string id = 1;
|
|
68
|
+
string name = 2;
|
|
69
|
+
string description = 3;
|
|
70
|
+
int32 stock_level = 4;
|
|
71
|
+
double price = 5;
|
|
72
|
+
bool sale = 6;
|
|
73
|
+
double sale_price = 7;
|
|
74
|
+
repeated io.restorecommerce.image.Image image = 8;
|
|
75
|
+
string stock_keeping_unit = 9;
|
|
76
|
+
repeated VariantAttribute attributes = 10;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
message VariantAttribute {
|
|
80
|
+
string key = 1;
|
|
81
|
+
repeated string values = 2;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
message Bundle {
|
|
85
|
+
string id = 1;
|
|
86
|
+
string name = 3;
|
|
87
|
+
string description = 4;
|
|
88
|
+
repeated io.restorecommerce.image.Image image = 5;
|
|
89
|
+
repeated BundleProduct product = 6;
|
|
90
|
+
double price = 7;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
message BundleProduct {
|
|
94
|
+
string product_id = 1;
|
|
95
|
+
uint32 quantity = 2;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
message Deleted {
|
|
100
|
+
string id = 1;
|
|
101
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package io.restorecommerce.product_category;
|
|
4
|
+
|
|
5
|
+
import "io/restorecommerce/resource_base.proto";
|
|
6
|
+
import "io/restorecommerce/meta.proto";
|
|
7
|
+
import "io/restorecommerce/image.proto";
|
|
8
|
+
import "io/restorecommerce/auth.proto";
|
|
9
|
+
import "io/restorecommerce/status.proto";
|
|
10
|
+
|
|
11
|
+
// ProductCategory resource
|
|
12
|
+
message ProductCategory {
|
|
13
|
+
string id = 1;
|
|
14
|
+
io.restorecommerce.meta.Meta meta = 2;
|
|
15
|
+
string name = 3;
|
|
16
|
+
string description = 4;
|
|
17
|
+
string price_group_id = 5;
|
|
18
|
+
io.restorecommerce.image.Image image = 6;
|
|
19
|
+
Parent parent = 7;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message ProductCategoryList {
|
|
23
|
+
repeated ProductCategory items = 1;
|
|
24
|
+
uint32 total_count = 2;
|
|
25
|
+
io.restorecommerce.auth.Subject subject = 3;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message ProductCategoryListResponse {
|
|
29
|
+
repeated ProductCategoryResponse items = 1;
|
|
30
|
+
uint32 total_count = 2;
|
|
31
|
+
io.restorecommerce.status.OperationStatus operation_status = 3;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message ProductCategoryResponse {
|
|
35
|
+
ProductCategory payload = 1;
|
|
36
|
+
io.restorecommerce.status.Status status = 2;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message Deleted {
|
|
40
|
+
string id = 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
message Parent {
|
|
44
|
+
string parent_id = 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
service Service {
|
|
48
|
+
rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (ProductCategoryListResponse);
|
|
49
|
+
rpc Create (ProductCategoryList) returns (ProductCategoryListResponse);
|
|
50
|
+
rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
|
|
51
|
+
rpc Update (ProductCategoryList) returns (ProductCategoryListResponse);
|
|
52
|
+
rpc Upsert (ProductCategoryList) returns (ProductCategoryListResponse);
|
|
53
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package io.restorecommerce.product_prototype;
|
|
4
|
+
|
|
5
|
+
import "io/restorecommerce/resource_base.proto";
|
|
6
|
+
import "io/restorecommerce/meta.proto";
|
|
7
|
+
import "io/restorecommerce/auth.proto";
|
|
8
|
+
import "io/restorecommerce/status.proto";
|
|
9
|
+
|
|
10
|
+
// ProductPrototype resource
|
|
11
|
+
message ProductPrototype {
|
|
12
|
+
string id = 1;
|
|
13
|
+
io.restorecommerce.meta.Meta meta = 2;
|
|
14
|
+
string name = 3;
|
|
15
|
+
string version = 4;
|
|
16
|
+
string description = 5;
|
|
17
|
+
string category_id = 6;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
message ProductPrototypeList {
|
|
21
|
+
repeated ProductPrototype items = 1;
|
|
22
|
+
uint32 total_count = 2;
|
|
23
|
+
io.restorecommerce.auth.Subject subject = 3;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message ProductPrototypeListResponse {
|
|
27
|
+
repeated ProductPrototypeResponse items = 1;
|
|
28
|
+
uint32 total_count = 2;
|
|
29
|
+
io.restorecommerce.status.OperationStatus operation_status = 3;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
message ProductPrototypeResponse {
|
|
33
|
+
ProductPrototype payload = 1;
|
|
34
|
+
io.restorecommerce.status.Status status = 2;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message Deleted {
|
|
38
|
+
string id = 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
service Service {
|
|
42
|
+
rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (ProductPrototypeListResponse);
|
|
43
|
+
rpc Create (ProductPrototypeList) returns (ProductPrototypeListResponse);
|
|
44
|
+
rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
|
|
45
|
+
rpc Update (ProductPrototypeList) returns (ProductPrototypeListResponse);
|
|
46
|
+
rpc Upsert (ProductPrototypeList) returns (ProductPrototypeListResponse);
|
|
47
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package io.restorecommerce.rendering;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/any.proto";
|
|
6
|
+
|
|
7
|
+
message Payload {
|
|
8
|
+
// json with <key, template> pairs
|
|
9
|
+
// e.g. { 'subject': ..., 'message':....}
|
|
10
|
+
google.protobuf.Any templates = 1;
|
|
11
|
+
google.protobuf.Any data = 2; // data to fill template with
|
|
12
|
+
string style_url = 3; // stylesheet URL
|
|
13
|
+
|
|
14
|
+
enum Strategy { // style-applying 'strategy'
|
|
15
|
+
INLINE = 0;
|
|
16
|
+
COPY = 1;
|
|
17
|
+
}
|
|
18
|
+
Strategy strategy = 4; // inlining, copying CSS into <style>, etc...
|
|
19
|
+
// rendering options JSON object
|
|
20
|
+
google.protobuf.Any options = 5;
|
|
21
|
+
// content type for rendering such as 'application/html' or 'application/text'
|
|
22
|
+
string content_type = 6;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message RenderRequest {
|
|
26
|
+
string id = 1; // identifies the render request payload
|
|
27
|
+
// List of templates with associated data and rendering options
|
|
28
|
+
repeated Payload payload = 2;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
message RenderResponse {
|
|
32
|
+
string id = 1;
|
|
33
|
+
repeated google.protobuf.Any response = 2; // error or HTML contents
|
|
34
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
package io.restorecommerce.resourcebase;
|
|
3
|
+
|
|
4
|
+
import "google/protobuf/any.proto";
|
|
5
|
+
import "io/restorecommerce/meta.proto";
|
|
6
|
+
import "io/restorecommerce/auth.proto";
|
|
7
|
+
import "io/restorecommerce/status.proto";
|
|
8
|
+
import "io/restorecommerce/filter.proto";
|
|
9
|
+
|
|
10
|
+
// Service provides the CRUD operations
|
|
11
|
+
service Service {
|
|
12
|
+
rpc Read (ReadRequest) returns (ResourceListResponse);
|
|
13
|
+
rpc Create (ResourceList) returns (ResourceListResponse);
|
|
14
|
+
rpc Delete (DeleteRequest) returns (DeleteResponse);
|
|
15
|
+
rpc Update (ResourceList) returns (ResourceListResponse);
|
|
16
|
+
rpc Upsert (ResourceList) returns (ResourceListResponse);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message FieldFilter {
|
|
20
|
+
string name = 1;
|
|
21
|
+
bool include = 2;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message Sort {
|
|
25
|
+
enum SortOrder {
|
|
26
|
+
UNSORTED = 0;
|
|
27
|
+
ASCENDING = 1;
|
|
28
|
+
DESCENDING = 2;
|
|
29
|
+
}
|
|
30
|
+
string field = 1;
|
|
31
|
+
SortOrder order = 2;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message Filter {
|
|
35
|
+
string field = 1;
|
|
36
|
+
enum Operation {
|
|
37
|
+
eq = 0;
|
|
38
|
+
lt = 1;
|
|
39
|
+
lte = 2;
|
|
40
|
+
gt = 3;
|
|
41
|
+
gte = 4;
|
|
42
|
+
isEmpty = 5;
|
|
43
|
+
iLike = 6;
|
|
44
|
+
in = 7;
|
|
45
|
+
neq = 8;
|
|
46
|
+
}
|
|
47
|
+
Operation operation = 2;
|
|
48
|
+
string value = 3;
|
|
49
|
+
enum ValueType {
|
|
50
|
+
STRING = 0; // default value type if not specified
|
|
51
|
+
NUMBER = 1;
|
|
52
|
+
BOOLEAN = 2;
|
|
53
|
+
DATE = 3;
|
|
54
|
+
ARRAY = 4;
|
|
55
|
+
}
|
|
56
|
+
ValueType type = 4;
|
|
57
|
+
repeated io.restorecommerce.filter.FilterOp filters = 5; // for nested filtering and to make optional its in separate filter.proto file
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message FilterOp {
|
|
61
|
+
repeated Filter filter = 1;
|
|
62
|
+
enum Operator {
|
|
63
|
+
and = 0;
|
|
64
|
+
or = 1;
|
|
65
|
+
}
|
|
66
|
+
Operator operator = 2;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
message ReadRequest {
|
|
70
|
+
uint32 offset = 1;
|
|
71
|
+
uint32 limit = 2;
|
|
72
|
+
repeated Sort sort = 3;
|
|
73
|
+
|
|
74
|
+
/// Filter based on fieldName|operation, value|list
|
|
75
|
+
repeated FilterOp filters = 4; // repeated filters
|
|
76
|
+
|
|
77
|
+
/// Fields selector
|
|
78
|
+
repeated FieldFilter field = 5;
|
|
79
|
+
repeated string search = 6;
|
|
80
|
+
|
|
81
|
+
/** Check the query parameters of HTTP request.
|
|
82
|
+
* If query parameter `locales` is given,
|
|
83
|
+
* return all corresponding localized values.
|
|
84
|
+
* Otherwise, return always the localized value
|
|
85
|
+
* with highest priority.
|
|
86
|
+
* Can be empty, single locale or multiple locales.
|
|
87
|
+
*/
|
|
88
|
+
repeated string locales_limiter = 7;
|
|
89
|
+
|
|
90
|
+
repeated string custom_queries = 8;
|
|
91
|
+
google.protobuf.Any custom_arguments = 9;
|
|
92
|
+
io.restorecommerce.auth.Subject subject = 10;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
message DeleteRequest {
|
|
96
|
+
/// Request to purge the whole collection
|
|
97
|
+
bool collection = 1;
|
|
98
|
+
/// Delete specified documents
|
|
99
|
+
repeated string ids = 2;
|
|
100
|
+
io.restorecommerce.auth.Subject subject = 3;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
message DeleteResponse {
|
|
104
|
+
repeated io.restorecommerce.status.Status status = 1;
|
|
105
|
+
io.restorecommerce.status.OperationStatus operation_status = 2;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/// List of resources
|
|
109
|
+
message ResourceList {
|
|
110
|
+
repeated Resource items = 1;
|
|
111
|
+
uint32 total_count = 2;
|
|
112
|
+
io.restorecommerce.auth.Subject subject = 3;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// ResourceList response
|
|
116
|
+
message ResourceListResponse {
|
|
117
|
+
repeated ResourceResponse items = 1;
|
|
118
|
+
uint32 total_count = 2;
|
|
119
|
+
io.restorecommerce.status.OperationStatus operation_status = 3;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// resource read response
|
|
123
|
+
message ResourceResponse {
|
|
124
|
+
Resource payload = 1;
|
|
125
|
+
io.restorecommerce.status.Status status = 2;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/// Example resource
|
|
129
|
+
message Resource {
|
|
130
|
+
string id = 1;
|
|
131
|
+
io.restorecommerce.meta.Meta meta = 2;
|
|
132
|
+
int32 value = 3;
|
|
133
|
+
string text = 4;
|
|
134
|
+
bool active = 5;
|
|
135
|
+
double created = 6;
|
|
136
|
+
string status = 7;
|
|
137
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package io.restorecommerce.role;
|
|
4
|
+
|
|
5
|
+
import "io/restorecommerce/resource_base.proto";
|
|
6
|
+
import "io/restorecommerce/meta.proto";
|
|
7
|
+
import "io/restorecommerce/auth.proto";
|
|
8
|
+
import "io/restorecommerce/status.proto";
|
|
9
|
+
|
|
10
|
+
service Service {
|
|
11
|
+
rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (RoleListResponse);
|
|
12
|
+
rpc Create (RoleList) returns (RoleListResponse);
|
|
13
|
+
rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
|
|
14
|
+
rpc Update (RoleList) returns (RoleListResponse);
|
|
15
|
+
rpc Upsert (RoleList) returns (RoleListResponse);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message Role {
|
|
19
|
+
string id = 1;
|
|
20
|
+
io.restorecommerce.meta.Meta meta = 2;
|
|
21
|
+
string name = 3; // specifies the role of the user
|
|
22
|
+
string description = 4;
|
|
23
|
+
repeated string assignable_by_roles = 5; // role id who can assign this role
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message RoleList {
|
|
27
|
+
repeated Role items = 1;
|
|
28
|
+
uint32 total_count = 2;
|
|
29
|
+
io.restorecommerce.auth.Subject subject = 3;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
message RoleListResponse {
|
|
33
|
+
repeated RoleResponse items = 1;
|
|
34
|
+
uint32 total_count = 2;
|
|
35
|
+
io.restorecommerce.status.OperationStatus operation_status = 3;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message RoleResponse {
|
|
39
|
+
Role payload = 1;
|
|
40
|
+
io.restorecommerce.status.Status status = 2;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
message Deleted {
|
|
44
|
+
string id = 1;
|
|
45
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package io.restorecommerce.rule;
|
|
4
|
+
|
|
5
|
+
import "io/restorecommerce/resource_base.proto";
|
|
6
|
+
import "io/restorecommerce/meta.proto";
|
|
7
|
+
import "io/restorecommerce/auth.proto";
|
|
8
|
+
import "io/restorecommerce/attribute.proto";
|
|
9
|
+
import "io/restorecommerce/status.proto";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Target specified by a Rule or a Request.
|
|
14
|
+
*/
|
|
15
|
+
message Target {
|
|
16
|
+
repeated io.restorecommerce.attribute.Attribute subject = 1;
|
|
17
|
+
repeated io.restorecommerce.attribute.Attribute resources = 2;
|
|
18
|
+
repeated io.restorecommerce.attribute.Attribute action = 3;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Resulting effect from a Policy or Rule.
|
|
23
|
+
*/
|
|
24
|
+
enum Effect {
|
|
25
|
+
PERMIT = 0;
|
|
26
|
+
DENY = 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message Rule {
|
|
30
|
+
string id = 1;
|
|
31
|
+
io.restorecommerce.meta.Meta meta = 2;
|
|
32
|
+
string name = 3;
|
|
33
|
+
string description = 4;
|
|
34
|
+
Target target = 5;
|
|
35
|
+
ContextQuery context_query = 6;
|
|
36
|
+
string condition = 7; // JS code
|
|
37
|
+
Effect effect = 8;
|
|
38
|
+
bool evaluation_cacheable = 9;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message RuleRQ { // used for `whatIsAllowed` / reverse queries
|
|
42
|
+
string id = 1;
|
|
43
|
+
Target target = 2;
|
|
44
|
+
Effect effect = 3;
|
|
45
|
+
string condition = 4;
|
|
46
|
+
ContextQuery context_query = 5;
|
|
47
|
+
bool evaluation_cacheable = 6;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
message RuleList {
|
|
51
|
+
repeated Rule items = 1;
|
|
52
|
+
uint32 total_count = 2;
|
|
53
|
+
io.restorecommerce.auth.Subject subject = 3;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message RuleListResponse {
|
|
57
|
+
repeated RuleResponse items = 1;
|
|
58
|
+
uint32 total_count = 2;
|
|
59
|
+
io.restorecommerce.status.OperationStatus operation_status = 3;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
message RuleResponse {
|
|
63
|
+
Rule payload = 1;
|
|
64
|
+
io.restorecommerce.status.Status status = 2;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Query to pull resources from an external service
|
|
68
|
+
// and append them to the request's context.
|
|
69
|
+
// The retrieved data can then be passed onto the request's context
|
|
70
|
+
message ContextQuery {
|
|
71
|
+
message Filter {
|
|
72
|
+
string field = 1;
|
|
73
|
+
string operation = 2;
|
|
74
|
+
string value = 3;
|
|
75
|
+
}
|
|
76
|
+
repeated Filter filters = 1;
|
|
77
|
+
string query = 2;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
service Service {
|
|
81
|
+
rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (RuleListResponse);
|
|
82
|
+
rpc Create (RuleList) returns (RuleListResponse);
|
|
83
|
+
rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
|
|
84
|
+
rpc Update (RuleList) returns (RuleListResponse);
|
|
85
|
+
rpc Upsert (RuleList) returns (RuleListResponse);
|
|
86
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
package io.restorecommerce.search;
|
|
3
|
+
|
|
4
|
+
import "google/protobuf/any.proto";
|
|
5
|
+
import "io/restorecommerce/auth.proto";
|
|
6
|
+
|
|
7
|
+
// Service provides the CRUD operations
|
|
8
|
+
service Service {
|
|
9
|
+
rpc Search (SearchRequest) returns (SearchResponse);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
message SearchRequest {
|
|
13
|
+
string collection = 1;
|
|
14
|
+
string text = 2;
|
|
15
|
+
repeated string acl = 3;
|
|
16
|
+
io.restorecommerce.auth.Subject subject = 4;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message SearchResponse {
|
|
20
|
+
repeated google.protobuf.Any data = 1;
|
|
21
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package io.restorecommerce.status;
|
|
4
|
+
|
|
5
|
+
message Status {
|
|
6
|
+
string id = 1;
|
|
7
|
+
uint32 code = 2;
|
|
8
|
+
string message = 3;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
message StatusArray {
|
|
12
|
+
repeated Status status = 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message StatusObj {
|
|
16
|
+
Status status = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message OperationStatusObj {
|
|
20
|
+
OperationStatus operation_status = 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message OperationStatus {
|
|
24
|
+
uint32 code = 1;
|
|
25
|
+
string message = 2;
|
|
26
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package io.restorecommerce.tax;
|
|
4
|
+
|
|
5
|
+
import "io/restorecommerce/resource_base.proto";
|
|
6
|
+
import "io/restorecommerce/meta.proto";
|
|
7
|
+
import "io/restorecommerce/auth.proto";
|
|
8
|
+
import "io/restorecommerce/status.proto";
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* Microservice definition.
|
|
12
|
+
*/
|
|
13
|
+
service Service {
|
|
14
|
+
rpc Read (io.restorecommerce.resourcebase.ReadRequest) returns (TaxListResponse);
|
|
15
|
+
rpc Create (TaxList) returns (TaxListResponse);
|
|
16
|
+
rpc Delete (io.restorecommerce.resourcebase.DeleteRequest) returns (io.restorecommerce.resourcebase.DeleteResponse);
|
|
17
|
+
rpc Update (TaxList) returns (TaxListResponse);
|
|
18
|
+
rpc Upsert (TaxList) returns (TaxListResponse);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message Deleted {
|
|
22
|
+
string id = 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message TaxList {
|
|
26
|
+
repeated Tax items = 1;
|
|
27
|
+
uint32 total_count = 2;
|
|
28
|
+
io.restorecommerce.auth.Subject subject = 3;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
message TaxListResponse {
|
|
32
|
+
repeated TaxResponse items = 1;
|
|
33
|
+
uint32 total_count = 2;
|
|
34
|
+
io.restorecommerce.status.OperationStatus operation_status = 3;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message TaxResponse {
|
|
38
|
+
Tax payload = 1;
|
|
39
|
+
io.restorecommerce.status.Status status = 2;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message Tax {
|
|
43
|
+
string id = 1;
|
|
44
|
+
io.restorecommerce.meta.Meta meta = 2;
|
|
45
|
+
string country_id = 3;
|
|
46
|
+
double rate = 4;
|
|
47
|
+
string variant = 5;
|
|
48
|
+
string type_id = 6;
|
|
49
|
+
}
|