@candesk/contracts 6.47.0 → 6.48.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 +239 -0
- package/dist/gen/catalog.js +63 -1
- package/dist/nest/catalog.d.ts +257 -0
- package/dist/nest/catalog.js +84 -2
- package/package.json +1 -1
- package/proto/catalog.proto +280 -0
package/dist/gen/catalog.d.ts
CHANGED
|
@@ -1,15 +1,254 @@
|
|
|
1
1
|
export declare const protobufPackage = "catalog.v1";
|
|
2
2
|
export declare const protobufFileName = "catalog.proto";
|
|
3
|
+
export declare enum ProductType {
|
|
4
|
+
PRODUCT_TYPE_UNSPECIFIED = 0,
|
|
5
|
+
PRODUCT_TYPE_FLOWER = 1,
|
|
6
|
+
PRODUCT_TYPE_EXTRACT = 2,
|
|
7
|
+
UNRECOGNIZED = -1
|
|
8
|
+
}
|
|
9
|
+
export declare enum ProductStatus {
|
|
10
|
+
PRODUCT_STATUS_UNSPECIFIED = 0,
|
|
11
|
+
PRODUCT_STATUS_DRAFT = 1,
|
|
12
|
+
PRODUCT_STATUS_PUBLISHED = 2,
|
|
13
|
+
UNRECOGNIZED = -1
|
|
14
|
+
}
|
|
15
|
+
export declare enum Genetics {
|
|
16
|
+
GENETICS_UNSPECIFIED = 0,
|
|
17
|
+
GENETICS_SATIVA = 1,
|
|
18
|
+
GENETICS_SATIVA_DOMINANT = 2,
|
|
19
|
+
GENETICS_HYBRID = 3,
|
|
20
|
+
GENETICS_INDICA_DOMINANT = 4,
|
|
21
|
+
GENETICS_INDICA = 5,
|
|
22
|
+
UNRECOGNIZED = -1
|
|
23
|
+
}
|
|
24
|
+
export declare enum PotencyUnit {
|
|
25
|
+
POTENCY_UNIT_UNSPECIFIED = 0,
|
|
26
|
+
POTENCY_UNIT_PERCENT = 1,
|
|
27
|
+
POTENCY_UNIT_MG_PER_ML = 2,
|
|
28
|
+
UNRECOGNIZED = -1
|
|
29
|
+
}
|
|
30
|
+
export declare enum Availability {
|
|
31
|
+
AVAILABILITY_UNSPECIFIED = 0,
|
|
32
|
+
AVAILABILITY_UNKNOWN = 1,
|
|
33
|
+
AVAILABILITY_AVAILABLE = 2,
|
|
34
|
+
AVAILABILITY_SOLD_OUT = 3,
|
|
35
|
+
UNRECOGNIZED = -1
|
|
36
|
+
}
|
|
37
|
+
export declare enum Flavor {
|
|
38
|
+
FLAVOR_UNSPECIFIED = 0,
|
|
39
|
+
FLAVOR_EARTHY = 1,
|
|
40
|
+
FLAVOR_WOODY = 2,
|
|
41
|
+
FLAVOR_PINE = 3,
|
|
42
|
+
FLAVOR_HERBAL = 4,
|
|
43
|
+
FLAVOR_FLORAL = 5,
|
|
44
|
+
FLAVOR_CITRUS = 6,
|
|
45
|
+
FLAVOR_FRUITY = 7,
|
|
46
|
+
FLAVOR_BERRY = 8,
|
|
47
|
+
FLAVOR_TROPICAL = 9,
|
|
48
|
+
FLAVOR_SWEET = 10,
|
|
49
|
+
FLAVOR_SPICY = 11,
|
|
50
|
+
FLAVOR_PEPPERY = 12,
|
|
51
|
+
FLAVOR_MENTHOL = 13,
|
|
52
|
+
FLAVOR_CHEESE = 14,
|
|
53
|
+
FLAVOR_SKUNK = 15,
|
|
54
|
+
FLAVOR_DIESEL = 16,
|
|
55
|
+
FLAVOR_GASSY = 17,
|
|
56
|
+
FLAVOR_CHEMICAL = 18,
|
|
57
|
+
UNRECOGNIZED = -1
|
|
58
|
+
}
|
|
59
|
+
export interface Manufacturer {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
slug: string;
|
|
63
|
+
}
|
|
64
|
+
export interface Strain {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
slug: string;
|
|
68
|
+
}
|
|
3
69
|
export interface Terpene {
|
|
4
70
|
id: string;
|
|
5
71
|
name: string;
|
|
6
72
|
slug: string;
|
|
7
73
|
}
|
|
74
|
+
export interface Product {
|
|
75
|
+
id: string;
|
|
76
|
+
number: number;
|
|
77
|
+
name: string;
|
|
78
|
+
type: ProductType;
|
|
79
|
+
status: ProductStatus;
|
|
80
|
+
manufacturer: Manufacturer | undefined;
|
|
81
|
+
strain?: Strain | undefined;
|
|
82
|
+
genetics?: Genetics | undefined;
|
|
83
|
+
thc: number;
|
|
84
|
+
cbd: number;
|
|
85
|
+
potencyUnit: PotencyUnit;
|
|
86
|
+
country?: string | undefined;
|
|
87
|
+
isIrradiated: boolean;
|
|
88
|
+
flavors: Flavor[];
|
|
89
|
+
terpenes: Terpene[];
|
|
90
|
+
description?: string | undefined;
|
|
91
|
+
price?: number | undefined;
|
|
92
|
+
availability: Availability;
|
|
93
|
+
publishedAt?: string | undefined;
|
|
94
|
+
createdAt: string;
|
|
95
|
+
updatedAt: string;
|
|
96
|
+
}
|
|
97
|
+
export interface ProductInput {
|
|
98
|
+
name: string;
|
|
99
|
+
type: ProductType;
|
|
100
|
+
manufacturerId: string;
|
|
101
|
+
strainId?: string | undefined;
|
|
102
|
+
genetics?: Genetics | undefined;
|
|
103
|
+
thc: number;
|
|
104
|
+
cbd: number;
|
|
105
|
+
potencyUnit: PotencyUnit;
|
|
106
|
+
country?: string | undefined;
|
|
107
|
+
isIrradiated: boolean;
|
|
108
|
+
flavors: Flavor[];
|
|
109
|
+
terpeneIds: string[];
|
|
110
|
+
description?: string | undefined;
|
|
111
|
+
price?: number | undefined;
|
|
112
|
+
availability: Availability;
|
|
113
|
+
}
|
|
114
|
+
export interface ListProductsRequest {
|
|
115
|
+
query?: string | undefined;
|
|
116
|
+
type?: ProductType | undefined;
|
|
117
|
+
status?: ProductStatus | undefined;
|
|
118
|
+
cursor?: string | undefined;
|
|
119
|
+
limit: number;
|
|
120
|
+
}
|
|
121
|
+
export interface ListProductsResponse {
|
|
122
|
+
products: Product[];
|
|
123
|
+
nextCursor?: string | undefined;
|
|
124
|
+
}
|
|
125
|
+
export interface GetProductRequest {
|
|
126
|
+
id: string;
|
|
127
|
+
}
|
|
128
|
+
export interface GetProductResponse {
|
|
129
|
+
product: Product | undefined;
|
|
130
|
+
}
|
|
131
|
+
export interface CreateProductRequest {
|
|
132
|
+
product: ProductInput | undefined;
|
|
133
|
+
}
|
|
134
|
+
export interface CreateProductResponse {
|
|
135
|
+
product: Product | undefined;
|
|
136
|
+
}
|
|
137
|
+
export interface UpdateProductRequest {
|
|
138
|
+
id: string;
|
|
139
|
+
product: ProductInput | undefined;
|
|
140
|
+
}
|
|
141
|
+
export interface UpdateProductResponse {
|
|
142
|
+
product: Product | undefined;
|
|
143
|
+
}
|
|
144
|
+
export interface PublishProductRequest {
|
|
145
|
+
id: string;
|
|
146
|
+
}
|
|
147
|
+
export interface PublishProductResponse {
|
|
148
|
+
product: Product | undefined;
|
|
149
|
+
}
|
|
150
|
+
export interface UnpublishProductRequest {
|
|
151
|
+
id: string;
|
|
152
|
+
}
|
|
153
|
+
export interface UnpublishProductResponse {
|
|
154
|
+
product: Product | undefined;
|
|
155
|
+
}
|
|
156
|
+
export interface DeleteProductRequest {
|
|
157
|
+
id: string;
|
|
158
|
+
}
|
|
159
|
+
export interface DeleteProductResponse {
|
|
160
|
+
product: Product | undefined;
|
|
161
|
+
}
|
|
162
|
+
export interface ListManufacturersRequest {
|
|
163
|
+
}
|
|
164
|
+
export interface ListManufacturersResponse {
|
|
165
|
+
manufacturers: Manufacturer[];
|
|
166
|
+
}
|
|
167
|
+
export interface CreateManufacturerRequest {
|
|
168
|
+
name: string;
|
|
169
|
+
}
|
|
170
|
+
export interface CreateManufacturerResponse {
|
|
171
|
+
manufacturer: Manufacturer | undefined;
|
|
172
|
+
}
|
|
173
|
+
export interface UpdateManufacturerRequest {
|
|
174
|
+
id: string;
|
|
175
|
+
name: string;
|
|
176
|
+
}
|
|
177
|
+
export interface UpdateManufacturerResponse {
|
|
178
|
+
manufacturer: Manufacturer | undefined;
|
|
179
|
+
}
|
|
180
|
+
export interface DeleteManufacturerRequest {
|
|
181
|
+
id: string;
|
|
182
|
+
}
|
|
183
|
+
export interface DeleteManufacturerResponse {
|
|
184
|
+
manufacturer: Manufacturer | undefined;
|
|
185
|
+
}
|
|
186
|
+
export interface ListStrainsRequest {
|
|
187
|
+
}
|
|
188
|
+
export interface ListStrainsResponse {
|
|
189
|
+
strains: Strain[];
|
|
190
|
+
}
|
|
191
|
+
export interface CreateStrainRequest {
|
|
192
|
+
name: string;
|
|
193
|
+
}
|
|
194
|
+
export interface CreateStrainResponse {
|
|
195
|
+
strain: Strain | undefined;
|
|
196
|
+
}
|
|
197
|
+
export interface UpdateStrainRequest {
|
|
198
|
+
id: string;
|
|
199
|
+
name: string;
|
|
200
|
+
}
|
|
201
|
+
export interface UpdateStrainResponse {
|
|
202
|
+
strain: Strain | undefined;
|
|
203
|
+
}
|
|
204
|
+
export interface DeleteStrainRequest {
|
|
205
|
+
id: string;
|
|
206
|
+
}
|
|
207
|
+
export interface DeleteStrainResponse {
|
|
208
|
+
strain: Strain | undefined;
|
|
209
|
+
}
|
|
8
210
|
export interface ListTerpenesRequest {
|
|
9
211
|
}
|
|
10
212
|
export interface ListTerpenesResponse {
|
|
11
213
|
terpenes: Terpene[];
|
|
12
214
|
}
|
|
215
|
+
export interface CreateTerpeneRequest {
|
|
216
|
+
name: string;
|
|
217
|
+
}
|
|
218
|
+
export interface CreateTerpeneResponse {
|
|
219
|
+
terpene: Terpene | undefined;
|
|
220
|
+
}
|
|
221
|
+
export interface UpdateTerpeneRequest {
|
|
222
|
+
id: string;
|
|
223
|
+
name: string;
|
|
224
|
+
}
|
|
225
|
+
export interface UpdateTerpeneResponse {
|
|
226
|
+
terpene: Terpene | undefined;
|
|
227
|
+
}
|
|
228
|
+
export interface DeleteTerpeneRequest {
|
|
229
|
+
id: string;
|
|
230
|
+
}
|
|
231
|
+
export interface DeleteTerpeneResponse {
|
|
232
|
+
terpene: Terpene | undefined;
|
|
233
|
+
}
|
|
13
234
|
export interface CatalogService {
|
|
235
|
+
listProducts(request: ListProductsRequest): Promise<ListProductsResponse>;
|
|
236
|
+
getProduct(request: GetProductRequest): Promise<GetProductResponse>;
|
|
237
|
+
createProduct(request: CreateProductRequest): Promise<CreateProductResponse>;
|
|
238
|
+
updateProduct(request: UpdateProductRequest): Promise<UpdateProductResponse>;
|
|
239
|
+
publishProduct(request: PublishProductRequest): Promise<PublishProductResponse>;
|
|
240
|
+
unpublishProduct(request: UnpublishProductRequest): Promise<UnpublishProductResponse>;
|
|
241
|
+
deleteProduct(request: DeleteProductRequest): Promise<DeleteProductResponse>;
|
|
242
|
+
listManufacturers(request: ListManufacturersRequest): Promise<ListManufacturersResponse>;
|
|
243
|
+
createManufacturer(request: CreateManufacturerRequest): Promise<CreateManufacturerResponse>;
|
|
244
|
+
updateManufacturer(request: UpdateManufacturerRequest): Promise<UpdateManufacturerResponse>;
|
|
245
|
+
deleteManufacturer(request: DeleteManufacturerRequest): Promise<DeleteManufacturerResponse>;
|
|
246
|
+
listStrains(request: ListStrainsRequest): Promise<ListStrainsResponse>;
|
|
247
|
+
createStrain(request: CreateStrainRequest): Promise<CreateStrainResponse>;
|
|
248
|
+
updateStrain(request: UpdateStrainRequest): Promise<UpdateStrainResponse>;
|
|
249
|
+
deleteStrain(request: DeleteStrainRequest): Promise<DeleteStrainResponse>;
|
|
14
250
|
listTerpenes(request: ListTerpenesRequest): Promise<ListTerpenesResponse>;
|
|
251
|
+
createTerpene(request: CreateTerpeneRequest): Promise<CreateTerpeneResponse>;
|
|
252
|
+
updateTerpene(request: UpdateTerpeneRequest): Promise<UpdateTerpeneResponse>;
|
|
253
|
+
deleteTerpene(request: DeleteTerpeneRequest): Promise<DeleteTerpeneResponse>;
|
|
15
254
|
}
|
package/dist/gen/catalog.js
CHANGED
|
@@ -5,7 +5,69 @@
|
|
|
5
5
|
// protoc v3.21.12
|
|
6
6
|
// source: catalog.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.protobufFileName = exports.protobufPackage = void 0;
|
|
8
|
+
exports.Flavor = 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";
|
|
12
|
+
var ProductType;
|
|
13
|
+
(function (ProductType) {
|
|
14
|
+
ProductType[ProductType["PRODUCT_TYPE_UNSPECIFIED"] = 0] = "PRODUCT_TYPE_UNSPECIFIED";
|
|
15
|
+
ProductType[ProductType["PRODUCT_TYPE_FLOWER"] = 1] = "PRODUCT_TYPE_FLOWER";
|
|
16
|
+
ProductType[ProductType["PRODUCT_TYPE_EXTRACT"] = 2] = "PRODUCT_TYPE_EXTRACT";
|
|
17
|
+
ProductType[ProductType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
18
|
+
})(ProductType || (exports.ProductType = ProductType = {}));
|
|
19
|
+
var ProductStatus;
|
|
20
|
+
(function (ProductStatus) {
|
|
21
|
+
ProductStatus[ProductStatus["PRODUCT_STATUS_UNSPECIFIED"] = 0] = "PRODUCT_STATUS_UNSPECIFIED";
|
|
22
|
+
ProductStatus[ProductStatus["PRODUCT_STATUS_DRAFT"] = 1] = "PRODUCT_STATUS_DRAFT";
|
|
23
|
+
ProductStatus[ProductStatus["PRODUCT_STATUS_PUBLISHED"] = 2] = "PRODUCT_STATUS_PUBLISHED";
|
|
24
|
+
ProductStatus[ProductStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
25
|
+
})(ProductStatus || (exports.ProductStatus = ProductStatus = {}));
|
|
26
|
+
var Genetics;
|
|
27
|
+
(function (Genetics) {
|
|
28
|
+
Genetics[Genetics["GENETICS_UNSPECIFIED"] = 0] = "GENETICS_UNSPECIFIED";
|
|
29
|
+
Genetics[Genetics["GENETICS_SATIVA"] = 1] = "GENETICS_SATIVA";
|
|
30
|
+
Genetics[Genetics["GENETICS_SATIVA_DOMINANT"] = 2] = "GENETICS_SATIVA_DOMINANT";
|
|
31
|
+
Genetics[Genetics["GENETICS_HYBRID"] = 3] = "GENETICS_HYBRID";
|
|
32
|
+
Genetics[Genetics["GENETICS_INDICA_DOMINANT"] = 4] = "GENETICS_INDICA_DOMINANT";
|
|
33
|
+
Genetics[Genetics["GENETICS_INDICA"] = 5] = "GENETICS_INDICA";
|
|
34
|
+
Genetics[Genetics["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
35
|
+
})(Genetics || (exports.Genetics = Genetics = {}));
|
|
36
|
+
var PotencyUnit;
|
|
37
|
+
(function (PotencyUnit) {
|
|
38
|
+
PotencyUnit[PotencyUnit["POTENCY_UNIT_UNSPECIFIED"] = 0] = "POTENCY_UNIT_UNSPECIFIED";
|
|
39
|
+
PotencyUnit[PotencyUnit["POTENCY_UNIT_PERCENT"] = 1] = "POTENCY_UNIT_PERCENT";
|
|
40
|
+
PotencyUnit[PotencyUnit["POTENCY_UNIT_MG_PER_ML"] = 2] = "POTENCY_UNIT_MG_PER_ML";
|
|
41
|
+
PotencyUnit[PotencyUnit["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
42
|
+
})(PotencyUnit || (exports.PotencyUnit = PotencyUnit = {}));
|
|
43
|
+
var Availability;
|
|
44
|
+
(function (Availability) {
|
|
45
|
+
Availability[Availability["AVAILABILITY_UNSPECIFIED"] = 0] = "AVAILABILITY_UNSPECIFIED";
|
|
46
|
+
Availability[Availability["AVAILABILITY_UNKNOWN"] = 1] = "AVAILABILITY_UNKNOWN";
|
|
47
|
+
Availability[Availability["AVAILABILITY_AVAILABLE"] = 2] = "AVAILABILITY_AVAILABLE";
|
|
48
|
+
Availability[Availability["AVAILABILITY_SOLD_OUT"] = 3] = "AVAILABILITY_SOLD_OUT";
|
|
49
|
+
Availability[Availability["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
50
|
+
})(Availability || (exports.Availability = Availability = {}));
|
|
51
|
+
var Flavor;
|
|
52
|
+
(function (Flavor) {
|
|
53
|
+
Flavor[Flavor["FLAVOR_UNSPECIFIED"] = 0] = "FLAVOR_UNSPECIFIED";
|
|
54
|
+
Flavor[Flavor["FLAVOR_EARTHY"] = 1] = "FLAVOR_EARTHY";
|
|
55
|
+
Flavor[Flavor["FLAVOR_WOODY"] = 2] = "FLAVOR_WOODY";
|
|
56
|
+
Flavor[Flavor["FLAVOR_PINE"] = 3] = "FLAVOR_PINE";
|
|
57
|
+
Flavor[Flavor["FLAVOR_HERBAL"] = 4] = "FLAVOR_HERBAL";
|
|
58
|
+
Flavor[Flavor["FLAVOR_FLORAL"] = 5] = "FLAVOR_FLORAL";
|
|
59
|
+
Flavor[Flavor["FLAVOR_CITRUS"] = 6] = "FLAVOR_CITRUS";
|
|
60
|
+
Flavor[Flavor["FLAVOR_FRUITY"] = 7] = "FLAVOR_FRUITY";
|
|
61
|
+
Flavor[Flavor["FLAVOR_BERRY"] = 8] = "FLAVOR_BERRY";
|
|
62
|
+
Flavor[Flavor["FLAVOR_TROPICAL"] = 9] = "FLAVOR_TROPICAL";
|
|
63
|
+
Flavor[Flavor["FLAVOR_SWEET"] = 10] = "FLAVOR_SWEET";
|
|
64
|
+
Flavor[Flavor["FLAVOR_SPICY"] = 11] = "FLAVOR_SPICY";
|
|
65
|
+
Flavor[Flavor["FLAVOR_PEPPERY"] = 12] = "FLAVOR_PEPPERY";
|
|
66
|
+
Flavor[Flavor["FLAVOR_MENTHOL"] = 13] = "FLAVOR_MENTHOL";
|
|
67
|
+
Flavor[Flavor["FLAVOR_CHEESE"] = 14] = "FLAVOR_CHEESE";
|
|
68
|
+
Flavor[Flavor["FLAVOR_SKUNK"] = 15] = "FLAVOR_SKUNK";
|
|
69
|
+
Flavor[Flavor["FLAVOR_DIESEL"] = 16] = "FLAVOR_DIESEL";
|
|
70
|
+
Flavor[Flavor["FLAVOR_GASSY"] = 17] = "FLAVOR_GASSY";
|
|
71
|
+
Flavor[Flavor["FLAVOR_CHEMICAL"] = 18] = "FLAVOR_CHEMICAL";
|
|
72
|
+
Flavor[Flavor["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
73
|
+
})(Flavor || (exports.Flavor = Flavor = {}));
|
package/dist/nest/catalog.d.ts
CHANGED
|
@@ -1,22 +1,279 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
2
|
export declare const protobufPackage = "catalog.v1";
|
|
3
3
|
export declare const protobufFileName = "catalog.proto";
|
|
4
|
+
export declare enum ProductType {
|
|
5
|
+
PRODUCT_TYPE_UNSPECIFIED = 0,
|
|
6
|
+
PRODUCT_TYPE_FLOWER = 1,
|
|
7
|
+
PRODUCT_TYPE_EXTRACT = 2,
|
|
8
|
+
UNRECOGNIZED = -1
|
|
9
|
+
}
|
|
10
|
+
export declare enum ProductStatus {
|
|
11
|
+
PRODUCT_STATUS_UNSPECIFIED = 0,
|
|
12
|
+
PRODUCT_STATUS_DRAFT = 1,
|
|
13
|
+
PRODUCT_STATUS_PUBLISHED = 2,
|
|
14
|
+
UNRECOGNIZED = -1
|
|
15
|
+
}
|
|
16
|
+
export declare enum Genetics {
|
|
17
|
+
GENETICS_UNSPECIFIED = 0,
|
|
18
|
+
GENETICS_SATIVA = 1,
|
|
19
|
+
GENETICS_SATIVA_DOMINANT = 2,
|
|
20
|
+
GENETICS_HYBRID = 3,
|
|
21
|
+
GENETICS_INDICA_DOMINANT = 4,
|
|
22
|
+
GENETICS_INDICA = 5,
|
|
23
|
+
UNRECOGNIZED = -1
|
|
24
|
+
}
|
|
25
|
+
export declare enum PotencyUnit {
|
|
26
|
+
POTENCY_UNIT_UNSPECIFIED = 0,
|
|
27
|
+
POTENCY_UNIT_PERCENT = 1,
|
|
28
|
+
POTENCY_UNIT_MG_PER_ML = 2,
|
|
29
|
+
UNRECOGNIZED = -1
|
|
30
|
+
}
|
|
31
|
+
export declare enum Availability {
|
|
32
|
+
AVAILABILITY_UNSPECIFIED = 0,
|
|
33
|
+
AVAILABILITY_UNKNOWN = 1,
|
|
34
|
+
AVAILABILITY_AVAILABLE = 2,
|
|
35
|
+
AVAILABILITY_SOLD_OUT = 3,
|
|
36
|
+
UNRECOGNIZED = -1
|
|
37
|
+
}
|
|
38
|
+
export declare enum Flavor {
|
|
39
|
+
FLAVOR_UNSPECIFIED = 0,
|
|
40
|
+
FLAVOR_EARTHY = 1,
|
|
41
|
+
FLAVOR_WOODY = 2,
|
|
42
|
+
FLAVOR_PINE = 3,
|
|
43
|
+
FLAVOR_HERBAL = 4,
|
|
44
|
+
FLAVOR_FLORAL = 5,
|
|
45
|
+
FLAVOR_CITRUS = 6,
|
|
46
|
+
FLAVOR_FRUITY = 7,
|
|
47
|
+
FLAVOR_BERRY = 8,
|
|
48
|
+
FLAVOR_TROPICAL = 9,
|
|
49
|
+
FLAVOR_SWEET = 10,
|
|
50
|
+
FLAVOR_SPICY = 11,
|
|
51
|
+
FLAVOR_PEPPERY = 12,
|
|
52
|
+
FLAVOR_MENTHOL = 13,
|
|
53
|
+
FLAVOR_CHEESE = 14,
|
|
54
|
+
FLAVOR_SKUNK = 15,
|
|
55
|
+
FLAVOR_DIESEL = 16,
|
|
56
|
+
FLAVOR_GASSY = 17,
|
|
57
|
+
FLAVOR_CHEMICAL = 18,
|
|
58
|
+
UNRECOGNIZED = -1
|
|
59
|
+
}
|
|
60
|
+
export interface Manufacturer {
|
|
61
|
+
id: string;
|
|
62
|
+
name: string;
|
|
63
|
+
slug: string;
|
|
64
|
+
}
|
|
65
|
+
export interface Strain {
|
|
66
|
+
id: string;
|
|
67
|
+
name: string;
|
|
68
|
+
slug: string;
|
|
69
|
+
}
|
|
4
70
|
export interface Terpene {
|
|
5
71
|
id: string;
|
|
6
72
|
name: string;
|
|
7
73
|
slug: string;
|
|
8
74
|
}
|
|
75
|
+
export interface Product {
|
|
76
|
+
id: string;
|
|
77
|
+
number: number;
|
|
78
|
+
name: string;
|
|
79
|
+
type: ProductType;
|
|
80
|
+
status: ProductStatus;
|
|
81
|
+
manufacturer: Manufacturer | undefined;
|
|
82
|
+
strain?: Strain | undefined;
|
|
83
|
+
genetics?: Genetics | undefined;
|
|
84
|
+
thc: number;
|
|
85
|
+
cbd: number;
|
|
86
|
+
potencyUnit: PotencyUnit;
|
|
87
|
+
country?: string | undefined;
|
|
88
|
+
isIrradiated: boolean;
|
|
89
|
+
flavors: Flavor[];
|
|
90
|
+
terpenes: Terpene[];
|
|
91
|
+
description?: string | undefined;
|
|
92
|
+
price?: number | undefined;
|
|
93
|
+
availability: Availability;
|
|
94
|
+
publishedAt?: string | undefined;
|
|
95
|
+
createdAt: string;
|
|
96
|
+
updatedAt: string;
|
|
97
|
+
}
|
|
98
|
+
export interface ProductInput {
|
|
99
|
+
name: string;
|
|
100
|
+
type: ProductType;
|
|
101
|
+
manufacturerId: string;
|
|
102
|
+
strainId?: string | undefined;
|
|
103
|
+
genetics?: Genetics | undefined;
|
|
104
|
+
thc: number;
|
|
105
|
+
cbd: number;
|
|
106
|
+
potencyUnit: PotencyUnit;
|
|
107
|
+
country?: string | undefined;
|
|
108
|
+
isIrradiated: boolean;
|
|
109
|
+
flavors: Flavor[];
|
|
110
|
+
terpeneIds: string[];
|
|
111
|
+
description?: string | undefined;
|
|
112
|
+
price?: number | undefined;
|
|
113
|
+
availability: Availability;
|
|
114
|
+
}
|
|
115
|
+
export interface ListProductsRequest {
|
|
116
|
+
query?: string | undefined;
|
|
117
|
+
type?: ProductType | undefined;
|
|
118
|
+
status?: ProductStatus | undefined;
|
|
119
|
+
cursor?: string | undefined;
|
|
120
|
+
limit: number;
|
|
121
|
+
}
|
|
122
|
+
export interface ListProductsResponse {
|
|
123
|
+
products: Product[];
|
|
124
|
+
nextCursor?: string | undefined;
|
|
125
|
+
}
|
|
126
|
+
export interface GetProductRequest {
|
|
127
|
+
id: string;
|
|
128
|
+
}
|
|
129
|
+
export interface GetProductResponse {
|
|
130
|
+
product: Product | undefined;
|
|
131
|
+
}
|
|
132
|
+
export interface CreateProductRequest {
|
|
133
|
+
product: ProductInput | undefined;
|
|
134
|
+
}
|
|
135
|
+
export interface CreateProductResponse {
|
|
136
|
+
product: Product | undefined;
|
|
137
|
+
}
|
|
138
|
+
export interface UpdateProductRequest {
|
|
139
|
+
id: string;
|
|
140
|
+
product: ProductInput | undefined;
|
|
141
|
+
}
|
|
142
|
+
export interface UpdateProductResponse {
|
|
143
|
+
product: Product | undefined;
|
|
144
|
+
}
|
|
145
|
+
export interface PublishProductRequest {
|
|
146
|
+
id: string;
|
|
147
|
+
}
|
|
148
|
+
export interface PublishProductResponse {
|
|
149
|
+
product: Product | undefined;
|
|
150
|
+
}
|
|
151
|
+
export interface UnpublishProductRequest {
|
|
152
|
+
id: string;
|
|
153
|
+
}
|
|
154
|
+
export interface UnpublishProductResponse {
|
|
155
|
+
product: Product | undefined;
|
|
156
|
+
}
|
|
157
|
+
export interface DeleteProductRequest {
|
|
158
|
+
id: string;
|
|
159
|
+
}
|
|
160
|
+
export interface DeleteProductResponse {
|
|
161
|
+
product: Product | undefined;
|
|
162
|
+
}
|
|
163
|
+
export interface ListManufacturersRequest {
|
|
164
|
+
}
|
|
165
|
+
export interface ListManufacturersResponse {
|
|
166
|
+
manufacturers: Manufacturer[];
|
|
167
|
+
}
|
|
168
|
+
export interface CreateManufacturerRequest {
|
|
169
|
+
name: string;
|
|
170
|
+
}
|
|
171
|
+
export interface CreateManufacturerResponse {
|
|
172
|
+
manufacturer: Manufacturer | undefined;
|
|
173
|
+
}
|
|
174
|
+
export interface UpdateManufacturerRequest {
|
|
175
|
+
id: string;
|
|
176
|
+
name: string;
|
|
177
|
+
}
|
|
178
|
+
export interface UpdateManufacturerResponse {
|
|
179
|
+
manufacturer: Manufacturer | undefined;
|
|
180
|
+
}
|
|
181
|
+
export interface DeleteManufacturerRequest {
|
|
182
|
+
id: string;
|
|
183
|
+
}
|
|
184
|
+
export interface DeleteManufacturerResponse {
|
|
185
|
+
manufacturer: Manufacturer | undefined;
|
|
186
|
+
}
|
|
187
|
+
export interface ListStrainsRequest {
|
|
188
|
+
}
|
|
189
|
+
export interface ListStrainsResponse {
|
|
190
|
+
strains: Strain[];
|
|
191
|
+
}
|
|
192
|
+
export interface CreateStrainRequest {
|
|
193
|
+
name: string;
|
|
194
|
+
}
|
|
195
|
+
export interface CreateStrainResponse {
|
|
196
|
+
strain: Strain | undefined;
|
|
197
|
+
}
|
|
198
|
+
export interface UpdateStrainRequest {
|
|
199
|
+
id: string;
|
|
200
|
+
name: string;
|
|
201
|
+
}
|
|
202
|
+
export interface UpdateStrainResponse {
|
|
203
|
+
strain: Strain | undefined;
|
|
204
|
+
}
|
|
205
|
+
export interface DeleteStrainRequest {
|
|
206
|
+
id: string;
|
|
207
|
+
}
|
|
208
|
+
export interface DeleteStrainResponse {
|
|
209
|
+
strain: Strain | undefined;
|
|
210
|
+
}
|
|
9
211
|
export interface ListTerpenesRequest {
|
|
10
212
|
}
|
|
11
213
|
export interface ListTerpenesResponse {
|
|
12
214
|
terpenes: Terpene[];
|
|
13
215
|
}
|
|
216
|
+
export interface CreateTerpeneRequest {
|
|
217
|
+
name: string;
|
|
218
|
+
}
|
|
219
|
+
export interface CreateTerpeneResponse {
|
|
220
|
+
terpene: Terpene | undefined;
|
|
221
|
+
}
|
|
222
|
+
export interface UpdateTerpeneRequest {
|
|
223
|
+
id: string;
|
|
224
|
+
name: string;
|
|
225
|
+
}
|
|
226
|
+
export interface UpdateTerpeneResponse {
|
|
227
|
+
terpene: Terpene | undefined;
|
|
228
|
+
}
|
|
229
|
+
export interface DeleteTerpeneRequest {
|
|
230
|
+
id: string;
|
|
231
|
+
}
|
|
232
|
+
export interface DeleteTerpeneResponse {
|
|
233
|
+
terpene: Terpene | undefined;
|
|
234
|
+
}
|
|
14
235
|
export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
15
236
|
export interface CatalogServiceClient {
|
|
237
|
+
listProducts(request: ListProductsRequest): Observable<ListProductsResponse>;
|
|
238
|
+
getProduct(request: GetProductRequest): Observable<GetProductResponse>;
|
|
239
|
+
createProduct(request: CreateProductRequest): Observable<CreateProductResponse>;
|
|
240
|
+
updateProduct(request: UpdateProductRequest): Observable<UpdateProductResponse>;
|
|
241
|
+
publishProduct(request: PublishProductRequest): Observable<PublishProductResponse>;
|
|
242
|
+
unpublishProduct(request: UnpublishProductRequest): Observable<UnpublishProductResponse>;
|
|
243
|
+
deleteProduct(request: DeleteProductRequest): Observable<DeleteProductResponse>;
|
|
244
|
+
listManufacturers(request: ListManufacturersRequest): Observable<ListManufacturersResponse>;
|
|
245
|
+
createManufacturer(request: CreateManufacturerRequest): Observable<CreateManufacturerResponse>;
|
|
246
|
+
updateManufacturer(request: UpdateManufacturerRequest): Observable<UpdateManufacturerResponse>;
|
|
247
|
+
deleteManufacturer(request: DeleteManufacturerRequest): Observable<DeleteManufacturerResponse>;
|
|
248
|
+
listStrains(request: ListStrainsRequest): Observable<ListStrainsResponse>;
|
|
249
|
+
createStrain(request: CreateStrainRequest): Observable<CreateStrainResponse>;
|
|
250
|
+
updateStrain(request: UpdateStrainRequest): Observable<UpdateStrainResponse>;
|
|
251
|
+
deleteStrain(request: DeleteStrainRequest): Observable<DeleteStrainResponse>;
|
|
16
252
|
listTerpenes(request: ListTerpenesRequest): Observable<ListTerpenesResponse>;
|
|
253
|
+
createTerpene(request: CreateTerpeneRequest): Observable<CreateTerpeneResponse>;
|
|
254
|
+
updateTerpene(request: UpdateTerpeneRequest): Observable<UpdateTerpeneResponse>;
|
|
255
|
+
deleteTerpene(request: DeleteTerpeneRequest): Observable<DeleteTerpeneResponse>;
|
|
17
256
|
}
|
|
18
257
|
export interface CatalogServiceController {
|
|
258
|
+
listProducts(request: ListProductsRequest): Promise<ListProductsResponse> | Observable<ListProductsResponse> | ListProductsResponse;
|
|
259
|
+
getProduct(request: GetProductRequest): Promise<GetProductResponse> | Observable<GetProductResponse> | GetProductResponse;
|
|
260
|
+
createProduct(request: CreateProductRequest): Promise<CreateProductResponse> | Observable<CreateProductResponse> | CreateProductResponse;
|
|
261
|
+
updateProduct(request: UpdateProductRequest): Promise<UpdateProductResponse> | Observable<UpdateProductResponse> | UpdateProductResponse;
|
|
262
|
+
publishProduct(request: PublishProductRequest): Promise<PublishProductResponse> | Observable<PublishProductResponse> | PublishProductResponse;
|
|
263
|
+
unpublishProduct(request: UnpublishProductRequest): Promise<UnpublishProductResponse> | Observable<UnpublishProductResponse> | UnpublishProductResponse;
|
|
264
|
+
deleteProduct(request: DeleteProductRequest): Promise<DeleteProductResponse> | Observable<DeleteProductResponse> | DeleteProductResponse;
|
|
265
|
+
listManufacturers(request: ListManufacturersRequest): Promise<ListManufacturersResponse> | Observable<ListManufacturersResponse> | ListManufacturersResponse;
|
|
266
|
+
createManufacturer(request: CreateManufacturerRequest): Promise<CreateManufacturerResponse> | Observable<CreateManufacturerResponse> | CreateManufacturerResponse;
|
|
267
|
+
updateManufacturer(request: UpdateManufacturerRequest): Promise<UpdateManufacturerResponse> | Observable<UpdateManufacturerResponse> | UpdateManufacturerResponse;
|
|
268
|
+
deleteManufacturer(request: DeleteManufacturerRequest): Promise<DeleteManufacturerResponse> | Observable<DeleteManufacturerResponse> | DeleteManufacturerResponse;
|
|
269
|
+
listStrains(request: ListStrainsRequest): Promise<ListStrainsResponse> | Observable<ListStrainsResponse> | ListStrainsResponse;
|
|
270
|
+
createStrain(request: CreateStrainRequest): Promise<CreateStrainResponse> | Observable<CreateStrainResponse> | CreateStrainResponse;
|
|
271
|
+
updateStrain(request: UpdateStrainRequest): Promise<UpdateStrainResponse> | Observable<UpdateStrainResponse> | UpdateStrainResponse;
|
|
272
|
+
deleteStrain(request: DeleteStrainRequest): Promise<DeleteStrainResponse> | Observable<DeleteStrainResponse> | DeleteStrainResponse;
|
|
19
273
|
listTerpenes(request: ListTerpenesRequest): Promise<ListTerpenesResponse> | Observable<ListTerpenesResponse> | ListTerpenesResponse;
|
|
274
|
+
createTerpene(request: CreateTerpeneRequest): Promise<CreateTerpeneResponse> | Observable<CreateTerpeneResponse> | CreateTerpeneResponse;
|
|
275
|
+
updateTerpene(request: UpdateTerpeneRequest): Promise<UpdateTerpeneResponse> | Observable<UpdateTerpeneResponse> | UpdateTerpeneResponse;
|
|
276
|
+
deleteTerpene(request: DeleteTerpeneRequest): Promise<DeleteTerpeneResponse> | Observable<DeleteTerpeneResponse> | DeleteTerpeneResponse;
|
|
20
277
|
}
|
|
21
278
|
export declare function CatalogServiceControllerMethods(): (constructor: Function) => void;
|
|
22
279
|
export declare const CATALOG_SERVICE_NAME = "CatalogService";
|
package/dist/nest/catalog.js
CHANGED
|
@@ -5,16 +5,98 @@
|
|
|
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.protobufFileName = exports.protobufPackage = void 0;
|
|
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;
|
|
9
9
|
exports.CatalogServiceControllerMethods = CatalogServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const microservices_1 = require("@nestjs/microservices");
|
|
12
12
|
exports.protobufPackage = "catalog.v1";
|
|
13
13
|
exports.protobufFileName = "catalog.proto";
|
|
14
|
+
var ProductType;
|
|
15
|
+
(function (ProductType) {
|
|
16
|
+
ProductType[ProductType["PRODUCT_TYPE_UNSPECIFIED"] = 0] = "PRODUCT_TYPE_UNSPECIFIED";
|
|
17
|
+
ProductType[ProductType["PRODUCT_TYPE_FLOWER"] = 1] = "PRODUCT_TYPE_FLOWER";
|
|
18
|
+
ProductType[ProductType["PRODUCT_TYPE_EXTRACT"] = 2] = "PRODUCT_TYPE_EXTRACT";
|
|
19
|
+
ProductType[ProductType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
20
|
+
})(ProductType || (exports.ProductType = ProductType = {}));
|
|
21
|
+
var ProductStatus;
|
|
22
|
+
(function (ProductStatus) {
|
|
23
|
+
ProductStatus[ProductStatus["PRODUCT_STATUS_UNSPECIFIED"] = 0] = "PRODUCT_STATUS_UNSPECIFIED";
|
|
24
|
+
ProductStatus[ProductStatus["PRODUCT_STATUS_DRAFT"] = 1] = "PRODUCT_STATUS_DRAFT";
|
|
25
|
+
ProductStatus[ProductStatus["PRODUCT_STATUS_PUBLISHED"] = 2] = "PRODUCT_STATUS_PUBLISHED";
|
|
26
|
+
ProductStatus[ProductStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
27
|
+
})(ProductStatus || (exports.ProductStatus = ProductStatus = {}));
|
|
28
|
+
var Genetics;
|
|
29
|
+
(function (Genetics) {
|
|
30
|
+
Genetics[Genetics["GENETICS_UNSPECIFIED"] = 0] = "GENETICS_UNSPECIFIED";
|
|
31
|
+
Genetics[Genetics["GENETICS_SATIVA"] = 1] = "GENETICS_SATIVA";
|
|
32
|
+
Genetics[Genetics["GENETICS_SATIVA_DOMINANT"] = 2] = "GENETICS_SATIVA_DOMINANT";
|
|
33
|
+
Genetics[Genetics["GENETICS_HYBRID"] = 3] = "GENETICS_HYBRID";
|
|
34
|
+
Genetics[Genetics["GENETICS_INDICA_DOMINANT"] = 4] = "GENETICS_INDICA_DOMINANT";
|
|
35
|
+
Genetics[Genetics["GENETICS_INDICA"] = 5] = "GENETICS_INDICA";
|
|
36
|
+
Genetics[Genetics["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
37
|
+
})(Genetics || (exports.Genetics = Genetics = {}));
|
|
38
|
+
var PotencyUnit;
|
|
39
|
+
(function (PotencyUnit) {
|
|
40
|
+
PotencyUnit[PotencyUnit["POTENCY_UNIT_UNSPECIFIED"] = 0] = "POTENCY_UNIT_UNSPECIFIED";
|
|
41
|
+
PotencyUnit[PotencyUnit["POTENCY_UNIT_PERCENT"] = 1] = "POTENCY_UNIT_PERCENT";
|
|
42
|
+
PotencyUnit[PotencyUnit["POTENCY_UNIT_MG_PER_ML"] = 2] = "POTENCY_UNIT_MG_PER_ML";
|
|
43
|
+
PotencyUnit[PotencyUnit["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
44
|
+
})(PotencyUnit || (exports.PotencyUnit = PotencyUnit = {}));
|
|
45
|
+
var Availability;
|
|
46
|
+
(function (Availability) {
|
|
47
|
+
Availability[Availability["AVAILABILITY_UNSPECIFIED"] = 0] = "AVAILABILITY_UNSPECIFIED";
|
|
48
|
+
Availability[Availability["AVAILABILITY_UNKNOWN"] = 1] = "AVAILABILITY_UNKNOWN";
|
|
49
|
+
Availability[Availability["AVAILABILITY_AVAILABLE"] = 2] = "AVAILABILITY_AVAILABLE";
|
|
50
|
+
Availability[Availability["AVAILABILITY_SOLD_OUT"] = 3] = "AVAILABILITY_SOLD_OUT";
|
|
51
|
+
Availability[Availability["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
52
|
+
})(Availability || (exports.Availability = Availability = {}));
|
|
53
|
+
var Flavor;
|
|
54
|
+
(function (Flavor) {
|
|
55
|
+
Flavor[Flavor["FLAVOR_UNSPECIFIED"] = 0] = "FLAVOR_UNSPECIFIED";
|
|
56
|
+
Flavor[Flavor["FLAVOR_EARTHY"] = 1] = "FLAVOR_EARTHY";
|
|
57
|
+
Flavor[Flavor["FLAVOR_WOODY"] = 2] = "FLAVOR_WOODY";
|
|
58
|
+
Flavor[Flavor["FLAVOR_PINE"] = 3] = "FLAVOR_PINE";
|
|
59
|
+
Flavor[Flavor["FLAVOR_HERBAL"] = 4] = "FLAVOR_HERBAL";
|
|
60
|
+
Flavor[Flavor["FLAVOR_FLORAL"] = 5] = "FLAVOR_FLORAL";
|
|
61
|
+
Flavor[Flavor["FLAVOR_CITRUS"] = 6] = "FLAVOR_CITRUS";
|
|
62
|
+
Flavor[Flavor["FLAVOR_FRUITY"] = 7] = "FLAVOR_FRUITY";
|
|
63
|
+
Flavor[Flavor["FLAVOR_BERRY"] = 8] = "FLAVOR_BERRY";
|
|
64
|
+
Flavor[Flavor["FLAVOR_TROPICAL"] = 9] = "FLAVOR_TROPICAL";
|
|
65
|
+
Flavor[Flavor["FLAVOR_SWEET"] = 10] = "FLAVOR_SWEET";
|
|
66
|
+
Flavor[Flavor["FLAVOR_SPICY"] = 11] = "FLAVOR_SPICY";
|
|
67
|
+
Flavor[Flavor["FLAVOR_PEPPERY"] = 12] = "FLAVOR_PEPPERY";
|
|
68
|
+
Flavor[Flavor["FLAVOR_MENTHOL"] = 13] = "FLAVOR_MENTHOL";
|
|
69
|
+
Flavor[Flavor["FLAVOR_CHEESE"] = 14] = "FLAVOR_CHEESE";
|
|
70
|
+
Flavor[Flavor["FLAVOR_SKUNK"] = 15] = "FLAVOR_SKUNK";
|
|
71
|
+
Flavor[Flavor["FLAVOR_DIESEL"] = 16] = "FLAVOR_DIESEL";
|
|
72
|
+
Flavor[Flavor["FLAVOR_GASSY"] = 17] = "FLAVOR_GASSY";
|
|
73
|
+
Flavor[Flavor["FLAVOR_CHEMICAL"] = 18] = "FLAVOR_CHEMICAL";
|
|
74
|
+
Flavor[Flavor["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
75
|
+
})(Flavor || (exports.Flavor = Flavor = {}));
|
|
14
76
|
exports.CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
15
77
|
function CatalogServiceControllerMethods() {
|
|
16
78
|
return function (constructor) {
|
|
17
|
-
const grpcMethods = [
|
|
79
|
+
const grpcMethods = [
|
|
80
|
+
"listProducts",
|
|
81
|
+
"getProduct",
|
|
82
|
+
"createProduct",
|
|
83
|
+
"updateProduct",
|
|
84
|
+
"publishProduct",
|
|
85
|
+
"unpublishProduct",
|
|
86
|
+
"deleteProduct",
|
|
87
|
+
"listManufacturers",
|
|
88
|
+
"createManufacturer",
|
|
89
|
+
"updateManufacturer",
|
|
90
|
+
"deleteManufacturer",
|
|
91
|
+
"listStrains",
|
|
92
|
+
"createStrain",
|
|
93
|
+
"updateStrain",
|
|
94
|
+
"deleteStrain",
|
|
95
|
+
"listTerpenes",
|
|
96
|
+
"createTerpene",
|
|
97
|
+
"updateTerpene",
|
|
98
|
+
"deleteTerpene",
|
|
99
|
+
];
|
|
18
100
|
for (const method of grpcMethods) {
|
|
19
101
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
20
102
|
(0, microservices_1.GrpcMethod)("CatalogService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/catalog.proto
CHANGED
|
@@ -3,7 +3,96 @@ syntax = "proto3";
|
|
|
3
3
|
package catalog.v1;
|
|
4
4
|
|
|
5
5
|
service CatalogService {
|
|
6
|
+
rpc ListProducts (ListProductsRequest) returns (ListProductsResponse);
|
|
7
|
+
rpc GetProduct (GetProductRequest) returns (GetProductResponse);
|
|
8
|
+
rpc CreateProduct (CreateProductRequest) returns (CreateProductResponse);
|
|
9
|
+
rpc UpdateProduct (UpdateProductRequest) returns (UpdateProductResponse);
|
|
10
|
+
rpc PublishProduct (PublishProductRequest) returns (PublishProductResponse);
|
|
11
|
+
rpc UnpublishProduct (UnpublishProductRequest) returns (UnpublishProductResponse);
|
|
12
|
+
rpc DeleteProduct (DeleteProductRequest) returns (DeleteProductResponse);
|
|
13
|
+
|
|
14
|
+
rpc ListManufacturers (ListManufacturersRequest) returns (ListManufacturersResponse);
|
|
15
|
+
rpc CreateManufacturer (CreateManufacturerRequest) returns (CreateManufacturerResponse);
|
|
16
|
+
rpc UpdateManufacturer (UpdateManufacturerRequest) returns (UpdateManufacturerResponse);
|
|
17
|
+
rpc DeleteManufacturer (DeleteManufacturerRequest) returns (DeleteManufacturerResponse);
|
|
18
|
+
|
|
19
|
+
rpc ListStrains (ListStrainsRequest) returns (ListStrainsResponse);
|
|
20
|
+
rpc CreateStrain (CreateStrainRequest) returns (CreateStrainResponse);
|
|
21
|
+
rpc UpdateStrain (UpdateStrainRequest) returns (UpdateStrainResponse);
|
|
22
|
+
rpc DeleteStrain (DeleteStrainRequest) returns (DeleteStrainResponse);
|
|
23
|
+
|
|
6
24
|
rpc ListTerpenes (ListTerpenesRequest) returns (ListTerpenesResponse);
|
|
25
|
+
rpc CreateTerpene (CreateTerpeneRequest) returns (CreateTerpeneResponse);
|
|
26
|
+
rpc UpdateTerpene (UpdateTerpeneRequest) returns (UpdateTerpeneResponse);
|
|
27
|
+
rpc DeleteTerpene (DeleteTerpeneRequest) returns (DeleteTerpeneResponse);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
enum ProductType {
|
|
31
|
+
PRODUCT_TYPE_UNSPECIFIED = 0;
|
|
32
|
+
PRODUCT_TYPE_FLOWER = 1;
|
|
33
|
+
PRODUCT_TYPE_EXTRACT = 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
enum ProductStatus {
|
|
37
|
+
PRODUCT_STATUS_UNSPECIFIED = 0;
|
|
38
|
+
PRODUCT_STATUS_DRAFT = 1;
|
|
39
|
+
PRODUCT_STATUS_PUBLISHED = 2;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
enum Genetics {
|
|
43
|
+
GENETICS_UNSPECIFIED = 0;
|
|
44
|
+
GENETICS_SATIVA = 1;
|
|
45
|
+
GENETICS_SATIVA_DOMINANT = 2;
|
|
46
|
+
GENETICS_HYBRID = 3;
|
|
47
|
+
GENETICS_INDICA_DOMINANT = 4;
|
|
48
|
+
GENETICS_INDICA = 5;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
enum PotencyUnit {
|
|
52
|
+
POTENCY_UNIT_UNSPECIFIED = 0;
|
|
53
|
+
POTENCY_UNIT_PERCENT = 1;
|
|
54
|
+
POTENCY_UNIT_MG_PER_ML = 2;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
enum Availability {
|
|
58
|
+
AVAILABILITY_UNSPECIFIED = 0;
|
|
59
|
+
AVAILABILITY_UNKNOWN = 1;
|
|
60
|
+
AVAILABILITY_AVAILABLE = 2;
|
|
61
|
+
AVAILABILITY_SOLD_OUT = 3;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
enum Flavor {
|
|
65
|
+
FLAVOR_UNSPECIFIED = 0;
|
|
66
|
+
FLAVOR_EARTHY = 1;
|
|
67
|
+
FLAVOR_WOODY = 2;
|
|
68
|
+
FLAVOR_PINE = 3;
|
|
69
|
+
FLAVOR_HERBAL = 4;
|
|
70
|
+
FLAVOR_FLORAL = 5;
|
|
71
|
+
FLAVOR_CITRUS = 6;
|
|
72
|
+
FLAVOR_FRUITY = 7;
|
|
73
|
+
FLAVOR_BERRY = 8;
|
|
74
|
+
FLAVOR_TROPICAL = 9;
|
|
75
|
+
FLAVOR_SWEET = 10;
|
|
76
|
+
FLAVOR_SPICY = 11;
|
|
77
|
+
FLAVOR_PEPPERY = 12;
|
|
78
|
+
FLAVOR_MENTHOL = 13;
|
|
79
|
+
FLAVOR_CHEESE = 14;
|
|
80
|
+
FLAVOR_SKUNK = 15;
|
|
81
|
+
FLAVOR_DIESEL = 16;
|
|
82
|
+
FLAVOR_GASSY = 17;
|
|
83
|
+
FLAVOR_CHEMICAL = 18;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message Manufacturer {
|
|
87
|
+
string id = 1;
|
|
88
|
+
string name = 2;
|
|
89
|
+
string slug = 3;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
message Strain {
|
|
93
|
+
string id = 1;
|
|
94
|
+
string name = 2;
|
|
95
|
+
string slug = 3;
|
|
7
96
|
}
|
|
8
97
|
|
|
9
98
|
message Terpene {
|
|
@@ -12,8 +101,199 @@ message Terpene {
|
|
|
12
101
|
string slug = 3;
|
|
13
102
|
}
|
|
14
103
|
|
|
104
|
+
message Product {
|
|
105
|
+
string id = 1;
|
|
106
|
+
int32 number = 2;
|
|
107
|
+
string name = 3;
|
|
108
|
+
ProductType type = 4;
|
|
109
|
+
ProductStatus status = 5;
|
|
110
|
+
Manufacturer manufacturer = 6;
|
|
111
|
+
optional Strain strain = 7;
|
|
112
|
+
optional Genetics genetics = 8;
|
|
113
|
+
double thc = 9;
|
|
114
|
+
double cbd = 10;
|
|
115
|
+
PotencyUnit potency_unit = 11;
|
|
116
|
+
optional string country = 12;
|
|
117
|
+
bool is_irradiated = 13;
|
|
118
|
+
repeated Flavor flavors = 14;
|
|
119
|
+
repeated Terpene terpenes = 15;
|
|
120
|
+
optional string description = 16;
|
|
121
|
+
optional int32 price = 17;
|
|
122
|
+
Availability availability = 18;
|
|
123
|
+
optional string published_at = 19;
|
|
124
|
+
string created_at = 20;
|
|
125
|
+
string updated_at = 21;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
message ProductInput {
|
|
129
|
+
string name = 1;
|
|
130
|
+
ProductType type = 2;
|
|
131
|
+
string manufacturer_id = 3;
|
|
132
|
+
optional string strain_id = 4;
|
|
133
|
+
optional Genetics genetics = 5;
|
|
134
|
+
double thc = 6;
|
|
135
|
+
double cbd = 7;
|
|
136
|
+
PotencyUnit potency_unit = 8;
|
|
137
|
+
optional string country = 9;
|
|
138
|
+
bool is_irradiated = 10;
|
|
139
|
+
repeated Flavor flavors = 11;
|
|
140
|
+
repeated string terpene_ids = 12;
|
|
141
|
+
optional string description = 13;
|
|
142
|
+
optional int32 price = 14;
|
|
143
|
+
Availability availability = 15;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
message ListProductsRequest {
|
|
147
|
+
optional string query = 1;
|
|
148
|
+
optional ProductType type = 2;
|
|
149
|
+
optional ProductStatus status = 3;
|
|
150
|
+
optional string cursor = 4;
|
|
151
|
+
int32 limit = 5;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
message ListProductsResponse {
|
|
155
|
+
repeated Product products = 1;
|
|
156
|
+
optional string next_cursor = 2;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
message GetProductRequest {
|
|
160
|
+
string id = 1;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
message GetProductResponse {
|
|
164
|
+
Product product = 1;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
message CreateProductRequest {
|
|
168
|
+
ProductInput product = 1;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
message CreateProductResponse {
|
|
172
|
+
Product product = 1;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
message UpdateProductRequest {
|
|
176
|
+
string id = 1;
|
|
177
|
+
ProductInput product = 2;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
message UpdateProductResponse {
|
|
181
|
+
Product product = 1;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
message PublishProductRequest {
|
|
185
|
+
string id = 1;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
message PublishProductResponse {
|
|
189
|
+
Product product = 1;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
message UnpublishProductRequest {
|
|
193
|
+
string id = 1;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
message UnpublishProductResponse {
|
|
197
|
+
Product product = 1;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
message DeleteProductRequest {
|
|
201
|
+
string id = 1;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
message DeleteProductResponse {
|
|
205
|
+
Product product = 1;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
message ListManufacturersRequest {}
|
|
209
|
+
|
|
210
|
+
message ListManufacturersResponse {
|
|
211
|
+
repeated Manufacturer manufacturers = 1;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
message CreateManufacturerRequest {
|
|
215
|
+
string name = 1;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
message CreateManufacturerResponse {
|
|
219
|
+
Manufacturer manufacturer = 1;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
message UpdateManufacturerRequest {
|
|
223
|
+
string id = 1;
|
|
224
|
+
string name = 2;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
message UpdateManufacturerResponse {
|
|
228
|
+
Manufacturer manufacturer = 1;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
message DeleteManufacturerRequest {
|
|
232
|
+
string id = 1;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
message DeleteManufacturerResponse {
|
|
236
|
+
Manufacturer manufacturer = 1;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
message ListStrainsRequest {}
|
|
240
|
+
|
|
241
|
+
message ListStrainsResponse {
|
|
242
|
+
repeated Strain strains = 1;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
message CreateStrainRequest {
|
|
246
|
+
string name = 1;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
message CreateStrainResponse {
|
|
250
|
+
Strain strain = 1;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
message UpdateStrainRequest {
|
|
254
|
+
string id = 1;
|
|
255
|
+
string name = 2;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
message UpdateStrainResponse {
|
|
259
|
+
Strain strain = 1;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
message DeleteStrainRequest {
|
|
263
|
+
string id = 1;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
message DeleteStrainResponse {
|
|
267
|
+
Strain strain = 1;
|
|
268
|
+
}
|
|
269
|
+
|
|
15
270
|
message ListTerpenesRequest {}
|
|
16
271
|
|
|
17
272
|
message ListTerpenesResponse {
|
|
18
273
|
repeated Terpene terpenes = 1;
|
|
19
274
|
}
|
|
275
|
+
|
|
276
|
+
message CreateTerpeneRequest {
|
|
277
|
+
string name = 1;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
message CreateTerpeneResponse {
|
|
281
|
+
Terpene terpene = 1;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
message UpdateTerpeneRequest {
|
|
285
|
+
string id = 1;
|
|
286
|
+
string name = 2;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
message UpdateTerpeneResponse {
|
|
290
|
+
Terpene terpene = 1;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
message DeleteTerpeneRequest {
|
|
294
|
+
string id = 1;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
message DeleteTerpeneResponse {
|
|
298
|
+
Terpene terpene = 1;
|
|
299
|
+
}
|