@contractspec/example.marketplace 3.7.6 → 3.7.7
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/README.md +63 -131
- package/dist/browser/entities/index.js +470 -470
- package/dist/browser/index.js +945 -944
- package/dist/browser/order/index.js +155 -155
- package/dist/browser/order/order.event.js +1 -1
- package/dist/browser/payout/index.js +71 -71
- package/dist/browser/payout/payout.event.js +1 -1
- package/dist/browser/product/index.js +104 -104
- package/dist/browser/product/product.event.js +1 -1
- package/dist/browser/review/index.js +75 -75
- package/dist/browser/review/review.event.js +1 -1
- package/dist/browser/store/index.js +68 -68
- package/dist/browser/store/store.event.js +1 -1
- package/dist/browser/ui/MarketplaceDashboard.js +35 -35
- package/dist/browser/ui/hooks/index.js +1 -1
- package/dist/browser/ui/hooks/useMarketplaceData.js +1 -1
- package/dist/browser/ui/index.js +285 -284
- package/dist/entities/index.d.ts +110 -110
- package/dist/entities/index.js +470 -470
- package/dist/index.d.ts +3 -3
- package/dist/index.js +945 -944
- package/dist/node/entities/index.js +470 -470
- package/dist/node/index.js +945 -944
- package/dist/node/order/index.js +155 -155
- package/dist/node/order/order.event.js +1 -1
- package/dist/node/payout/index.js +71 -71
- package/dist/node/payout/payout.event.js +1 -1
- package/dist/node/product/index.js +104 -104
- package/dist/node/product/product.event.js +1 -1
- package/dist/node/review/index.js +75 -75
- package/dist/node/review/review.event.js +1 -1
- package/dist/node/store/index.js +68 -68
- package/dist/node/store/store.event.js +1 -1
- package/dist/node/ui/MarketplaceDashboard.js +35 -35
- package/dist/node/ui/hooks/index.js +1 -1
- package/dist/node/ui/hooks/useMarketplaceData.js +1 -1
- package/dist/node/ui/index.js +285 -284
- package/dist/order/index.d.ts +2 -2
- package/dist/order/index.js +155 -155
- package/dist/order/order.event.js +1 -1
- package/dist/payout/index.d.ts +2 -2
- package/dist/payout/index.js +71 -71
- package/dist/payout/payout.event.js +1 -1
- package/dist/product/index.d.ts +2 -2
- package/dist/product/index.js +104 -104
- package/dist/product/product.event.js +1 -1
- package/dist/review/index.d.ts +2 -2
- package/dist/review/index.js +75 -75
- package/dist/review/review.event.js +1 -1
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +68 -68
- package/dist/store/store.event.js +1 -1
- package/dist/ui/MarketplaceDashboard.js +35 -35
- package/dist/ui/hooks/index.d.ts +1 -1
- package/dist/ui/hooks/index.js +1 -1
- package/dist/ui/hooks/useMarketplaceData.js +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +285 -284
- package/dist/ui/renderers/index.d.ts +1 -1
- package/package.json +6 -6
package/dist/product/index.js
CHANGED
|
@@ -10,71 +10,141 @@ var ProductStatusEnum = defineEnum("ProductStatus", [
|
|
|
10
10
|
"REJECTED"
|
|
11
11
|
]);
|
|
12
12
|
|
|
13
|
-
// src/product/product.
|
|
13
|
+
// src/product/product.event.ts
|
|
14
|
+
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
14
15
|
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
15
|
-
var
|
|
16
|
-
name: "
|
|
17
|
-
description: "A product listing",
|
|
16
|
+
var ProductCreatedPayload = defineSchemaModel({
|
|
17
|
+
name: "ProductCreatedEventPayload",
|
|
18
18
|
fields: {
|
|
19
|
-
|
|
19
|
+
productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
20
20
|
storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
21
|
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
-
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
23
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
-
status: { type: ProductStatusEnum, isOptional: false },
|
|
25
22
|
price: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
26
23
|
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
var ProductPublishedPayload = defineSchemaModel({
|
|
28
|
+
name: "ProductPublishedEventPayload",
|
|
29
|
+
fields: {
|
|
30
|
+
productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
31
|
+
storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
32
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
var InventoryUpdatedPayload = defineSchemaModel({
|
|
36
|
+
name: "InventoryUpdatedEventPayload",
|
|
37
|
+
fields: {
|
|
38
|
+
productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
39
|
+
variantId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
40
|
+
previousQuantity: {
|
|
41
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
42
|
+
isOptional: false
|
|
43
|
+
},
|
|
44
|
+
newQuantity: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
45
|
+
reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
46
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
var ProductCreatedEvent = defineEvent({
|
|
50
|
+
meta: {
|
|
51
|
+
key: "marketplace.product.created",
|
|
52
|
+
version: "1.0.0",
|
|
53
|
+
description: "A new product has been created.",
|
|
54
|
+
stability: "experimental",
|
|
55
|
+
owners: ["@marketplace-team"],
|
|
56
|
+
tags: ["marketplace", "product"]
|
|
57
|
+
},
|
|
58
|
+
payload: ProductCreatedPayload
|
|
59
|
+
});
|
|
60
|
+
var ProductPublishedEvent = defineEvent({
|
|
61
|
+
meta: {
|
|
62
|
+
key: "marketplace.product.published",
|
|
63
|
+
version: "1.0.0",
|
|
64
|
+
description: "A product has been published.",
|
|
65
|
+
stability: "experimental",
|
|
66
|
+
owners: ["@marketplace-team"],
|
|
67
|
+
tags: ["marketplace", "product"]
|
|
68
|
+
},
|
|
69
|
+
payload: ProductPublishedPayload
|
|
70
|
+
});
|
|
71
|
+
var InventoryUpdatedEvent = defineEvent({
|
|
72
|
+
meta: {
|
|
73
|
+
key: "marketplace.inventory.updated",
|
|
74
|
+
version: "1.0.0",
|
|
75
|
+
description: "Product inventory has been updated.",
|
|
76
|
+
stability: "experimental",
|
|
77
|
+
owners: ["@marketplace-team"],
|
|
78
|
+
tags: ["marketplace", "product", "inventory"]
|
|
79
|
+
},
|
|
80
|
+
payload: InventoryUpdatedPayload
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// src/product/product.schema.ts
|
|
84
|
+
import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
|
|
85
|
+
var ProductModel = defineSchemaModel2({
|
|
86
|
+
name: "ProductModel",
|
|
87
|
+
description: "A product listing",
|
|
88
|
+
fields: {
|
|
89
|
+
id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
90
|
+
storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
91
|
+
name: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
92
|
+
slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
93
|
+
description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
94
|
+
status: { type: ProductStatusEnum, isOptional: false },
|
|
95
|
+
price: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
|
|
96
|
+
currency: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
97
|
+
quantity: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
|
|
98
|
+
categoryId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
29
99
|
primaryImageId: {
|
|
30
|
-
type:
|
|
100
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
31
101
|
isOptional: true
|
|
32
102
|
},
|
|
33
|
-
averageRating: { type:
|
|
34
|
-
totalSold: { type:
|
|
35
|
-
createdAt: { type:
|
|
103
|
+
averageRating: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
|
|
104
|
+
totalSold: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
|
|
105
|
+
createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
36
106
|
}
|
|
37
107
|
});
|
|
38
|
-
var CreateProductInputModel =
|
|
108
|
+
var CreateProductInputModel = defineSchemaModel2({
|
|
39
109
|
name: "CreateProductInput",
|
|
40
110
|
fields: {
|
|
41
|
-
storeId: { type:
|
|
42
|
-
name: { type:
|
|
43
|
-
slug: { type:
|
|
44
|
-
description: { type:
|
|
45
|
-
price: { type:
|
|
46
|
-
currency: { type:
|
|
47
|
-
quantity: { type:
|
|
48
|
-
categoryId: { type:
|
|
49
|
-
sku: { type:
|
|
111
|
+
storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
112
|
+
name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
|
|
113
|
+
slug: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
|
|
114
|
+
description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
115
|
+
price: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
|
|
116
|
+
currency: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
117
|
+
quantity: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
|
|
118
|
+
categoryId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
119
|
+
sku: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true }
|
|
50
120
|
}
|
|
51
121
|
});
|
|
52
|
-
var ListProductsInputModel =
|
|
122
|
+
var ListProductsInputModel = defineSchemaModel2({
|
|
53
123
|
name: "ListProductsInput",
|
|
54
124
|
fields: {
|
|
55
|
-
storeId: { type:
|
|
56
|
-
categoryId: { type:
|
|
125
|
+
storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
126
|
+
categoryId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
57
127
|
status: { type: ProductStatusEnum, isOptional: true },
|
|
58
|
-
search: { type:
|
|
59
|
-
minPrice: { type:
|
|
60
|
-
maxPrice: { type:
|
|
128
|
+
search: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
129
|
+
minPrice: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: true },
|
|
130
|
+
maxPrice: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: true },
|
|
61
131
|
limit: {
|
|
62
|
-
type:
|
|
132
|
+
type: ScalarTypeEnum2.Int_unsecure(),
|
|
63
133
|
isOptional: true,
|
|
64
134
|
defaultValue: 20
|
|
65
135
|
},
|
|
66
136
|
offset: {
|
|
67
|
-
type:
|
|
137
|
+
type: ScalarTypeEnum2.Int_unsecure(),
|
|
68
138
|
isOptional: true,
|
|
69
139
|
defaultValue: 0
|
|
70
140
|
}
|
|
71
141
|
}
|
|
72
142
|
});
|
|
73
|
-
var ListProductsOutputModel =
|
|
143
|
+
var ListProductsOutputModel = defineSchemaModel2({
|
|
74
144
|
name: "ListProductsOutput",
|
|
75
145
|
fields: {
|
|
76
146
|
products: { type: ProductModel, isArray: true, isOptional: false },
|
|
77
|
-
total: { type:
|
|
147
|
+
total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false }
|
|
78
148
|
}
|
|
79
149
|
});
|
|
80
150
|
|
|
@@ -166,76 +236,6 @@ var ListProductsContract = defineQuery({
|
|
|
166
236
|
]
|
|
167
237
|
}
|
|
168
238
|
});
|
|
169
|
-
|
|
170
|
-
// src/product/product.event.ts
|
|
171
|
-
import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
|
|
172
|
-
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
173
|
-
var ProductCreatedPayload = defineSchemaModel2({
|
|
174
|
-
name: "ProductCreatedEventPayload",
|
|
175
|
-
fields: {
|
|
176
|
-
productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
177
|
-
storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
178
|
-
name: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
179
|
-
price: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
|
|
180
|
-
currency: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
181
|
-
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
var ProductPublishedPayload = defineSchemaModel2({
|
|
185
|
-
name: "ProductPublishedEventPayload",
|
|
186
|
-
fields: {
|
|
187
|
-
productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
188
|
-
storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
189
|
-
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
var InventoryUpdatedPayload = defineSchemaModel2({
|
|
193
|
-
name: "InventoryUpdatedEventPayload",
|
|
194
|
-
fields: {
|
|
195
|
-
productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
196
|
-
variantId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
197
|
-
previousQuantity: {
|
|
198
|
-
type: ScalarTypeEnum2.Int_unsecure(),
|
|
199
|
-
isOptional: false
|
|
200
|
-
},
|
|
201
|
-
newQuantity: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
|
|
202
|
-
reason: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
203
|
-
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
var ProductCreatedEvent = defineEvent({
|
|
207
|
-
meta: {
|
|
208
|
-
key: "marketplace.product.created",
|
|
209
|
-
version: "1.0.0",
|
|
210
|
-
description: "A new product has been created.",
|
|
211
|
-
stability: "experimental",
|
|
212
|
-
owners: ["@marketplace-team"],
|
|
213
|
-
tags: ["marketplace", "product"]
|
|
214
|
-
},
|
|
215
|
-
payload: ProductCreatedPayload
|
|
216
|
-
});
|
|
217
|
-
var ProductPublishedEvent = defineEvent({
|
|
218
|
-
meta: {
|
|
219
|
-
key: "marketplace.product.published",
|
|
220
|
-
version: "1.0.0",
|
|
221
|
-
description: "A product has been published.",
|
|
222
|
-
stability: "experimental",
|
|
223
|
-
owners: ["@marketplace-team"],
|
|
224
|
-
tags: ["marketplace", "product"]
|
|
225
|
-
},
|
|
226
|
-
payload: ProductPublishedPayload
|
|
227
|
-
});
|
|
228
|
-
var InventoryUpdatedEvent = defineEvent({
|
|
229
|
-
meta: {
|
|
230
|
-
key: "marketplace.inventory.updated",
|
|
231
|
-
version: "1.0.0",
|
|
232
|
-
description: "Product inventory has been updated.",
|
|
233
|
-
stability: "experimental",
|
|
234
|
-
owners: ["@marketplace-team"],
|
|
235
|
-
tags: ["marketplace", "product", "inventory"]
|
|
236
|
-
},
|
|
237
|
-
payload: InventoryUpdatedPayload
|
|
238
|
-
});
|
|
239
239
|
export {
|
|
240
240
|
ProductStatusEnum,
|
|
241
241
|
ProductPublishedEvent,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/product/product.event.ts
|
|
3
|
-
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
4
3
|
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
4
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
5
5
|
var ProductCreatedPayload = defineSchemaModel({
|
|
6
6
|
name: "ProductCreatedEventPayload",
|
|
7
7
|
fields: {
|
package/dist/review/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Review domain - Customer review management.
|
|
3
3
|
*/
|
|
4
4
|
export { ReviewStatusEnum } from './review.enum';
|
|
5
|
-
export { ReviewModel, CreateReviewInputModel, ListReviewsInputModel, ListReviewsOutputModel, } from './review.schema';
|
|
6
|
-
export { CreateReviewContract, ListReviewsContract } from './review.operations';
|
|
7
5
|
export { ReviewCreatedEvent, ReviewRespondedEvent } from './review.event';
|
|
6
|
+
export { CreateReviewContract, ListReviewsContract } from './review.operations';
|
|
7
|
+
export { CreateReviewInputModel, ListReviewsInputModel, ListReviewsOutputModel, ReviewModel, } from './review.schema';
|
package/dist/review/index.js
CHANGED
|
@@ -8,63 +8,110 @@ var ReviewStatusEnum = defineEnum("ReviewStatus", [
|
|
|
8
8
|
"FLAGGED"
|
|
9
9
|
]);
|
|
10
10
|
|
|
11
|
-
// src/review/review.
|
|
11
|
+
// src/review/review.event.ts
|
|
12
|
+
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
12
13
|
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
13
|
-
var
|
|
14
|
-
name: "
|
|
15
|
-
description: "A customer review",
|
|
14
|
+
var ReviewCreatedPayload = defineSchemaModel({
|
|
15
|
+
name: "ReviewCreatedEventPayload",
|
|
16
16
|
fields: {
|
|
17
|
-
|
|
17
|
+
reviewId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
18
18
|
productId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
19
19
|
storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
20
20
|
authorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
21
|
rating: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
22
|
-
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
23
|
-
content: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
-
status: { type: ReviewStatusEnum, isOptional: false },
|
|
25
22
|
isVerifiedPurchase: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
var ReviewRespondedPayload = defineSchemaModel({
|
|
27
|
+
name: "ReviewRespondedEventPayload",
|
|
28
|
+
fields: {
|
|
29
|
+
reviewId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
30
|
+
responseId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
31
|
+
authorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
32
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
var ReviewCreatedEvent = defineEvent({
|
|
36
|
+
meta: {
|
|
37
|
+
key: "marketplace.review.created",
|
|
38
|
+
version: "1.0.0",
|
|
39
|
+
description: "A review has been created.",
|
|
40
|
+
stability: "experimental",
|
|
41
|
+
owners: ["@marketplace-team"],
|
|
42
|
+
tags: ["marketplace", "review"]
|
|
43
|
+
},
|
|
44
|
+
payload: ReviewCreatedPayload
|
|
45
|
+
});
|
|
46
|
+
var ReviewRespondedEvent = defineEvent({
|
|
47
|
+
meta: {
|
|
48
|
+
key: "marketplace.review.responded",
|
|
49
|
+
version: "1.0.0",
|
|
50
|
+
description: "A seller has responded to a review.",
|
|
51
|
+
stability: "experimental",
|
|
52
|
+
owners: ["@marketplace-team"],
|
|
53
|
+
tags: ["marketplace", "review"]
|
|
54
|
+
},
|
|
55
|
+
payload: ReviewRespondedPayload
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// src/review/review.schema.ts
|
|
59
|
+
import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
|
|
60
|
+
var ReviewModel = defineSchemaModel2({
|
|
61
|
+
name: "ReviewModel",
|
|
62
|
+
description: "A customer review",
|
|
63
|
+
fields: {
|
|
64
|
+
id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
65
|
+
productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
66
|
+
storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
67
|
+
authorId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
68
|
+
rating: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
|
|
69
|
+
title: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
70
|
+
content: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
71
|
+
status: { type: ReviewStatusEnum, isOptional: false },
|
|
72
|
+
isVerifiedPurchase: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
|
|
73
|
+
helpfulCount: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
|
|
74
|
+
hasResponse: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
|
|
75
|
+
createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
29
76
|
}
|
|
30
77
|
});
|
|
31
|
-
var CreateReviewInputModel =
|
|
78
|
+
var CreateReviewInputModel = defineSchemaModel2({
|
|
32
79
|
name: "CreateReviewInput",
|
|
33
80
|
fields: {
|
|
34
|
-
productId: { type:
|
|
35
|
-
storeId: { type:
|
|
36
|
-
orderId: { type:
|
|
37
|
-
rating: { type:
|
|
38
|
-
title: { type:
|
|
39
|
-
content: { type:
|
|
81
|
+
productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
82
|
+
storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
83
|
+
orderId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
84
|
+
rating: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
|
|
85
|
+
title: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
86
|
+
content: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true }
|
|
40
87
|
}
|
|
41
88
|
});
|
|
42
|
-
var ListReviewsInputModel =
|
|
89
|
+
var ListReviewsInputModel = defineSchemaModel2({
|
|
43
90
|
name: "ListReviewsInput",
|
|
44
91
|
fields: {
|
|
45
|
-
productId: { type:
|
|
46
|
-
storeId: { type:
|
|
92
|
+
productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
93
|
+
storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
47
94
|
status: { type: ReviewStatusEnum, isOptional: true },
|
|
48
|
-
minRating: { type:
|
|
95
|
+
minRating: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
|
|
49
96
|
limit: {
|
|
50
|
-
type:
|
|
97
|
+
type: ScalarTypeEnum2.Int_unsecure(),
|
|
51
98
|
isOptional: true,
|
|
52
99
|
defaultValue: 20
|
|
53
100
|
},
|
|
54
101
|
offset: {
|
|
55
|
-
type:
|
|
102
|
+
type: ScalarTypeEnum2.Int_unsecure(),
|
|
56
103
|
isOptional: true,
|
|
57
104
|
defaultValue: 0
|
|
58
105
|
}
|
|
59
106
|
}
|
|
60
107
|
});
|
|
61
|
-
var ListReviewsOutputModel =
|
|
108
|
+
var ListReviewsOutputModel = defineSchemaModel2({
|
|
62
109
|
name: "ListReviewsOutput",
|
|
63
110
|
fields: {
|
|
64
111
|
reviews: { type: ReviewModel, isArray: true, isOptional: false },
|
|
65
|
-
total: { type:
|
|
66
|
-
averageRating: { type:
|
|
67
|
-
ratingDistribution: { type:
|
|
112
|
+
total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
|
|
113
|
+
averageRating: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
|
|
114
|
+
ratingDistribution: { type: ScalarTypeEnum2.JSON(), isOptional: false }
|
|
68
115
|
}
|
|
69
116
|
});
|
|
70
117
|
|
|
@@ -147,53 +194,6 @@ var ListReviewsContract = defineQuery({
|
|
|
147
194
|
]
|
|
148
195
|
}
|
|
149
196
|
});
|
|
150
|
-
|
|
151
|
-
// src/review/review.event.ts
|
|
152
|
-
import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
|
|
153
|
-
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
154
|
-
var ReviewCreatedPayload = defineSchemaModel2({
|
|
155
|
-
name: "ReviewCreatedEventPayload",
|
|
156
|
-
fields: {
|
|
157
|
-
reviewId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
158
|
-
productId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
159
|
-
storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
160
|
-
authorId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
161
|
-
rating: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
|
|
162
|
-
isVerifiedPurchase: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
|
|
163
|
-
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
var ReviewRespondedPayload = defineSchemaModel2({
|
|
167
|
-
name: "ReviewRespondedEventPayload",
|
|
168
|
-
fields: {
|
|
169
|
-
reviewId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
170
|
-
responseId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
171
|
-
authorId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
172
|
-
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
var ReviewCreatedEvent = defineEvent({
|
|
176
|
-
meta: {
|
|
177
|
-
key: "marketplace.review.created",
|
|
178
|
-
version: "1.0.0",
|
|
179
|
-
description: "A review has been created.",
|
|
180
|
-
stability: "experimental",
|
|
181
|
-
owners: ["@marketplace-team"],
|
|
182
|
-
tags: ["marketplace", "review"]
|
|
183
|
-
},
|
|
184
|
-
payload: ReviewCreatedPayload
|
|
185
|
-
});
|
|
186
|
-
var ReviewRespondedEvent = defineEvent({
|
|
187
|
-
meta: {
|
|
188
|
-
key: "marketplace.review.responded",
|
|
189
|
-
version: "1.0.0",
|
|
190
|
-
description: "A seller has responded to a review.",
|
|
191
|
-
stability: "experimental",
|
|
192
|
-
owners: ["@marketplace-team"],
|
|
193
|
-
tags: ["marketplace", "review"]
|
|
194
|
-
},
|
|
195
|
-
payload: ReviewRespondedPayload
|
|
196
|
-
});
|
|
197
197
|
export {
|
|
198
198
|
ReviewStatusEnum,
|
|
199
199
|
ReviewRespondedEvent,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/review/review.event.ts
|
|
3
|
-
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
4
3
|
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
4
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
5
5
|
var ReviewCreatedPayload = defineSchemaModel({
|
|
6
6
|
name: "ReviewCreatedEventPayload",
|
|
7
7
|
fields: {
|
package/dist/store/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Store domain - Seller store management.
|
|
3
3
|
*/
|
|
4
4
|
export { StoreStatusEnum } from './store.enum';
|
|
5
|
-
export { StoreModel, CreateStoreInputModel } from './store.schema';
|
|
6
|
-
export { CreateStoreContract } from './store.operations';
|
|
7
5
|
export { StoreCreatedEvent, StoreStatusChangedEvent } from './store.event';
|
|
6
|
+
export { CreateStoreContract } from './store.operations';
|
|
7
|
+
export { CreateStoreInputModel, StoreModel } from './store.schema';
|
package/dist/store/index.js
CHANGED
|
@@ -8,34 +8,83 @@ var StoreStatusEnum = defineEnum("StoreStatus", [
|
|
|
8
8
|
"CLOSED"
|
|
9
9
|
]);
|
|
10
10
|
|
|
11
|
-
// src/store/store.
|
|
11
|
+
// src/store/store.event.ts
|
|
12
|
+
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
12
13
|
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
13
|
-
var
|
|
14
|
-
name: "
|
|
15
|
-
description: "A seller store",
|
|
14
|
+
var StoreCreatedPayload = defineSchemaModel({
|
|
15
|
+
name: "StoreCreatedEventPayload",
|
|
16
16
|
fields: {
|
|
17
|
-
|
|
17
|
+
storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
18
18
|
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
19
19
|
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
20
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
21
|
-
status: { type: StoreStatusEnum, isOptional: false },
|
|
22
20
|
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var StoreStatusChangedPayload = defineSchemaModel({
|
|
25
|
+
name: "StoreStatusChangedEventPayload",
|
|
26
|
+
fields: {
|
|
27
|
+
storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
28
|
+
previousStatus: {
|
|
29
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
30
|
+
isOptional: false
|
|
31
|
+
},
|
|
32
|
+
newStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
33
|
+
reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
34
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
var StoreCreatedEvent = defineEvent({
|
|
38
|
+
meta: {
|
|
39
|
+
key: "marketplace.store.created",
|
|
40
|
+
version: "1.0.0",
|
|
41
|
+
description: "A new seller store has been created.",
|
|
42
|
+
stability: "experimental",
|
|
43
|
+
owners: ["@marketplace-team"],
|
|
44
|
+
tags: ["marketplace", "store"]
|
|
45
|
+
},
|
|
46
|
+
payload: StoreCreatedPayload
|
|
47
|
+
});
|
|
48
|
+
var StoreStatusChangedEvent = defineEvent({
|
|
49
|
+
meta: {
|
|
50
|
+
key: "marketplace.store.statusChanged",
|
|
51
|
+
version: "1.0.0",
|
|
52
|
+
description: "A store status has changed.",
|
|
53
|
+
stability: "experimental",
|
|
54
|
+
owners: ["@marketplace-team"],
|
|
55
|
+
tags: ["marketplace", "store"]
|
|
56
|
+
},
|
|
57
|
+
payload: StoreStatusChangedPayload
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// src/store/store.schema.ts
|
|
61
|
+
import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
|
|
62
|
+
var StoreModel = defineSchemaModel2({
|
|
63
|
+
name: "StoreModel",
|
|
64
|
+
description: "A seller store",
|
|
65
|
+
fields: {
|
|
66
|
+
id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
67
|
+
name: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
68
|
+
slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
69
|
+
description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
70
|
+
status: { type: StoreStatusEnum, isOptional: false },
|
|
71
|
+
ownerId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
72
|
+
logoFileId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
73
|
+
isVerified: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
|
|
74
|
+
totalProducts: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
|
|
75
|
+
averageRating: { type: ScalarTypeEnum2.Float_unsecure(), isOptional: false },
|
|
76
|
+
createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
28
77
|
}
|
|
29
78
|
});
|
|
30
|
-
var CreateStoreInputModel =
|
|
79
|
+
var CreateStoreInputModel = defineSchemaModel2({
|
|
31
80
|
name: "CreateStoreInput",
|
|
32
81
|
fields: {
|
|
33
|
-
name: { type:
|
|
34
|
-
slug: { type:
|
|
35
|
-
description: { type:
|
|
36
|
-
email: { type:
|
|
37
|
-
country: { type:
|
|
38
|
-
currency: { type:
|
|
82
|
+
name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
|
|
83
|
+
slug: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
|
|
84
|
+
description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
85
|
+
email: { type: ScalarTypeEnum2.EmailAddress(), isOptional: true },
|
|
86
|
+
country: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
87
|
+
currency: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true }
|
|
39
88
|
}
|
|
40
89
|
});
|
|
41
90
|
|
|
@@ -84,55 +133,6 @@ var CreateStoreContract = defineCommand({
|
|
|
84
133
|
]
|
|
85
134
|
}
|
|
86
135
|
});
|
|
87
|
-
|
|
88
|
-
// src/store/store.event.ts
|
|
89
|
-
import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
|
|
90
|
-
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
91
|
-
var StoreCreatedPayload = defineSchemaModel2({
|
|
92
|
-
name: "StoreCreatedEventPayload",
|
|
93
|
-
fields: {
|
|
94
|
-
storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
95
|
-
name: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
96
|
-
slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
97
|
-
ownerId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
98
|
-
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
var StoreStatusChangedPayload = defineSchemaModel2({
|
|
102
|
-
name: "StoreStatusChangedEventPayload",
|
|
103
|
-
fields: {
|
|
104
|
-
storeId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
105
|
-
previousStatus: {
|
|
106
|
-
type: ScalarTypeEnum2.String_unsecure(),
|
|
107
|
-
isOptional: false
|
|
108
|
-
},
|
|
109
|
-
newStatus: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
110
|
-
reason: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
111
|
-
timestamp: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
var StoreCreatedEvent = defineEvent({
|
|
115
|
-
meta: {
|
|
116
|
-
key: "marketplace.store.created",
|
|
117
|
-
version: "1.0.0",
|
|
118
|
-
description: "A new seller store has been created.",
|
|
119
|
-
stability: "experimental",
|
|
120
|
-
owners: ["@marketplace-team"],
|
|
121
|
-
tags: ["marketplace", "store"]
|
|
122
|
-
},
|
|
123
|
-
payload: StoreCreatedPayload
|
|
124
|
-
});
|
|
125
|
-
var StoreStatusChangedEvent = defineEvent({
|
|
126
|
-
meta: {
|
|
127
|
-
key: "marketplace.store.statusChanged",
|
|
128
|
-
version: "1.0.0",
|
|
129
|
-
description: "A store status has changed.",
|
|
130
|
-
stability: "experimental",
|
|
131
|
-
owners: ["@marketplace-team"],
|
|
132
|
-
tags: ["marketplace", "store"]
|
|
133
|
-
},
|
|
134
|
-
payload: StoreStatusChangedPayload
|
|
135
|
-
});
|
|
136
136
|
export {
|
|
137
137
|
StoreStatusEnum,
|
|
138
138
|
StoreStatusChangedEvent,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/store/store.event.ts
|
|
3
|
-
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
4
3
|
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
4
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
5
5
|
var StoreCreatedPayload = defineSchemaModel({
|
|
6
6
|
name: "StoreCreatedEventPayload",
|
|
7
7
|
fields: {
|