@contractspec/example.marketplace 1.46.0 → 1.47.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/entities/index.d.ts +296 -296
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/order.d.ts +78 -78
- package/dist/entities/payout.d.ts +65 -65
- package/dist/entities/product.d.ts +70 -70
- package/dist/entities/review.d.ts +56 -56
- package/dist/entities/store.d.ts +41 -41
- package/dist/entities/store.d.ts.map +1 -1
- package/dist/example.d.ts +2 -2
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +4 -2
- package/dist/example.js.map +1 -1
- package/dist/handlers/index.d.ts +2 -0
- package/dist/handlers/index.js +3 -0
- package/dist/handlers/marketplace.handlers.d.ts +155 -0
- package/dist/handlers/marketplace.handlers.d.ts.map +1 -0
- package/dist/handlers/marketplace.handlers.js +329 -0
- package/dist/handlers/marketplace.handlers.js.map +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -1
- package/dist/marketplace.capability.d.ts +9 -0
- package/dist/marketplace.capability.d.ts.map +1 -0
- package/dist/marketplace.capability.js +34 -0
- package/dist/marketplace.capability.js.map +1 -0
- package/dist/marketplace.feature.d.ts +2 -2
- package/dist/marketplace.feature.d.ts.map +1 -1
- package/dist/marketplace.feature.js +7 -2
- package/dist/marketplace.feature.js.map +1 -1
- package/dist/order/order.enum.d.ts +2 -2
- package/dist/order/order.enum.d.ts.map +1 -1
- package/dist/order/order.event.d.ts +39 -39
- package/dist/order/order.event.d.ts.map +1 -1
- package/dist/order/order.event.js +1 -1
- package/dist/order/order.operations.d.ts +90 -90
- package/dist/order/order.operations.d.ts.map +1 -1
- package/dist/order/order.presentation.d.ts +4 -4
- package/dist/order/order.presentation.d.ts.map +1 -1
- package/dist/order/order.presentation.js +7 -7
- package/dist/order/order.presentation.js.map +1 -1
- package/dist/order/order.schema.d.ts +39 -39
- package/dist/payout/payout.enum.d.ts +2 -2
- package/dist/payout/payout.enum.d.ts.map +1 -1
- package/dist/payout/payout.event.d.ts +17 -17
- package/dist/payout/payout.event.d.ts.map +1 -1
- package/dist/payout/payout.event.js +1 -1
- package/dist/payout/payout.operations.d.ts +24 -24
- package/dist/payout/payout.operations.d.ts.map +1 -1
- package/dist/payout/payout.presentation.d.ts +3 -3
- package/dist/payout/payout.presentation.d.ts.map +1 -1
- package/dist/payout/payout.presentation.js +5 -5
- package/dist/payout/payout.presentation.js.map +1 -1
- package/dist/payout/payout.schema.d.ts +37 -37
- package/dist/payout/payout.schema.d.ts.map +1 -1
- package/dist/product/product.enum.d.ts +2 -2
- package/dist/product/product.enum.d.ts.map +1 -1
- package/dist/product/product.event.d.ts +20 -20
- package/dist/product/product.event.js +1 -1
- package/dist/product/product.operations.d.ts +68 -68
- package/dist/product/product.operations.d.ts.map +1 -1
- package/dist/product/product.presentation.d.ts +4 -4
- package/dist/product/product.presentation.d.ts.map +1 -1
- package/dist/product/product.presentation.js +7 -7
- package/dist/product/product.presentation.js.map +1 -1
- package/dist/product/product.schema.d.ts +52 -52
- package/dist/review/review.enum.d.ts +2 -2
- package/dist/review/review.enum.d.ts.map +1 -1
- package/dist/review/review.event.d.ts +15 -15
- package/dist/review/review.event.d.ts.map +1 -1
- package/dist/review/review.event.js +1 -1
- package/dist/review/review.operations.d.ts +59 -59
- package/dist/review/review.presentation.d.ts +3 -3
- package/dist/review/review.presentation.d.ts.map +1 -1
- package/dist/review/review.presentation.js +5 -5
- package/dist/review/review.presentation.js.map +1 -1
- package/dist/review/review.schema.d.ts +45 -45
- package/dist/seeders/index.d.ts +10 -0
- package/dist/seeders/index.d.ts.map +1 -0
- package/dist/seeders/index.js +18 -0
- package/dist/seeders/index.js.map +1 -0
- package/dist/store/store.enum.d.ts +2 -2
- package/dist/store/store.enum.d.ts.map +1 -1
- package/dist/store/store.event.d.ts +14 -14
- package/dist/store/store.event.d.ts.map +1 -1
- package/dist/store/store.event.js +1 -1
- package/dist/store/store.operations.d.ts +33 -33
- package/dist/store/store.operations.d.ts.map +1 -1
- package/dist/store/store.presentation.d.ts +3 -3
- package/dist/store/store.presentation.d.ts.map +1 -1
- package/dist/store/store.presentation.js +5 -5
- package/dist/store/store.presentation.js.map +1 -1
- package/dist/store/store.schema.d.ts +20 -20
- package/dist/store/store.schema.d.ts.map +1 -1
- package/dist/tests/operations.test-spec.d.ts +11 -0
- package/dist/tests/operations.test-spec.d.ts.map +1 -0
- package/dist/tests/operations.test-spec.js +152 -0
- package/dist/tests/operations.test-spec.js.map +1 -0
- package/dist/ui/MarketplaceDashboard.d.ts +7 -0
- package/dist/ui/MarketplaceDashboard.d.ts.map +1 -0
- package/dist/ui/MarketplaceDashboard.js +319 -0
- package/dist/ui/MarketplaceDashboard.js.map +1 -0
- package/dist/ui/hooks/index.d.ts +2 -0
- package/dist/ui/hooks/index.js +5 -0
- package/dist/ui/hooks/useMarketplaceData.d.ts +23 -0
- package/dist/ui/hooks/useMarketplaceData.d.ts.map +1 -0
- package/dist/ui/hooks/useMarketplaceData.js +64 -0
- package/dist/ui/hooks/useMarketplaceData.js.map +1 -0
- package/dist/ui/index.d.ts +6 -0
- package/dist/ui/index.js +6 -0
- package/dist/ui/renderers/index.d.ts +2 -0
- package/dist/ui/renderers/index.js +3 -0
- package/dist/ui/renderers/marketplace.markdown.d.ts +28 -0
- package/dist/ui/renderers/marketplace.markdown.d.ts.map +1 -0
- package/dist/ui/renderers/marketplace.markdown.js +244 -0
- package/dist/ui/renderers/marketplace.markdown.js.map +1 -0
- package/package.json +24 -8
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema996 from "@contractspec/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/entities/review.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Review status enum.
|
|
6
6
|
*/
|
|
7
|
-
declare const ReviewStatusEnum:
|
|
7
|
+
declare const ReviewStatusEnum: _contractspec_lib_schema996.EntityEnumDef;
|
|
8
8
|
/**
|
|
9
9
|
* Review type enum.
|
|
10
10
|
*/
|
|
11
|
-
declare const ReviewTypeEnum:
|
|
11
|
+
declare const ReviewTypeEnum: _contractspec_lib_schema996.EntityEnumDef;
|
|
12
12
|
/**
|
|
13
13
|
* Review entity - customer reviews and ratings.
|
|
14
14
|
*/
|
|
15
|
-
declare const ReviewEntity:
|
|
16
|
-
id:
|
|
17
|
-
type:
|
|
18
|
-
productId:
|
|
19
|
-
storeId:
|
|
20
|
-
orderId:
|
|
21
|
-
orderItemId:
|
|
22
|
-
authorId:
|
|
23
|
-
rating:
|
|
24
|
-
title:
|
|
25
|
-
content:
|
|
26
|
-
isVerifiedPurchase:
|
|
27
|
-
status:
|
|
28
|
-
hasMedia:
|
|
29
|
-
helpfulCount:
|
|
30
|
-
notHelpfulCount:
|
|
31
|
-
moderatedBy:
|
|
32
|
-
moderatedAt:
|
|
33
|
-
moderationNote:
|
|
34
|
-
hasResponse:
|
|
35
|
-
createdAt:
|
|
36
|
-
updatedAt:
|
|
37
|
-
product:
|
|
38
|
-
store:
|
|
39
|
-
responses:
|
|
40
|
-
votes:
|
|
15
|
+
declare const ReviewEntity: _contractspec_lib_schema996.EntitySpec<{
|
|
16
|
+
id: _contractspec_lib_schema996.EntityScalarField;
|
|
17
|
+
type: _contractspec_lib_schema996.EntityEnumField;
|
|
18
|
+
productId: _contractspec_lib_schema996.EntityScalarField;
|
|
19
|
+
storeId: _contractspec_lib_schema996.EntityScalarField;
|
|
20
|
+
orderId: _contractspec_lib_schema996.EntityScalarField;
|
|
21
|
+
orderItemId: _contractspec_lib_schema996.EntityScalarField;
|
|
22
|
+
authorId: _contractspec_lib_schema996.EntityScalarField;
|
|
23
|
+
rating: _contractspec_lib_schema996.EntityScalarField;
|
|
24
|
+
title: _contractspec_lib_schema996.EntityScalarField;
|
|
25
|
+
content: _contractspec_lib_schema996.EntityScalarField;
|
|
26
|
+
isVerifiedPurchase: _contractspec_lib_schema996.EntityScalarField;
|
|
27
|
+
status: _contractspec_lib_schema996.EntityEnumField;
|
|
28
|
+
hasMedia: _contractspec_lib_schema996.EntityScalarField;
|
|
29
|
+
helpfulCount: _contractspec_lib_schema996.EntityScalarField;
|
|
30
|
+
notHelpfulCount: _contractspec_lib_schema996.EntityScalarField;
|
|
31
|
+
moderatedBy: _contractspec_lib_schema996.EntityScalarField;
|
|
32
|
+
moderatedAt: _contractspec_lib_schema996.EntityScalarField;
|
|
33
|
+
moderationNote: _contractspec_lib_schema996.EntityScalarField;
|
|
34
|
+
hasResponse: _contractspec_lib_schema996.EntityScalarField;
|
|
35
|
+
createdAt: _contractspec_lib_schema996.EntityScalarField;
|
|
36
|
+
updatedAt: _contractspec_lib_schema996.EntityScalarField;
|
|
37
|
+
product: _contractspec_lib_schema996.EntityRelationField;
|
|
38
|
+
store: _contractspec_lib_schema996.EntityRelationField;
|
|
39
|
+
responses: _contractspec_lib_schema996.EntityRelationField;
|
|
40
|
+
votes: _contractspec_lib_schema996.EntityRelationField;
|
|
41
41
|
}>;
|
|
42
42
|
/**
|
|
43
43
|
* Review response entity - seller responses to reviews.
|
|
44
44
|
*/
|
|
45
|
-
declare const ReviewResponseEntity:
|
|
46
|
-
id:
|
|
47
|
-
reviewId:
|
|
48
|
-
authorId:
|
|
49
|
-
content:
|
|
50
|
-
createdAt:
|
|
51
|
-
updatedAt:
|
|
52
|
-
review:
|
|
45
|
+
declare const ReviewResponseEntity: _contractspec_lib_schema996.EntitySpec<{
|
|
46
|
+
id: _contractspec_lib_schema996.EntityScalarField;
|
|
47
|
+
reviewId: _contractspec_lib_schema996.EntityScalarField;
|
|
48
|
+
authorId: _contractspec_lib_schema996.EntityScalarField;
|
|
49
|
+
content: _contractspec_lib_schema996.EntityScalarField;
|
|
50
|
+
createdAt: _contractspec_lib_schema996.EntityScalarField;
|
|
51
|
+
updatedAt: _contractspec_lib_schema996.EntityScalarField;
|
|
52
|
+
review: _contractspec_lib_schema996.EntityRelationField;
|
|
53
53
|
}>;
|
|
54
54
|
/**
|
|
55
55
|
* Review vote entity - helpfulness votes.
|
|
56
56
|
*/
|
|
57
|
-
declare const ReviewVoteEntity:
|
|
58
|
-
id:
|
|
59
|
-
reviewId:
|
|
60
|
-
userId:
|
|
61
|
-
isHelpful:
|
|
62
|
-
createdAt:
|
|
63
|
-
review:
|
|
57
|
+
declare const ReviewVoteEntity: _contractspec_lib_schema996.EntitySpec<{
|
|
58
|
+
id: _contractspec_lib_schema996.EntityScalarField;
|
|
59
|
+
reviewId: _contractspec_lib_schema996.EntityScalarField;
|
|
60
|
+
userId: _contractspec_lib_schema996.EntityScalarField;
|
|
61
|
+
isHelpful: _contractspec_lib_schema996.EntityScalarField;
|
|
62
|
+
createdAt: _contractspec_lib_schema996.EntityScalarField;
|
|
63
|
+
review: _contractspec_lib_schema996.EntityRelationField;
|
|
64
64
|
}>;
|
|
65
65
|
/**
|
|
66
66
|
* Review report entity - flagged reviews.
|
|
67
67
|
*/
|
|
68
|
-
declare const ReviewReportEntity:
|
|
69
|
-
id:
|
|
70
|
-
reviewId:
|
|
71
|
-
reporterId:
|
|
72
|
-
reason:
|
|
73
|
-
details:
|
|
74
|
-
status:
|
|
75
|
-
resolvedBy:
|
|
76
|
-
resolvedAt:
|
|
77
|
-
resolution:
|
|
78
|
-
createdAt:
|
|
79
|
-
review:
|
|
68
|
+
declare const ReviewReportEntity: _contractspec_lib_schema996.EntitySpec<{
|
|
69
|
+
id: _contractspec_lib_schema996.EntityScalarField;
|
|
70
|
+
reviewId: _contractspec_lib_schema996.EntityScalarField;
|
|
71
|
+
reporterId: _contractspec_lib_schema996.EntityScalarField;
|
|
72
|
+
reason: _contractspec_lib_schema996.EntityScalarField;
|
|
73
|
+
details: _contractspec_lib_schema996.EntityScalarField;
|
|
74
|
+
status: _contractspec_lib_schema996.EntityScalarField;
|
|
75
|
+
resolvedBy: _contractspec_lib_schema996.EntityScalarField;
|
|
76
|
+
resolvedAt: _contractspec_lib_schema996.EntityScalarField;
|
|
77
|
+
resolution: _contractspec_lib_schema996.EntityScalarField;
|
|
78
|
+
createdAt: _contractspec_lib_schema996.EntityScalarField;
|
|
79
|
+
review: _contractspec_lib_schema996.EntityRelationField;
|
|
80
80
|
}>;
|
|
81
81
|
//#endregion
|
|
82
82
|
export { ReviewEntity, ReviewReportEntity, ReviewResponseEntity, ReviewStatusEnum, ReviewTypeEnum, ReviewVoteEntity };
|
package/dist/entities/store.d.ts
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema1051 from "@contractspec/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/entities/store.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Store status enum.
|
|
6
6
|
*/
|
|
7
|
-
declare const StoreStatusEnum:
|
|
7
|
+
declare const StoreStatusEnum: _contractspec_lib_schema1051.EntityEnumDef;
|
|
8
8
|
/**
|
|
9
9
|
* Store type enum.
|
|
10
10
|
*/
|
|
11
|
-
declare const StoreTypeEnum:
|
|
11
|
+
declare const StoreTypeEnum: _contractspec_lib_schema1051.EntityEnumDef;
|
|
12
12
|
/**
|
|
13
13
|
* Store entity - a seller's storefront on the marketplace.
|
|
14
14
|
*/
|
|
15
|
-
declare const StoreEntity:
|
|
16
|
-
id:
|
|
17
|
-
name:
|
|
18
|
-
slug:
|
|
19
|
-
description:
|
|
20
|
-
status:
|
|
21
|
-
type:
|
|
22
|
-
ownerId:
|
|
23
|
-
organizationId:
|
|
24
|
-
logoFileId:
|
|
25
|
-
bannerFileId:
|
|
26
|
-
email:
|
|
27
|
-
phone:
|
|
28
|
-
website:
|
|
29
|
-
country:
|
|
30
|
-
currency:
|
|
31
|
-
timezone:
|
|
32
|
-
commissionRate:
|
|
33
|
-
isVerified:
|
|
34
|
-
verifiedAt:
|
|
35
|
-
settings:
|
|
36
|
-
metadata:
|
|
37
|
-
totalProducts:
|
|
38
|
-
totalOrders:
|
|
39
|
-
totalRevenue:
|
|
40
|
-
averageRating:
|
|
41
|
-
createdAt:
|
|
42
|
-
updatedAt:
|
|
43
|
-
products:
|
|
44
|
-
orders:
|
|
45
|
-
payouts:
|
|
15
|
+
declare const StoreEntity: _contractspec_lib_schema1051.EntitySpec<{
|
|
16
|
+
id: _contractspec_lib_schema1051.EntityScalarField;
|
|
17
|
+
name: _contractspec_lib_schema1051.EntityScalarField;
|
|
18
|
+
slug: _contractspec_lib_schema1051.EntityScalarField;
|
|
19
|
+
description: _contractspec_lib_schema1051.EntityScalarField;
|
|
20
|
+
status: _contractspec_lib_schema1051.EntityEnumField;
|
|
21
|
+
type: _contractspec_lib_schema1051.EntityEnumField;
|
|
22
|
+
ownerId: _contractspec_lib_schema1051.EntityScalarField;
|
|
23
|
+
organizationId: _contractspec_lib_schema1051.EntityScalarField;
|
|
24
|
+
logoFileId: _contractspec_lib_schema1051.EntityScalarField;
|
|
25
|
+
bannerFileId: _contractspec_lib_schema1051.EntityScalarField;
|
|
26
|
+
email: _contractspec_lib_schema1051.EntityScalarField;
|
|
27
|
+
phone: _contractspec_lib_schema1051.EntityScalarField;
|
|
28
|
+
website: _contractspec_lib_schema1051.EntityScalarField;
|
|
29
|
+
country: _contractspec_lib_schema1051.EntityScalarField;
|
|
30
|
+
currency: _contractspec_lib_schema1051.EntityScalarField;
|
|
31
|
+
timezone: _contractspec_lib_schema1051.EntityScalarField;
|
|
32
|
+
commissionRate: _contractspec_lib_schema1051.EntityScalarField;
|
|
33
|
+
isVerified: _contractspec_lib_schema1051.EntityScalarField;
|
|
34
|
+
verifiedAt: _contractspec_lib_schema1051.EntityScalarField;
|
|
35
|
+
settings: _contractspec_lib_schema1051.EntityScalarField;
|
|
36
|
+
metadata: _contractspec_lib_schema1051.EntityScalarField;
|
|
37
|
+
totalProducts: _contractspec_lib_schema1051.EntityScalarField;
|
|
38
|
+
totalOrders: _contractspec_lib_schema1051.EntityScalarField;
|
|
39
|
+
totalRevenue: _contractspec_lib_schema1051.EntityScalarField;
|
|
40
|
+
averageRating: _contractspec_lib_schema1051.EntityScalarField;
|
|
41
|
+
createdAt: _contractspec_lib_schema1051.EntityScalarField;
|
|
42
|
+
updatedAt: _contractspec_lib_schema1051.EntityScalarField;
|
|
43
|
+
products: _contractspec_lib_schema1051.EntityRelationField;
|
|
44
|
+
orders: _contractspec_lib_schema1051.EntityRelationField;
|
|
45
|
+
payouts: _contractspec_lib_schema1051.EntityRelationField;
|
|
46
46
|
}>;
|
|
47
47
|
/**
|
|
48
48
|
* Store category entity - categorization for stores.
|
|
49
49
|
*/
|
|
50
|
-
declare const StoreCategoryEntity:
|
|
51
|
-
id:
|
|
52
|
-
storeId:
|
|
53
|
-
categoryId:
|
|
54
|
-
isPrimary:
|
|
55
|
-
createdAt:
|
|
56
|
-
store:
|
|
50
|
+
declare const StoreCategoryEntity: _contractspec_lib_schema1051.EntitySpec<{
|
|
51
|
+
id: _contractspec_lib_schema1051.EntityScalarField;
|
|
52
|
+
storeId: _contractspec_lib_schema1051.EntityScalarField;
|
|
53
|
+
categoryId: _contractspec_lib_schema1051.EntityScalarField;
|
|
54
|
+
isPrimary: _contractspec_lib_schema1051.EntityScalarField;
|
|
55
|
+
createdAt: _contractspec_lib_schema1051.EntityScalarField;
|
|
56
|
+
store: _contractspec_lib_schema1051.EntityRelationField;
|
|
57
57
|
}>;
|
|
58
58
|
//#endregion
|
|
59
59
|
export { StoreCategoryEntity, StoreEntity, StoreStatusEnum, StoreTypeEnum };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","names":[],"sources":["../../src/entities/store.ts"],"sourcesContent":[],"mappings":";;;;;;AAUa,cAAA,eAKX,EAAA,
|
|
1
|
+
{"version":3,"file":"store.d.ts","names":[],"sources":["../../src/entities/store.ts"],"sourcesContent":[],"mappings":";;;;;;AAUa,cAAA,eAKX,EAAA,4BAAA,CAL0B,aAK1B;AAKF;AAUA;;cAVa,eAKX,4BAAA,CALwB;;;;cAUb,0CAAW;MA8EtB,4BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;+DA9EsB;EAAA,SAAA,gDAAA;EAmFX,SAAA,gDAkBX;EAAA,QAAA,kDAAA;;;;;;;AAlB8B,cAAnB,mBAAmB,+BAAA,UAAA,CAAA;MAkB9B,4BAAA,CAAA"}
|
package/dist/example.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
|
|
2
2
|
|
|
3
3
|
//#region src/example.d.ts
|
|
4
|
-
declare const example: ExampleSpec;
|
|
4
|
+
declare const example: _contractspec_lib_contracts0.ExampleSpec;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { example as default };
|
|
7
7
|
//# sourceMappingURL=example.d.ts.map
|
package/dist/example.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";;;cAEM,
|
|
1
|
+
{"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";;;cAEM,SAoCJ,4BAAA,CApCW"}
|
package/dist/example.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { defineExample } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
1
3
|
//#region src/example.ts
|
|
2
|
-
const example = {
|
|
4
|
+
const example = defineExample({
|
|
3
5
|
meta: {
|
|
4
6
|
key: "marketplace",
|
|
5
7
|
version: "1.0.0",
|
|
@@ -48,7 +50,7 @@ const example = {
|
|
|
48
50
|
},
|
|
49
51
|
mcp: { enabled: true }
|
|
50
52
|
}
|
|
51
|
-
};
|
|
53
|
+
});
|
|
52
54
|
var example_default = example;
|
|
53
55
|
|
|
54
56
|
//#endregion
|
package/dist/example.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example.js","names":[
|
|
1
|
+
{"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["import { defineExample } from '@contractspec/lib.contracts';\n\nconst example = defineExample({\n meta: {\n key: 'marketplace',\n version: '1.0.0',\n title: 'Marketplace (2-sided)',\n description:\n 'Two-sided marketplace with stores, products, orders, payouts, and reviews (multi-actor flows).',\n kind: 'template',\n visibility: 'public',\n stability: 'experimental',\n owners: ['@platform.core'],\n tags: ['marketplace', 'orders', 'payouts', 'reviews'],\n },\n docs: {\n rootDocId: 'docs.examples.marketplace',\n goalDocId: 'docs.examples.marketplace.goal',\n usageDocId: 'docs.examples.marketplace.usage',\n constraintsDocId: 'docs.examples.marketplace.constraints',\n },\n entrypoints: {\n packageName: '@contractspec/example.marketplace',\n feature: './feature',\n contracts: './contracts',\n presentations: './presentations',\n handlers: './handlers',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: {\n enabled: true,\n modes: ['playground', 'specs', 'builder', 'markdown', 'evolution'],\n },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n});\n\nexport default example;\n"],"mappings":";;;AAEA,MAAM,UAAU,cAAc;CAC5B,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,YAAY;EACZ,WAAW;EACX,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAe;GAAU;GAAW;GAAU;EACtD;CACD,MAAM;EACJ,WAAW;EACX,WAAW;EACX,YAAY;EACZ,kBAAkB;EACnB;CACD,aAAa;EACX,aAAa;EACb,SAAS;EACT,WAAW;EACX,eAAe;EACf,UAAU;EACV,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GACP,SAAS;GACT,OAAO;IAAC;IAAc;IAAS;IAAW;IAAY;IAAY;GACnE;EACD,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF,CAAC;AAEF,sBAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { AddProductInput, CreateStoreInput, ListOrdersInput, ListOrdersOutput, ListProductsInput, ListProductsOutput, ListStoresInput, ListStoresOutput, MarketplaceHandlers, Order, OrderItem, Payout, PlaceOrderInput, Product, Review, Store, createMarketplaceHandlers } from "./marketplace.handlers.js";
|
|
2
|
+
export { AddProductInput, CreateStoreInput, ListOrdersInput, ListOrdersOutput, ListProductsInput, ListProductsOutput, ListStoresInput, ListStoresOutput, MarketplaceHandlers, Order, OrderItem, Payout, PlaceOrderInput, Product, Review, Store, createMarketplaceHandlers };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { DatabasePort } from "@contractspec/lib.runtime-sandbox";
|
|
2
|
+
|
|
3
|
+
//#region src/handlers/marketplace.handlers.d.ts
|
|
4
|
+
|
|
5
|
+
interface Store {
|
|
6
|
+
id: string;
|
|
7
|
+
projectId: string;
|
|
8
|
+
organizationId: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
status: 'PENDING' | 'ACTIVE' | 'SUSPENDED';
|
|
12
|
+
rating: number;
|
|
13
|
+
reviewCount: number;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
}
|
|
17
|
+
interface Product {
|
|
18
|
+
id: string;
|
|
19
|
+
storeId: string;
|
|
20
|
+
name: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
price: number;
|
|
23
|
+
currency: string;
|
|
24
|
+
status: 'DRAFT' | 'ACTIVE' | 'OUT_OF_STOCK' | 'ARCHIVED';
|
|
25
|
+
stock: number;
|
|
26
|
+
category?: string;
|
|
27
|
+
imageUrl?: string;
|
|
28
|
+
createdAt: Date;
|
|
29
|
+
updatedAt: Date;
|
|
30
|
+
}
|
|
31
|
+
interface Order {
|
|
32
|
+
id: string;
|
|
33
|
+
projectId: string;
|
|
34
|
+
storeId: string;
|
|
35
|
+
customerId: string;
|
|
36
|
+
status: 'PENDING' | 'CONFIRMED' | 'PROCESSING' | 'SHIPPED' | 'DELIVERED' | 'CANCELLED';
|
|
37
|
+
total: number;
|
|
38
|
+
currency: string;
|
|
39
|
+
shippingAddress?: string;
|
|
40
|
+
createdAt: Date;
|
|
41
|
+
updatedAt: Date;
|
|
42
|
+
}
|
|
43
|
+
interface OrderItem {
|
|
44
|
+
id: string;
|
|
45
|
+
orderId: string;
|
|
46
|
+
productId: string;
|
|
47
|
+
quantity: number;
|
|
48
|
+
price: number;
|
|
49
|
+
createdAt: Date;
|
|
50
|
+
}
|
|
51
|
+
interface Payout {
|
|
52
|
+
id: string;
|
|
53
|
+
storeId: string;
|
|
54
|
+
amount: number;
|
|
55
|
+
currency: string;
|
|
56
|
+
status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED';
|
|
57
|
+
processedAt?: Date;
|
|
58
|
+
createdAt: Date;
|
|
59
|
+
}
|
|
60
|
+
interface Review {
|
|
61
|
+
id: string;
|
|
62
|
+
productId: string;
|
|
63
|
+
customerId: string;
|
|
64
|
+
orderId?: string;
|
|
65
|
+
rating: number;
|
|
66
|
+
comment?: string;
|
|
67
|
+
createdAt: Date;
|
|
68
|
+
}
|
|
69
|
+
interface CreateStoreInput {
|
|
70
|
+
name: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
}
|
|
73
|
+
interface AddProductInput {
|
|
74
|
+
storeId: string;
|
|
75
|
+
name: string;
|
|
76
|
+
description?: string;
|
|
77
|
+
price: number;
|
|
78
|
+
currency?: string;
|
|
79
|
+
stock?: number;
|
|
80
|
+
category?: string;
|
|
81
|
+
imageUrl?: string;
|
|
82
|
+
}
|
|
83
|
+
interface PlaceOrderInput {
|
|
84
|
+
storeId: string;
|
|
85
|
+
items: {
|
|
86
|
+
productId: string;
|
|
87
|
+
quantity: number;
|
|
88
|
+
}[];
|
|
89
|
+
shippingAddress?: string;
|
|
90
|
+
}
|
|
91
|
+
interface ListStoresInput {
|
|
92
|
+
projectId: string;
|
|
93
|
+
status?: 'PENDING' | 'ACTIVE' | 'SUSPENDED' | 'all';
|
|
94
|
+
search?: string;
|
|
95
|
+
limit?: number;
|
|
96
|
+
offset?: number;
|
|
97
|
+
}
|
|
98
|
+
interface ListStoresOutput {
|
|
99
|
+
stores: Store[];
|
|
100
|
+
total: number;
|
|
101
|
+
}
|
|
102
|
+
interface ListProductsInput {
|
|
103
|
+
storeId?: string;
|
|
104
|
+
status?: 'DRAFT' | 'ACTIVE' | 'OUT_OF_STOCK' | 'ARCHIVED' | 'all';
|
|
105
|
+
category?: string;
|
|
106
|
+
search?: string;
|
|
107
|
+
limit?: number;
|
|
108
|
+
offset?: number;
|
|
109
|
+
}
|
|
110
|
+
interface ListProductsOutput {
|
|
111
|
+
products: Product[];
|
|
112
|
+
total: number;
|
|
113
|
+
}
|
|
114
|
+
interface ListOrdersInput {
|
|
115
|
+
projectId: string;
|
|
116
|
+
storeId?: string;
|
|
117
|
+
customerId?: string;
|
|
118
|
+
status?: 'PENDING' | 'CONFIRMED' | 'PROCESSING' | 'SHIPPED' | 'DELIVERED' | 'CANCELLED' | 'all';
|
|
119
|
+
limit?: number;
|
|
120
|
+
offset?: number;
|
|
121
|
+
}
|
|
122
|
+
interface ListOrdersOutput {
|
|
123
|
+
orders: Order[];
|
|
124
|
+
total: number;
|
|
125
|
+
totalRevenue: number;
|
|
126
|
+
}
|
|
127
|
+
declare function createMarketplaceHandlers(db: DatabasePort): {
|
|
128
|
+
listStores: (input: ListStoresInput) => Promise<ListStoresOutput>;
|
|
129
|
+
createStore: (input: CreateStoreInput, context: {
|
|
130
|
+
projectId: string;
|
|
131
|
+
organizationId: string;
|
|
132
|
+
}) => Promise<Store>;
|
|
133
|
+
listProducts: (input: ListProductsInput) => Promise<ListProductsOutput>;
|
|
134
|
+
addProduct: (input: AddProductInput) => Promise<Product>;
|
|
135
|
+
listOrders: (input: ListOrdersInput) => Promise<ListOrdersOutput>;
|
|
136
|
+
placeOrder: (input: PlaceOrderInput, context: {
|
|
137
|
+
projectId: string;
|
|
138
|
+
customerId: string;
|
|
139
|
+
}) => Promise<Order>;
|
|
140
|
+
getOrderItems: (orderId: string) => Promise<OrderItem[]>;
|
|
141
|
+
updateOrderStatus: (orderId: string, status: Order["status"]) => Promise<Order>;
|
|
142
|
+
listPayouts: (storeId: string) => Promise<Payout[]>;
|
|
143
|
+
listReviews: (productId: string) => Promise<Review[]>;
|
|
144
|
+
submitReview: (input: {
|
|
145
|
+
productId: string;
|
|
146
|
+
customerId: string;
|
|
147
|
+
orderId?: string;
|
|
148
|
+
rating: number;
|
|
149
|
+
comment?: string;
|
|
150
|
+
}) => Promise<Review>;
|
|
151
|
+
};
|
|
152
|
+
type MarketplaceHandlers = ReturnType<typeof createMarketplaceHandlers>;
|
|
153
|
+
//#endregion
|
|
154
|
+
export { AddProductInput, CreateStoreInput, ListOrdersInput, ListOrdersOutput, ListProductsInput, ListProductsOutput, ListStoresInput, ListStoresOutput, MarketplaceHandlers, Order, OrderItem, Payout, PlaceOrderInput, Product, Review, Store, createMarketplaceHandlers };
|
|
155
|
+
//# sourceMappingURL=marketplace.handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplace.handlers.d.ts","names":[],"sources":["../../src/handlers/marketplace.handlers.ts"],"sourcesContent":[],"mappings":";;;;AA2DiB,UA/CA,KAAA,CA+CS;EAST,EAAA,EAAA,MAAM;EAUN,SAAM,EAAA,MAAA;EAUN,cAAA,EAAA,MAAgB;EAKhB,IAAA,EAAA,MAAA;EAWA,WAAA,CAAA,EAAA,MAAe;EAMf,MAAA,EAAA,SAAA,GAAe,QAAA,GAAA,WAAA;EAQf,MAAA,EAAA,MAAA;EAKA,WAAA,EAAA,MAAA;EASA,SAAA,EA/GJ,IA+GI;EAKA,SAAA,EAnHJ,IAmHI;AAgBjB;AAkKgB,UAlSC,OAAA,CAkSD;EAA8B,EAAA,EAAA,MAAA;EAIX,OAAA,EAAA,MAAA;EAA0B,IAAA,EAAA,MAAA;EAAR,WAAA,CAAA,EAAA,MAAA;EAyC1C,KAAA,EAAA,MAAA;EAEE,QAAA,EAAA,MAAA;EAAR,MAAA,EAAA,OAAA,GAAA,QAAA,GAAA,cAAA,GAAA,UAAA;EAgCM,KAAA,EAAA,MAAA;EACE,QAAA,CAAA,EAAA,MAAA;EAAR,QAAA,CAAA,EAAA,MAAA;EAkD8B,SAAA,EAzZtB,IAyZsB;EAA0B,SAAA,EAxZhD,IAwZgD;;AAiC1B,UAtblB,KAAA,CAsbkB;EAA0B,EAAA,EAAA,MAAA;EAAR,SAAA,EAAA,MAAA;EA8D1C,OAAA,EAAA,MAAA;EAEE,UAAA,EAAA,MAAA;EAAR,MAAA,EAAA,SAAA,GAAA,WAAA,GAAA,YAAA,GAAA,SAAA,GAAA,WAAA,GAAA,WAAA;EA4EoD,KAAA,EAAA,MAAA;EAAR,QAAA,EAAA,MAAA;EAerC,eAAA,CAAA,EAAA,MAAA;EACC,SAAA,EAnkBA,IAmkBA;EAAR,SAAA,EAlkBQ,IAkkBR;;AAkB0C,UAjlB9B,SAAA,CAilB8B;EAcU,EAAA,EAAA,MAAA;EAAR,OAAA,EAAA,MAAA;EAoBnC,SAAA,EAAA,MAAA;EAAR,QAAA,EAAA,MAAA;EAAO,KAAA,EAAA,MAAA;EAyCD,SAAA,EAtpBC,IAspBD;;UAnpBK,MAAA;;;;;;gBAMD;aACH;;UAGI,MAAA;;;;;;;aAOJ;;UAGI,gBAAA;;;;UAKA,eAAA;;;;;;;;;;UAWA,eAAA;;;;;;;;UAMA,eAAA;;;;;;;UAQA,gBAAA;UACP;;;UAIO,iBAAA;;;;;;;;UASA,kBAAA;YACL;;;UAIK,eAAA;;;;;;;;UAgBA,gBAAA;UACP;;;;iBAiKM,yBAAA,KAA8B;sBAIX,oBAAkB,QAAQ;uBAyClD;;;QAEN,QAAQ;wBAgCF,sBACN,QAAQ;sBAkDsB,oBAAkB,QAAQ;sBAiC1B,oBAAkB,QAAQ;sBA8DlD;;;QAEN,QAAQ;sCA4EoC,QAAQ;+CAe7C,oBACP,QAAQ;oCAkBkC,QAAQ;sCAcN,QAAQ;;;;;;;QAoBnD,QAAQ;;KAyCF,mBAAA,GAAsB,kBAAkB"}
|