@candesk/contracts 6.50.0 → 6.52.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/dist/gen/catalog.d.ts +63 -0
- package/dist/gen/catalog.js +11 -1
- package/dist/nest/catalog.d.ts +64 -0
- package/dist/nest/catalog.js +12 -1
- package/package.json +1 -1
- package/proto/catalog.proto +73 -0
package/dist/gen/catalog.d.ts
CHANGED
|
@@ -34,6 +34,15 @@ export declare enum Availability {
|
|
|
34
34
|
AVAILABILITY_SOLD_OUT = 3,
|
|
35
35
|
UNRECOGNIZED = -1
|
|
36
36
|
}
|
|
37
|
+
export declare enum ProductSort {
|
|
38
|
+
PRODUCT_SORT_UNSPECIFIED = 0,
|
|
39
|
+
PRODUCT_SORT_NEWEST = 1,
|
|
40
|
+
PRODUCT_SORT_NAME = 2,
|
|
41
|
+
PRODUCT_SORT_THC_DESC = 3,
|
|
42
|
+
PRODUCT_SORT_THC_ASC = 4,
|
|
43
|
+
PRODUCT_SORT_CBD_DESC = 5,
|
|
44
|
+
UNRECOGNIZED = -1
|
|
45
|
+
}
|
|
37
46
|
export declare enum Flavor {
|
|
38
47
|
FLAVOR_UNSPECIFIED = 0,
|
|
39
48
|
FLAVOR_EARTHY = 1,
|
|
@@ -112,6 +121,18 @@ export interface ProductInput {
|
|
|
112
121
|
price?: number | undefined;
|
|
113
122
|
availability: Availability;
|
|
114
123
|
}
|
|
124
|
+
export interface PotencyRange {
|
|
125
|
+
min?: number | undefined;
|
|
126
|
+
max?: number | undefined;
|
|
127
|
+
}
|
|
128
|
+
export interface ProductFilter {
|
|
129
|
+
genetics: Genetics[];
|
|
130
|
+
manufacturerSlugs: string[];
|
|
131
|
+
countries: string[];
|
|
132
|
+
thc?: PotencyRange | undefined;
|
|
133
|
+
cbd?: PotencyRange | undefined;
|
|
134
|
+
isIrradiated?: boolean | undefined;
|
|
135
|
+
}
|
|
115
136
|
export interface ListProductsRequest {
|
|
116
137
|
query?: string | undefined;
|
|
117
138
|
type?: ProductType | undefined;
|
|
@@ -119,12 +140,53 @@ export interface ListProductsRequest {
|
|
|
119
140
|
cursor?: string | undefined;
|
|
120
141
|
limit: number;
|
|
121
142
|
ids: string[];
|
|
143
|
+
sort?: ProductSort | undefined;
|
|
144
|
+
filter?: ProductFilter | undefined;
|
|
122
145
|
}
|
|
123
146
|
export interface ListProductsResponse {
|
|
124
147
|
products: Product[];
|
|
125
148
|
nextCursor?: string | undefined;
|
|
126
149
|
total: number;
|
|
127
150
|
}
|
|
151
|
+
export interface GetProductFacetsRequest {
|
|
152
|
+
query?: string | undefined;
|
|
153
|
+
type?: ProductType | undefined;
|
|
154
|
+
status?: ProductStatus | undefined;
|
|
155
|
+
filter?: ProductFilter | undefined;
|
|
156
|
+
}
|
|
157
|
+
export interface ProductTypeFacet {
|
|
158
|
+
type: ProductType;
|
|
159
|
+
count: number;
|
|
160
|
+
}
|
|
161
|
+
export interface GeneticsFacet {
|
|
162
|
+
genetics: Genetics;
|
|
163
|
+
count: number;
|
|
164
|
+
}
|
|
165
|
+
export interface ManufacturerFacet {
|
|
166
|
+
manufacturer: Manufacturer | undefined;
|
|
167
|
+
count: number;
|
|
168
|
+
}
|
|
169
|
+
export interface CountryFacet {
|
|
170
|
+
country: string;
|
|
171
|
+
count: number;
|
|
172
|
+
}
|
|
173
|
+
export interface IrradiationFacet {
|
|
174
|
+
isIrradiated: boolean;
|
|
175
|
+
count: number;
|
|
176
|
+
}
|
|
177
|
+
export interface PotencyBounds {
|
|
178
|
+
min: number;
|
|
179
|
+
max: number;
|
|
180
|
+
}
|
|
181
|
+
export interface GetProductFacetsResponse {
|
|
182
|
+
types: ProductTypeFacet[];
|
|
183
|
+
genetics: GeneticsFacet[];
|
|
184
|
+
manufacturers: ManufacturerFacet[];
|
|
185
|
+
countries: CountryFacet[];
|
|
186
|
+
irradiation: IrradiationFacet[];
|
|
187
|
+
thc?: PotencyBounds | undefined;
|
|
188
|
+
cbd?: PotencyBounds | undefined;
|
|
189
|
+
}
|
|
128
190
|
export interface GetProductRequest {
|
|
129
191
|
id: string;
|
|
130
192
|
}
|
|
@@ -244,6 +306,7 @@ export interface DeleteTerpeneResponse {
|
|
|
244
306
|
}
|
|
245
307
|
export interface CatalogService {
|
|
246
308
|
listProducts(request: ListProductsRequest): Promise<ListProductsResponse>;
|
|
309
|
+
getProductFacets(request: GetProductFacetsRequest): Promise<GetProductFacetsResponse>;
|
|
247
310
|
getProduct(request: GetProductRequest): Promise<GetProductResponse>;
|
|
248
311
|
createProduct(request: CreateProductRequest): Promise<CreateProductResponse>;
|
|
249
312
|
updateProduct(request: UpdateProductRequest): Promise<UpdateProductResponse>;
|
package/dist/gen/catalog.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc v3.21.12
|
|
6
6
|
// source: catalog.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.Flavor = exports.Availability = exports.PotencyUnit = exports.Genetics = exports.ProductStatus = exports.ProductType = exports.protobufFileName = exports.protobufPackage = void 0;
|
|
8
|
+
exports.Flavor = exports.ProductSort = exports.Availability = exports.PotencyUnit = exports.Genetics = exports.ProductStatus = exports.ProductType = exports.protobufFileName = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
exports.protobufPackage = "catalog.v1";
|
|
11
11
|
exports.protobufFileName = "catalog.proto";
|
|
@@ -48,6 +48,16 @@ var Availability;
|
|
|
48
48
|
Availability[Availability["AVAILABILITY_SOLD_OUT"] = 3] = "AVAILABILITY_SOLD_OUT";
|
|
49
49
|
Availability[Availability["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
50
50
|
})(Availability || (exports.Availability = Availability = {}));
|
|
51
|
+
var ProductSort;
|
|
52
|
+
(function (ProductSort) {
|
|
53
|
+
ProductSort[ProductSort["PRODUCT_SORT_UNSPECIFIED"] = 0] = "PRODUCT_SORT_UNSPECIFIED";
|
|
54
|
+
ProductSort[ProductSort["PRODUCT_SORT_NEWEST"] = 1] = "PRODUCT_SORT_NEWEST";
|
|
55
|
+
ProductSort[ProductSort["PRODUCT_SORT_NAME"] = 2] = "PRODUCT_SORT_NAME";
|
|
56
|
+
ProductSort[ProductSort["PRODUCT_SORT_THC_DESC"] = 3] = "PRODUCT_SORT_THC_DESC";
|
|
57
|
+
ProductSort[ProductSort["PRODUCT_SORT_THC_ASC"] = 4] = "PRODUCT_SORT_THC_ASC";
|
|
58
|
+
ProductSort[ProductSort["PRODUCT_SORT_CBD_DESC"] = 5] = "PRODUCT_SORT_CBD_DESC";
|
|
59
|
+
ProductSort[ProductSort["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
60
|
+
})(ProductSort || (exports.ProductSort = ProductSort = {}));
|
|
51
61
|
var Flavor;
|
|
52
62
|
(function (Flavor) {
|
|
53
63
|
Flavor[Flavor["FLAVOR_UNSPECIFIED"] = 0] = "FLAVOR_UNSPECIFIED";
|
package/dist/nest/catalog.d.ts
CHANGED
|
@@ -35,6 +35,15 @@ export declare enum Availability {
|
|
|
35
35
|
AVAILABILITY_SOLD_OUT = 3,
|
|
36
36
|
UNRECOGNIZED = -1
|
|
37
37
|
}
|
|
38
|
+
export declare enum ProductSort {
|
|
39
|
+
PRODUCT_SORT_UNSPECIFIED = 0,
|
|
40
|
+
PRODUCT_SORT_NEWEST = 1,
|
|
41
|
+
PRODUCT_SORT_NAME = 2,
|
|
42
|
+
PRODUCT_SORT_THC_DESC = 3,
|
|
43
|
+
PRODUCT_SORT_THC_ASC = 4,
|
|
44
|
+
PRODUCT_SORT_CBD_DESC = 5,
|
|
45
|
+
UNRECOGNIZED = -1
|
|
46
|
+
}
|
|
38
47
|
export declare enum Flavor {
|
|
39
48
|
FLAVOR_UNSPECIFIED = 0,
|
|
40
49
|
FLAVOR_EARTHY = 1,
|
|
@@ -113,6 +122,18 @@ export interface ProductInput {
|
|
|
113
122
|
price?: number | undefined;
|
|
114
123
|
availability: Availability;
|
|
115
124
|
}
|
|
125
|
+
export interface PotencyRange {
|
|
126
|
+
min?: number | undefined;
|
|
127
|
+
max?: number | undefined;
|
|
128
|
+
}
|
|
129
|
+
export interface ProductFilter {
|
|
130
|
+
genetics: Genetics[];
|
|
131
|
+
manufacturerSlugs: string[];
|
|
132
|
+
countries: string[];
|
|
133
|
+
thc?: PotencyRange | undefined;
|
|
134
|
+
cbd?: PotencyRange | undefined;
|
|
135
|
+
isIrradiated?: boolean | undefined;
|
|
136
|
+
}
|
|
116
137
|
export interface ListProductsRequest {
|
|
117
138
|
query?: string | undefined;
|
|
118
139
|
type?: ProductType | undefined;
|
|
@@ -120,12 +141,53 @@ export interface ListProductsRequest {
|
|
|
120
141
|
cursor?: string | undefined;
|
|
121
142
|
limit: number;
|
|
122
143
|
ids: string[];
|
|
144
|
+
sort?: ProductSort | undefined;
|
|
145
|
+
filter?: ProductFilter | undefined;
|
|
123
146
|
}
|
|
124
147
|
export interface ListProductsResponse {
|
|
125
148
|
products: Product[];
|
|
126
149
|
nextCursor?: string | undefined;
|
|
127
150
|
total: number;
|
|
128
151
|
}
|
|
152
|
+
export interface GetProductFacetsRequest {
|
|
153
|
+
query?: string | undefined;
|
|
154
|
+
type?: ProductType | undefined;
|
|
155
|
+
status?: ProductStatus | undefined;
|
|
156
|
+
filter?: ProductFilter | undefined;
|
|
157
|
+
}
|
|
158
|
+
export interface ProductTypeFacet {
|
|
159
|
+
type: ProductType;
|
|
160
|
+
count: number;
|
|
161
|
+
}
|
|
162
|
+
export interface GeneticsFacet {
|
|
163
|
+
genetics: Genetics;
|
|
164
|
+
count: number;
|
|
165
|
+
}
|
|
166
|
+
export interface ManufacturerFacet {
|
|
167
|
+
manufacturer: Manufacturer | undefined;
|
|
168
|
+
count: number;
|
|
169
|
+
}
|
|
170
|
+
export interface CountryFacet {
|
|
171
|
+
country: string;
|
|
172
|
+
count: number;
|
|
173
|
+
}
|
|
174
|
+
export interface IrradiationFacet {
|
|
175
|
+
isIrradiated: boolean;
|
|
176
|
+
count: number;
|
|
177
|
+
}
|
|
178
|
+
export interface PotencyBounds {
|
|
179
|
+
min: number;
|
|
180
|
+
max: number;
|
|
181
|
+
}
|
|
182
|
+
export interface GetProductFacetsResponse {
|
|
183
|
+
types: ProductTypeFacet[];
|
|
184
|
+
genetics: GeneticsFacet[];
|
|
185
|
+
manufacturers: ManufacturerFacet[];
|
|
186
|
+
countries: CountryFacet[];
|
|
187
|
+
irradiation: IrradiationFacet[];
|
|
188
|
+
thc?: PotencyBounds | undefined;
|
|
189
|
+
cbd?: PotencyBounds | undefined;
|
|
190
|
+
}
|
|
129
191
|
export interface GetProductRequest {
|
|
130
192
|
id: string;
|
|
131
193
|
}
|
|
@@ -246,6 +308,7 @@ export interface DeleteTerpeneResponse {
|
|
|
246
308
|
export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
247
309
|
export interface CatalogServiceClient {
|
|
248
310
|
listProducts(request: ListProductsRequest): Observable<ListProductsResponse>;
|
|
311
|
+
getProductFacets(request: GetProductFacetsRequest): Observable<GetProductFacetsResponse>;
|
|
249
312
|
getProduct(request: GetProductRequest): Observable<GetProductResponse>;
|
|
250
313
|
createProduct(request: CreateProductRequest): Observable<CreateProductResponse>;
|
|
251
314
|
updateProduct(request: UpdateProductRequest): Observable<UpdateProductResponse>;
|
|
@@ -268,6 +331,7 @@ export interface CatalogServiceClient {
|
|
|
268
331
|
}
|
|
269
332
|
export interface CatalogServiceController {
|
|
270
333
|
listProducts(request: ListProductsRequest): Promise<ListProductsResponse> | Observable<ListProductsResponse> | ListProductsResponse;
|
|
334
|
+
getProductFacets(request: GetProductFacetsRequest): Promise<GetProductFacetsResponse> | Observable<GetProductFacetsResponse> | GetProductFacetsResponse;
|
|
271
335
|
getProduct(request: GetProductRequest): Promise<GetProductResponse> | Observable<GetProductResponse> | GetProductResponse;
|
|
272
336
|
createProduct(request: CreateProductRequest): Promise<CreateProductResponse> | Observable<CreateProductResponse> | CreateProductResponse;
|
|
273
337
|
updateProduct(request: UpdateProductRequest): Promise<UpdateProductResponse> | Observable<UpdateProductResponse> | UpdateProductResponse;
|
package/dist/nest/catalog.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc v3.21.12
|
|
6
6
|
// source: catalog.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.CATALOG_SERVICE_NAME = exports.CATALOG_V1_PACKAGE_NAME = exports.Flavor = exports.Availability = exports.PotencyUnit = exports.Genetics = exports.ProductStatus = exports.ProductType = exports.protobufFileName = exports.protobufPackage = void 0;
|
|
8
|
+
exports.CATALOG_SERVICE_NAME = exports.CATALOG_V1_PACKAGE_NAME = exports.Flavor = exports.ProductSort = exports.Availability = exports.PotencyUnit = exports.Genetics = exports.ProductStatus = exports.ProductType = exports.protobufFileName = exports.protobufPackage = void 0;
|
|
9
9
|
exports.CatalogServiceControllerMethods = CatalogServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const microservices_1 = require("@nestjs/microservices");
|
|
@@ -50,6 +50,16 @@ var Availability;
|
|
|
50
50
|
Availability[Availability["AVAILABILITY_SOLD_OUT"] = 3] = "AVAILABILITY_SOLD_OUT";
|
|
51
51
|
Availability[Availability["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
52
52
|
})(Availability || (exports.Availability = Availability = {}));
|
|
53
|
+
var ProductSort;
|
|
54
|
+
(function (ProductSort) {
|
|
55
|
+
ProductSort[ProductSort["PRODUCT_SORT_UNSPECIFIED"] = 0] = "PRODUCT_SORT_UNSPECIFIED";
|
|
56
|
+
ProductSort[ProductSort["PRODUCT_SORT_NEWEST"] = 1] = "PRODUCT_SORT_NEWEST";
|
|
57
|
+
ProductSort[ProductSort["PRODUCT_SORT_NAME"] = 2] = "PRODUCT_SORT_NAME";
|
|
58
|
+
ProductSort[ProductSort["PRODUCT_SORT_THC_DESC"] = 3] = "PRODUCT_SORT_THC_DESC";
|
|
59
|
+
ProductSort[ProductSort["PRODUCT_SORT_THC_ASC"] = 4] = "PRODUCT_SORT_THC_ASC";
|
|
60
|
+
ProductSort[ProductSort["PRODUCT_SORT_CBD_DESC"] = 5] = "PRODUCT_SORT_CBD_DESC";
|
|
61
|
+
ProductSort[ProductSort["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
62
|
+
})(ProductSort || (exports.ProductSort = ProductSort = {}));
|
|
53
63
|
var Flavor;
|
|
54
64
|
(function (Flavor) {
|
|
55
65
|
Flavor[Flavor["FLAVOR_UNSPECIFIED"] = 0] = "FLAVOR_UNSPECIFIED";
|
|
@@ -78,6 +88,7 @@ function CatalogServiceControllerMethods() {
|
|
|
78
88
|
return function (constructor) {
|
|
79
89
|
const grpcMethods = [
|
|
80
90
|
"listProducts",
|
|
91
|
+
"getProductFacets",
|
|
81
92
|
"getProduct",
|
|
82
93
|
"createProduct",
|
|
83
94
|
"updateProduct",
|
package/package.json
CHANGED
package/proto/catalog.proto
CHANGED
|
@@ -4,6 +4,7 @@ package catalog.v1;
|
|
|
4
4
|
|
|
5
5
|
service CatalogService {
|
|
6
6
|
rpc ListProducts (ListProductsRequest) returns (ListProductsResponse);
|
|
7
|
+
rpc GetProductFacets (GetProductFacetsRequest) returns (GetProductFacetsResponse);
|
|
7
8
|
rpc GetProduct (GetProductRequest) returns (GetProductResponse);
|
|
8
9
|
rpc CreateProduct (CreateProductRequest) returns (CreateProductResponse);
|
|
9
10
|
rpc UpdateProduct (UpdateProductRequest) returns (UpdateProductResponse);
|
|
@@ -62,6 +63,15 @@ enum Availability {
|
|
|
62
63
|
AVAILABILITY_SOLD_OUT = 3;
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
enum ProductSort {
|
|
67
|
+
PRODUCT_SORT_UNSPECIFIED = 0;
|
|
68
|
+
PRODUCT_SORT_NEWEST = 1;
|
|
69
|
+
PRODUCT_SORT_NAME = 2;
|
|
70
|
+
PRODUCT_SORT_THC_DESC = 3;
|
|
71
|
+
PRODUCT_SORT_THC_ASC = 4;
|
|
72
|
+
PRODUCT_SORT_CBD_DESC = 5;
|
|
73
|
+
}
|
|
74
|
+
|
|
65
75
|
enum Flavor {
|
|
66
76
|
FLAVOR_UNSPECIFIED = 0;
|
|
67
77
|
FLAVOR_EARTHY = 1;
|
|
@@ -145,6 +155,20 @@ message ProductInput {
|
|
|
145
155
|
Availability availability = 15;
|
|
146
156
|
}
|
|
147
157
|
|
|
158
|
+
message PotencyRange {
|
|
159
|
+
optional double min = 1;
|
|
160
|
+
optional double max = 2;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
message ProductFilter {
|
|
164
|
+
repeated Genetics genetics = 1;
|
|
165
|
+
repeated string manufacturer_slugs = 2;
|
|
166
|
+
repeated string countries = 3;
|
|
167
|
+
optional PotencyRange thc = 4;
|
|
168
|
+
optional PotencyRange cbd = 5;
|
|
169
|
+
optional bool is_irradiated = 6;
|
|
170
|
+
}
|
|
171
|
+
|
|
148
172
|
message ListProductsRequest {
|
|
149
173
|
optional string query = 1;
|
|
150
174
|
optional ProductType type = 2;
|
|
@@ -152,6 +176,8 @@ message ListProductsRequest {
|
|
|
152
176
|
optional string cursor = 4;
|
|
153
177
|
int32 limit = 5;
|
|
154
178
|
repeated string ids = 6;
|
|
179
|
+
optional ProductSort sort = 7;
|
|
180
|
+
optional ProductFilter filter = 8;
|
|
155
181
|
}
|
|
156
182
|
|
|
157
183
|
message ListProductsResponse {
|
|
@@ -160,6 +186,53 @@ message ListProductsResponse {
|
|
|
160
186
|
int32 total = 3;
|
|
161
187
|
}
|
|
162
188
|
|
|
189
|
+
message GetProductFacetsRequest {
|
|
190
|
+
optional string query = 1;
|
|
191
|
+
optional ProductType type = 2;
|
|
192
|
+
optional ProductStatus status = 3;
|
|
193
|
+
optional ProductFilter filter = 4;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
message ProductTypeFacet {
|
|
197
|
+
ProductType type = 1;
|
|
198
|
+
int32 count = 2;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
message GeneticsFacet {
|
|
202
|
+
Genetics genetics = 1;
|
|
203
|
+
int32 count = 2;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
message ManufacturerFacet {
|
|
207
|
+
Manufacturer manufacturer = 1;
|
|
208
|
+
int32 count = 2;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
message CountryFacet {
|
|
212
|
+
string country = 1;
|
|
213
|
+
int32 count = 2;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
message IrradiationFacet {
|
|
217
|
+
bool is_irradiated = 1;
|
|
218
|
+
int32 count = 2;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
message PotencyBounds {
|
|
222
|
+
double min = 1;
|
|
223
|
+
double max = 2;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
message GetProductFacetsResponse {
|
|
227
|
+
repeated ProductTypeFacet types = 1;
|
|
228
|
+
repeated GeneticsFacet genetics = 2;
|
|
229
|
+
repeated ManufacturerFacet manufacturers = 3;
|
|
230
|
+
repeated CountryFacet countries = 4;
|
|
231
|
+
repeated IrradiationFacet irradiation = 5;
|
|
232
|
+
optional PotencyBounds thc = 6;
|
|
233
|
+
optional PotencyBounds cbd = 7;
|
|
234
|
+
}
|
|
235
|
+
|
|
163
236
|
message GetProductRequest {
|
|
164
237
|
string id = 1;
|
|
165
238
|
}
|