@contractspec/example.marketplace 1.56.1 → 1.58.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/browser/docs/index.js +103 -0
- package/dist/browser/docs/marketplace.docblock.js +103 -0
- package/dist/browser/entities/index.js +721 -0
- package/dist/browser/entities/order.js +167 -0
- package/dist/browser/entities/payout.js +142 -0
- package/dist/browser/entities/product.js +152 -0
- package/dist/browser/entities/review.js +129 -0
- package/dist/browser/entities/store.js +97 -0
- package/dist/browser/example.js +42 -0
- package/dist/browser/handlers/index.js +303 -0
- package/dist/browser/handlers/marketplace.handlers.js +303 -0
- package/dist/browser/index.js +2016 -0
- package/dist/browser/marketplace.capability.js +40 -0
- package/dist/browser/marketplace.feature.js +137 -0
- package/dist/browser/order/index.js +307 -0
- package/dist/browser/order/order.enum.js +17 -0
- package/dist/browser/order/order.event.js +131 -0
- package/dist/browser/order/order.operations.js +172 -0
- package/dist/browser/order/order.presentation.js +153 -0
- package/dist/browser/order/order.schema.js +79 -0
- package/dist/browser/payout/index.js +152 -0
- package/dist/browser/payout/payout.enum.js +12 -0
- package/dist/browser/payout/payout.event.js +55 -0
- package/dist/browser/payout/payout.operations.js +94 -0
- package/dist/browser/payout/payout.presentation.js +111 -0
- package/dist/browser/payout/payout.schema.js +61 -0
- package/dist/browser/product/index.js +249 -0
- package/dist/browser/product/product.enum.js +13 -0
- package/dist/browser/product/product.event.js +74 -0
- package/dist/browser/product/product.operations.js +171 -0
- package/dist/browser/product/product.presentation.js +158 -0
- package/dist/browser/product/product.schema.js +84 -0
- package/dist/browser/review/index.js +206 -0
- package/dist/browser/review/review.enum.js +11 -0
- package/dist/browser/review/review.event.js +50 -0
- package/dist/browser/review/review.operations.js +152 -0
- package/dist/browser/review/review.presentation.js +123 -0
- package/dist/browser/review/review.schema.js +74 -0
- package/dist/browser/seeders/index.js +12 -0
- package/dist/browser/store/index.js +142 -0
- package/dist/browser/store/store.enum.js +11 -0
- package/dist/browser/store/store.event.js +52 -0
- package/dist/browser/store/store.operations.js +88 -0
- package/dist/browser/store/store.presentation.js +94 -0
- package/dist/browser/store/store.schema.js +43 -0
- package/dist/browser/tests/operations.test-spec.js +139 -0
- package/dist/browser/ui/MarketplaceDashboard.js +418 -0
- package/dist/browser/ui/hooks/index.js +59 -0
- package/dist/browser/ui/hooks/useMarketplaceData.js +56 -0
- package/dist/browser/ui/index.js +668 -0
- package/dist/browser/ui/renderers/index.js +248 -0
- package/dist/browser/ui/renderers/marketplace.markdown.js +248 -0
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +104 -1
- package/dist/docs/marketplace.docblock.d.ts +2 -1
- package/dist/docs/marketplace.docblock.d.ts.map +1 -0
- package/dist/docs/marketplace.docblock.js +46 -57
- package/dist/entities/index.d.ts +302 -307
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +719 -43
- package/dist/entities/order.d.ts +77 -82
- package/dist/entities/order.d.ts.map +1 -1
- package/dist/entities/order.js +162 -167
- package/dist/entities/payout.d.ts +64 -69
- package/dist/entities/payout.d.ts.map +1 -1
- package/dist/entities/payout.js +137 -156
- package/dist/entities/product.d.ts +69 -74
- package/dist/entities/product.d.ts.map +1 -1
- package/dist/entities/product.js +148 -156
- package/dist/entities/review.d.ts +55 -60
- package/dist/entities/review.d.ts.map +1 -1
- package/dist/entities/review.js +124 -146
- package/dist/entities/store.d.ts +40 -45
- package/dist/entities/store.d.ts.map +1 -1
- package/dist/entities/store.js +94 -106
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +40 -55
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +304 -3
- package/dist/handlers/marketplace.handlers.d.ts +138 -138
- package/dist/handlers/marketplace.handlers.d.ts.map +1 -1
- package/dist/handlers/marketplace.handlers.js +284 -309
- package/dist/index.d.ts +13 -31
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2017 -32
- package/dist/marketplace.capability.d.ts +3 -8
- package/dist/marketplace.capability.d.ts.map +1 -1
- package/dist/marketplace.capability.js +41 -34
- package/dist/marketplace.feature.d.ts +1 -7
- package/dist/marketplace.feature.d.ts.map +1 -1
- package/dist/marketplace.feature.js +136 -313
- package/dist/node/docs/index.js +103 -0
- package/dist/node/docs/marketplace.docblock.js +103 -0
- package/dist/node/entities/index.js +721 -0
- package/dist/node/entities/order.js +167 -0
- package/dist/node/entities/payout.js +142 -0
- package/dist/node/entities/product.js +152 -0
- package/dist/node/entities/review.js +129 -0
- package/dist/node/entities/store.js +97 -0
- package/dist/node/example.js +42 -0
- package/dist/node/handlers/index.js +303 -0
- package/dist/node/handlers/marketplace.handlers.js +303 -0
- package/dist/node/index.js +2016 -0
- package/dist/node/marketplace.capability.js +40 -0
- package/dist/node/marketplace.feature.js +137 -0
- package/dist/node/order/index.js +307 -0
- package/dist/node/order/order.enum.js +17 -0
- package/dist/node/order/order.event.js +131 -0
- package/dist/node/order/order.operations.js +172 -0
- package/dist/node/order/order.presentation.js +153 -0
- package/dist/node/order/order.schema.js +79 -0
- package/dist/node/payout/index.js +152 -0
- package/dist/node/payout/payout.enum.js +12 -0
- package/dist/node/payout/payout.event.js +55 -0
- package/dist/node/payout/payout.operations.js +94 -0
- package/dist/node/payout/payout.presentation.js +111 -0
- package/dist/node/payout/payout.schema.js +61 -0
- package/dist/node/product/index.js +249 -0
- package/dist/node/product/product.enum.js +13 -0
- package/dist/node/product/product.event.js +74 -0
- package/dist/node/product/product.operations.js +171 -0
- package/dist/node/product/product.presentation.js +158 -0
- package/dist/node/product/product.schema.js +84 -0
- package/dist/node/review/index.js +206 -0
- package/dist/node/review/review.enum.js +11 -0
- package/dist/node/review/review.event.js +50 -0
- package/dist/node/review/review.operations.js +152 -0
- package/dist/node/review/review.presentation.js +123 -0
- package/dist/node/review/review.schema.js +74 -0
- package/dist/node/seeders/index.js +12 -0
- package/dist/node/store/index.js +142 -0
- package/dist/node/store/store.enum.js +11 -0
- package/dist/node/store/store.event.js +52 -0
- package/dist/node/store/store.operations.js +88 -0
- package/dist/node/store/store.presentation.js +94 -0
- package/dist/node/store/store.schema.js +43 -0
- package/dist/node/tests/operations.test-spec.js +139 -0
- package/dist/node/ui/MarketplaceDashboard.js +418 -0
- package/dist/node/ui/hooks/index.js +59 -0
- package/dist/node/ui/hooks/useMarketplaceData.js +56 -0
- package/dist/node/ui/index.js +668 -0
- package/dist/node/ui/renderers/index.js +248 -0
- package/dist/node/ui/renderers/marketplace.markdown.js +248 -0
- package/dist/order/index.d.ts +8 -5
- package/dist/order/index.d.ts.map +1 -0
- package/dist/order/index.js +307 -5
- package/dist/order/order.enum.d.ts +1 -6
- package/dist/order/order.enum.d.ts.map +1 -1
- package/dist/order/order.enum.js +16 -20
- package/dist/order/order.event.d.ts +133 -139
- package/dist/order/order.event.d.ts.map +1 -1
- package/dist/order/order.event.js +121 -205
- package/dist/order/order.operations.d.ts +291 -297
- package/dist/order/order.operations.d.ts.map +1 -1
- package/dist/order/order.operations.js +169 -115
- package/dist/order/order.presentation.d.ts +3 -8
- package/dist/order/order.presentation.d.ts.map +1 -1
- package/dist/order/order.presentation.js +149 -81
- package/dist/order/order.schema.d.ts +143 -148
- package/dist/order/order.schema.d.ts.map +1 -1
- package/dist/order/order.schema.js +75 -150
- package/dist/payout/index.d.ts +8 -5
- package/dist/payout/index.d.ts.map +1 -0
- package/dist/payout/index.js +152 -5
- package/dist/payout/payout.enum.d.ts +1 -6
- package/dist/payout/payout.enum.d.ts.map +1 -1
- package/dist/payout/payout.enum.js +11 -15
- package/dist/payout/payout.event.d.ts +54 -60
- package/dist/payout/payout.event.d.ts.map +1 -1
- package/dist/payout/payout.event.js +51 -87
- package/dist/payout/payout.operations.d.ts +82 -88
- package/dist/payout/payout.operations.d.ts.map +1 -1
- package/dist/payout/payout.operations.js +92 -50
- package/dist/payout/payout.presentation.d.ts +2 -7
- package/dist/payout/payout.presentation.d.ts.map +1 -1
- package/dist/payout/payout.presentation.js +108 -56
- package/dist/payout/payout.schema.d.ts +139 -144
- package/dist/payout/payout.schema.d.ts.map +1 -1
- package/dist/payout/payout.schema.js +58 -112
- package/dist/product/index.d.ts +8 -5
- package/dist/product/index.d.ts.map +1 -0
- package/dist/product/index.js +249 -5
- package/dist/product/product.enum.d.ts +1 -6
- package/dist/product/product.enum.d.ts.map +1 -1
- package/dist/product/product.enum.js +12 -16
- package/dist/product/product.event.d.ts +63 -69
- package/dist/product/product.event.d.ts.map +1 -1
- package/dist/product/product.event.js +68 -113
- package/dist/product/product.operations.d.ts +225 -231
- package/dist/product/product.operations.d.ts.map +1 -1
- package/dist/product/product.operations.js +168 -104
- package/dist/product/product.presentation.d.ts +3 -8
- package/dist/product/product.presentation.d.ts.map +1 -1
- package/dist/product/product.presentation.js +154 -81
- package/dist/product/product.schema.d.ts +196 -201
- package/dist/product/product.schema.d.ts.map +1 -1
- package/dist/product/product.schema.js +80 -171
- package/dist/review/index.d.ts +8 -5
- package/dist/review/index.d.ts.map +1 -0
- package/dist/review/index.js +206 -5
- package/dist/review/review.enum.d.ts +1 -6
- package/dist/review/review.enum.d.ts.map +1 -1
- package/dist/review/review.enum.js +10 -14
- package/dist/review/review.event.d.ts +46 -52
- package/dist/review/review.event.d.ts.map +1 -1
- package/dist/review/review.event.js +46 -79
- package/dist/review/review.operations.d.ts +190 -196
- package/dist/review/review.operations.d.ts.map +1 -1
- package/dist/review/review.operations.js +149 -102
- package/dist/review/review.presentation.d.ts +2 -7
- package/dist/review/review.presentation.d.ts.map +1 -1
- package/dist/review/review.presentation.js +120 -56
- package/dist/review/review.schema.d.ts +164 -169
- package/dist/review/review.schema.d.ts.map +1 -1
- package/dist/review/review.schema.js +70 -151
- package/dist/seeders/index.d.ts +4 -8
- package/dist/seeders/index.d.ts.map +1 -1
- package/dist/seeders/index.js +11 -16
- package/dist/store/index.d.ts +8 -5
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +142 -5
- package/dist/store/store.enum.d.ts +1 -6
- package/dist/store/store.enum.d.ts.map +1 -1
- package/dist/store/store.enum.js +10 -14
- package/dist/store/store.event.d.ts +42 -48
- package/dist/store/store.event.d.ts.map +1 -1
- package/dist/store/store.event.js +48 -75
- package/dist/store/store.operations.d.ts +98 -104
- package/dist/store/store.operations.d.ts.map +1 -1
- package/dist/store/store.operations.js +86 -58
- package/dist/store/store.presentation.d.ts +2 -7
- package/dist/store/store.presentation.d.ts.map +1 -1
- package/dist/store/store.presentation.js +91 -56
- package/dist/store/store.schema.d.ts +70 -75
- package/dist/store/store.schema.d.ts.map +1 -1
- package/dist/store/store.schema.js +41 -90
- package/dist/tests/operations.test-spec.d.ts +5 -10
- package/dist/tests/operations.test-spec.d.ts.map +1 -1
- package/dist/tests/operations.test-spec.js +134 -146
- package/dist/ui/MarketplaceDashboard.d.ts +1 -6
- package/dist/ui/MarketplaceDashboard.d.ts.map +1 -1
- package/dist/ui/MarketplaceDashboard.js +413 -313
- package/dist/ui/hooks/index.d.ts +2 -2
- package/dist/ui/hooks/index.d.ts.map +1 -0
- package/dist/ui/hooks/index.js +59 -4
- package/dist/ui/hooks/useMarketplaceData.d.ts +16 -20
- package/dist/ui/hooks/useMarketplaceData.d.ts.map +1 -1
- package/dist/ui/hooks/useMarketplaceData.js +53 -60
- package/dist/ui/index.d.ts +7 -6
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +668 -5
- package/dist/ui/renderers/index.d.ts +2 -2
- package/dist/ui/renderers/index.d.ts.map +1 -0
- package/dist/ui/renderers/index.js +249 -3
- package/dist/ui/renderers/marketplace.markdown.d.ts +13 -15
- package/dist/ui/renderers/marketplace.markdown.d.ts.map +1 -1
- package/dist/ui/renderers/marketplace.markdown.js +241 -236
- package/package.json +529 -110
- package/dist/docs/marketplace.docblock.js.map +0 -1
- package/dist/entities/index.js.map +0 -1
- package/dist/entities/order.js.map +0 -1
- package/dist/entities/payout.js.map +0 -1
- package/dist/entities/product.js.map +0 -1
- package/dist/entities/review.js.map +0 -1
- package/dist/entities/store.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/handlers/marketplace.handlers.js.map +0 -1
- package/dist/marketplace.capability.js.map +0 -1
- package/dist/marketplace.feature.js.map +0 -1
- package/dist/order/order.enum.js.map +0 -1
- package/dist/order/order.event.js.map +0 -1
- package/dist/order/order.operations.js.map +0 -1
- package/dist/order/order.presentation.js.map +0 -1
- package/dist/order/order.schema.js.map +0 -1
- package/dist/payout/payout.enum.js.map +0 -1
- package/dist/payout/payout.event.js.map +0 -1
- package/dist/payout/payout.operations.js.map +0 -1
- package/dist/payout/payout.presentation.js.map +0 -1
- package/dist/payout/payout.schema.js.map +0 -1
- package/dist/product/product.enum.js.map +0 -1
- package/dist/product/product.event.js.map +0 -1
- package/dist/product/product.operations.js.map +0 -1
- package/dist/product/product.presentation.js.map +0 -1
- package/dist/product/product.schema.js.map +0 -1
- package/dist/review/review.enum.js.map +0 -1
- package/dist/review/review.event.js.map +0 -1
- package/dist/review/review.operations.js.map +0 -1
- package/dist/review/review.presentation.js.map +0 -1
- package/dist/review/review.schema.js.map +0 -1
- package/dist/seeders/index.js.map +0 -1
- package/dist/store/store.enum.js.map +0 -1
- package/dist/store/store.event.js.map +0 -1
- package/dist/store/store.operations.js.map +0 -1
- package/dist/store/store.presentation.js.map +0 -1
- package/dist/store/store.schema.js.map +0 -1
- package/dist/tests/operations.test-spec.js.map +0 -1
- package/dist/ui/MarketplaceDashboard.js.map +0 -1
- package/dist/ui/hooks/useMarketplaceData.js.map +0 -1
- package/dist/ui/renderers/marketplace.markdown.js.map +0 -1
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare const MarketplaceCapability: _contractspec_lib_contracts0.CapabilitySpec;
|
|
5
|
-
declare const EcommerceCapability: _contractspec_lib_contracts0.CapabilitySpec;
|
|
6
|
-
declare const PaymentsCapability: _contractspec_lib_contracts0.CapabilitySpec;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { EcommerceCapability, MarketplaceCapability, PaymentsCapability };
|
|
1
|
+
export declare const MarketplaceCapability: import("@contractspec/lib.contracts").CapabilitySpec;
|
|
2
|
+
export declare const EcommerceCapability: import("@contractspec/lib.contracts").CapabilitySpec;
|
|
3
|
+
export declare const PaymentsCapability: import("@contractspec/lib.contracts").CapabilitySpec;
|
|
9
4
|
//# sourceMappingURL=marketplace.capability.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketplace.capability.d.ts","
|
|
1
|
+
{"version":3,"file":"marketplace.capability.d.ts","sourceRoot":"","sources":["../src/marketplace.capability.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,sDAUhC,CAAC;AAEH,eAAO,MAAM,mBAAmB,sDAU9B,CAAC;AAEH,eAAO,MAAM,kBAAkB,sDAU7B,CAAC"}
|
|
@@ -1,34 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/marketplace.capability.ts
|
|
3
|
+
import { defineCapability, StabilityEnum } from "@contractspec/lib.contracts";
|
|
4
|
+
var MarketplaceCapability = defineCapability({
|
|
5
|
+
meta: {
|
|
6
|
+
key: "marketplace",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
kind: "ui",
|
|
9
|
+
stability: StabilityEnum.Experimental,
|
|
10
|
+
description: "Multi-vendor marketplace platform",
|
|
11
|
+
owners: ["platform.marketplace"],
|
|
12
|
+
tags: ["marketplace", "ecommerce"]
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var EcommerceCapability = defineCapability({
|
|
16
|
+
meta: {
|
|
17
|
+
key: "ecommerce",
|
|
18
|
+
version: "1.0.0",
|
|
19
|
+
kind: "api",
|
|
20
|
+
stability: StabilityEnum.Experimental,
|
|
21
|
+
description: "E-commerce operations and product catalog",
|
|
22
|
+
owners: ["platform.marketplace"],
|
|
23
|
+
tags: ["ecommerce", "products"]
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
var PaymentsCapability = defineCapability({
|
|
27
|
+
meta: {
|
|
28
|
+
key: "payments",
|
|
29
|
+
version: "1.0.0",
|
|
30
|
+
kind: "integration",
|
|
31
|
+
stability: StabilityEnum.Experimental,
|
|
32
|
+
description: "Payment processing and payouts",
|
|
33
|
+
owners: ["platform.finance"],
|
|
34
|
+
tags: ["payments", "finance"]
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export {
|
|
38
|
+
PaymentsCapability,
|
|
39
|
+
MarketplaceCapability,
|
|
40
|
+
EcommerceCapability
|
|
41
|
+
};
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import * as _contractspec_lib_contracts3 from "@contractspec/lib.contracts";
|
|
2
|
-
|
|
3
|
-
//#region src/marketplace.feature.d.ts
|
|
4
|
-
|
|
5
1
|
/**
|
|
6
2
|
* Marketplace feature module that bundles multi-vendor marketplace
|
|
7
3
|
* capabilities including stores, products, orders, payouts, and reviews.
|
|
8
4
|
*/
|
|
9
|
-
declare const MarketplaceFeature:
|
|
10
|
-
//#endregion
|
|
11
|
-
export { MarketplaceFeature };
|
|
5
|
+
export declare const MarketplaceFeature: import("@contractspec/lib.contracts").FeatureModuleSpec;
|
|
12
6
|
//# sourceMappingURL=marketplace.feature.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketplace.feature.d.ts","
|
|
1
|
+
{"version":3,"file":"marketplace.feature.d.ts","sourceRoot":"","sources":["../src/marketplace.feature.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,yDAqK7B,CAAC"}
|
|
@@ -1,315 +1,138 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/marketplace.feature.ts
|
|
1
3
|
import { defineFeature } from "@contractspec/lib.contracts";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
key: "marketplace.product.detail",
|
|
134
|
-
version: "1.0.0"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
key: "marketplace.product.editor",
|
|
138
|
-
version: "1.0.0"
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
key: "marketplace.order.list",
|
|
142
|
-
version: "1.0.0"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
key: "marketplace.order.detail",
|
|
146
|
-
version: "1.0.0"
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
key: "marketplace.checkout",
|
|
150
|
-
version: "1.0.0"
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
key: "marketplace.payout.viewList",
|
|
154
|
-
version: "1.0.0"
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
key: "marketplace.payout.detail",
|
|
158
|
-
version: "1.0.0"
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
key: "marketplace.review.viewList",
|
|
162
|
-
version: "1.0.0"
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
key: "marketplace.review.form",
|
|
166
|
-
version: "1.0.0"
|
|
167
|
-
}
|
|
168
|
-
],
|
|
169
|
-
opToPresentation: [
|
|
170
|
-
{
|
|
171
|
-
op: {
|
|
172
|
-
key: "marketplace.product.list",
|
|
173
|
-
version: "1.0.0"
|
|
174
|
-
},
|
|
175
|
-
pres: {
|
|
176
|
-
key: "marketplace.product.catalog",
|
|
177
|
-
version: "1.0.0"
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
op: {
|
|
182
|
-
key: "marketplace.order.create",
|
|
183
|
-
version: "1.0.0"
|
|
184
|
-
},
|
|
185
|
-
pres: {
|
|
186
|
-
key: "marketplace.checkout",
|
|
187
|
-
version: "1.0.0"
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
op: {
|
|
192
|
-
key: "marketplace.payout.list",
|
|
193
|
-
version: "1.0.0"
|
|
194
|
-
},
|
|
195
|
-
pres: {
|
|
196
|
-
key: "marketplace.payout.viewList",
|
|
197
|
-
version: "1.0.0"
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
op: {
|
|
202
|
-
key: "marketplace.review.list",
|
|
203
|
-
version: "1.0.0"
|
|
204
|
-
},
|
|
205
|
-
pres: {
|
|
206
|
-
key: "marketplace.review.viewList",
|
|
207
|
-
version: "1.0.0"
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
op: {
|
|
212
|
-
key: "marketplace.review.create",
|
|
213
|
-
version: "1.0.0"
|
|
214
|
-
},
|
|
215
|
-
pres: {
|
|
216
|
-
key: "marketplace.review.form",
|
|
217
|
-
version: "1.0.0"
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
],
|
|
221
|
-
presentationsTargets: [
|
|
222
|
-
{
|
|
223
|
-
key: "marketplace.store.profile",
|
|
224
|
-
version: "1.0.0",
|
|
225
|
-
targets: ["react", "markdown"]
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
key: "marketplace.seller.dashboard",
|
|
229
|
-
version: "1.0.0",
|
|
230
|
-
targets: ["react"]
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
key: "marketplace.product.catalog",
|
|
234
|
-
version: "1.0.0",
|
|
235
|
-
targets: ["react", "markdown"]
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
key: "marketplace.product.detail",
|
|
239
|
-
version: "1.0.0",
|
|
240
|
-
targets: ["react", "markdown"]
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
key: "marketplace.product.editor",
|
|
244
|
-
version: "1.0.0",
|
|
245
|
-
targets: ["react"]
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
key: "marketplace.order.list",
|
|
249
|
-
version: "1.0.0",
|
|
250
|
-
targets: ["react", "markdown"]
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
key: "marketplace.order.detail",
|
|
254
|
-
version: "1.0.0",
|
|
255
|
-
targets: ["react", "markdown"]
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
key: "marketplace.checkout",
|
|
259
|
-
version: "1.0.0",
|
|
260
|
-
targets: ["react"]
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
key: "marketplace.payout.viewList",
|
|
264
|
-
version: "1.0.0",
|
|
265
|
-
targets: ["react", "markdown"]
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
key: "marketplace.review.viewList",
|
|
269
|
-
version: "1.0.0",
|
|
270
|
-
targets: ["react", "markdown"]
|
|
271
|
-
}
|
|
272
|
-
],
|
|
273
|
-
capabilities: {
|
|
274
|
-
requires: [
|
|
275
|
-
{
|
|
276
|
-
key: "identity",
|
|
277
|
-
version: "1.0.0"
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
key: "audit-trail",
|
|
281
|
-
version: "1.0.0"
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
key: "notifications",
|
|
285
|
-
version: "1.0.0"
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
key: "files",
|
|
289
|
-
version: "1.0.0"
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
key: "metering",
|
|
293
|
-
version: "1.0.0"
|
|
294
|
-
}
|
|
295
|
-
],
|
|
296
|
-
provides: [
|
|
297
|
-
{
|
|
298
|
-
key: "marketplace",
|
|
299
|
-
version: "1.0.0"
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
key: "ecommerce",
|
|
303
|
-
version: "1.0.0"
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
key: "payments",
|
|
307
|
-
version: "1.0.0"
|
|
308
|
-
}
|
|
309
|
-
]
|
|
310
|
-
}
|
|
4
|
+
var MarketplaceFeature = defineFeature({
|
|
5
|
+
meta: {
|
|
6
|
+
key: "marketplace",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
title: "Multi-Vendor Marketplace",
|
|
9
|
+
description: "Full-featured marketplace with stores, products, orders, payouts, and reviews",
|
|
10
|
+
domain: "marketplace",
|
|
11
|
+
owners: ["@marketplace-team"],
|
|
12
|
+
tags: ["marketplace", "ecommerce", "multi-vendor", "payments"],
|
|
13
|
+
stability: "experimental"
|
|
14
|
+
},
|
|
15
|
+
operations: [
|
|
16
|
+
{ key: "marketplace.store.create", version: "1.0.0" },
|
|
17
|
+
{ key: "marketplace.product.create", version: "1.0.0" },
|
|
18
|
+
{ key: "marketplace.product.list", version: "1.0.0" },
|
|
19
|
+
{ key: "marketplace.order.create", version: "1.0.0" },
|
|
20
|
+
{ key: "marketplace.order.updateStatus", version: "1.0.0" },
|
|
21
|
+
{ key: "marketplace.payout.list", version: "1.0.0" },
|
|
22
|
+
{ key: "marketplace.review.create", version: "1.0.0" },
|
|
23
|
+
{ key: "marketplace.review.list", version: "1.0.0" }
|
|
24
|
+
],
|
|
25
|
+
events: [
|
|
26
|
+
{ key: "marketplace.store.created", version: "1.0.0" },
|
|
27
|
+
{ key: "marketplace.store.statusChanged", version: "1.0.0" },
|
|
28
|
+
{ key: "marketplace.product.created", version: "1.0.0" },
|
|
29
|
+
{ key: "marketplace.product.published", version: "1.0.0" },
|
|
30
|
+
{ key: "marketplace.inventory.updated", version: "1.0.0" },
|
|
31
|
+
{ key: "marketplace.order.created", version: "1.0.0" },
|
|
32
|
+
{ key: "marketplace.order.paid", version: "1.0.0" },
|
|
33
|
+
{ key: "marketplace.order.statusUpdated", version: "1.0.0" },
|
|
34
|
+
{ key: "marketplace.order.shipped", version: "1.0.0" },
|
|
35
|
+
{ key: "marketplace.order.completed", version: "1.0.0" },
|
|
36
|
+
{ key: "marketplace.payout.created", version: "1.0.0" },
|
|
37
|
+
{ key: "marketplace.payout.paid", version: "1.0.0" },
|
|
38
|
+
{ key: "marketplace.review.created", version: "1.0.0" },
|
|
39
|
+
{ key: "marketplace.review.responded", version: "1.0.0" }
|
|
40
|
+
],
|
|
41
|
+
presentations: [
|
|
42
|
+
{ key: "marketplace.store.profile", version: "1.0.0" },
|
|
43
|
+
{ key: "marketplace.seller.dashboard", version: "1.0.0" },
|
|
44
|
+
{ key: "marketplace.product.catalog", version: "1.0.0" },
|
|
45
|
+
{ key: "marketplace.product.detail", version: "1.0.0" },
|
|
46
|
+
{ key: "marketplace.product.editor", version: "1.0.0" },
|
|
47
|
+
{ key: "marketplace.order.list", version: "1.0.0" },
|
|
48
|
+
{ key: "marketplace.order.detail", version: "1.0.0" },
|
|
49
|
+
{ key: "marketplace.checkout", version: "1.0.0" },
|
|
50
|
+
{ key: "marketplace.payout.viewList", version: "1.0.0" },
|
|
51
|
+
{ key: "marketplace.payout.detail", version: "1.0.0" },
|
|
52
|
+
{ key: "marketplace.review.viewList", version: "1.0.0" },
|
|
53
|
+
{ key: "marketplace.review.form", version: "1.0.0" }
|
|
54
|
+
],
|
|
55
|
+
opToPresentation: [
|
|
56
|
+
{
|
|
57
|
+
op: { key: "marketplace.product.list", version: "1.0.0" },
|
|
58
|
+
pres: { key: "marketplace.product.catalog", version: "1.0.0" }
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
op: { key: "marketplace.order.create", version: "1.0.0" },
|
|
62
|
+
pres: { key: "marketplace.checkout", version: "1.0.0" }
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
op: { key: "marketplace.payout.list", version: "1.0.0" },
|
|
66
|
+
pres: { key: "marketplace.payout.viewList", version: "1.0.0" }
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
op: { key: "marketplace.review.list", version: "1.0.0" },
|
|
70
|
+
pres: { key: "marketplace.review.viewList", version: "1.0.0" }
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
op: { key: "marketplace.review.create", version: "1.0.0" },
|
|
74
|
+
pres: { key: "marketplace.review.form", version: "1.0.0" }
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
presentationsTargets: [
|
|
78
|
+
{
|
|
79
|
+
key: "marketplace.store.profile",
|
|
80
|
+
version: "1.0.0",
|
|
81
|
+
targets: ["react", "markdown"]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
key: "marketplace.seller.dashboard",
|
|
85
|
+
version: "1.0.0",
|
|
86
|
+
targets: ["react"]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
key: "marketplace.product.catalog",
|
|
90
|
+
version: "1.0.0",
|
|
91
|
+
targets: ["react", "markdown"]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
key: "marketplace.product.detail",
|
|
95
|
+
version: "1.0.0",
|
|
96
|
+
targets: ["react", "markdown"]
|
|
97
|
+
},
|
|
98
|
+
{ key: "marketplace.product.editor", version: "1.0.0", targets: ["react"] },
|
|
99
|
+
{
|
|
100
|
+
key: "marketplace.order.list",
|
|
101
|
+
version: "1.0.0",
|
|
102
|
+
targets: ["react", "markdown"]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
key: "marketplace.order.detail",
|
|
106
|
+
version: "1.0.0",
|
|
107
|
+
targets: ["react", "markdown"]
|
|
108
|
+
},
|
|
109
|
+
{ key: "marketplace.checkout", version: "1.0.0", targets: ["react"] },
|
|
110
|
+
{
|
|
111
|
+
key: "marketplace.payout.viewList",
|
|
112
|
+
version: "1.0.0",
|
|
113
|
+
targets: ["react", "markdown"]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
key: "marketplace.review.viewList",
|
|
117
|
+
version: "1.0.0",
|
|
118
|
+
targets: ["react", "markdown"]
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
capabilities: {
|
|
122
|
+
requires: [
|
|
123
|
+
{ key: "identity", version: "1.0.0" },
|
|
124
|
+
{ key: "audit-trail", version: "1.0.0" },
|
|
125
|
+
{ key: "notifications", version: "1.0.0" },
|
|
126
|
+
{ key: "files", version: "1.0.0" },
|
|
127
|
+
{ key: "metering", version: "1.0.0" }
|
|
128
|
+
],
|
|
129
|
+
provides: [
|
|
130
|
+
{ key: "marketplace", version: "1.0.0" },
|
|
131
|
+
{ key: "ecommerce", version: "1.0.0" },
|
|
132
|
+
{ key: "payments", version: "1.0.0" }
|
|
133
|
+
]
|
|
134
|
+
}
|
|
311
135
|
});
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
//# sourceMappingURL=marketplace.feature.js.map
|
|
136
|
+
export {
|
|
137
|
+
MarketplaceFeature
|
|
138
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// src/docs/marketplace.docblock.ts
|
|
2
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
|
|
3
|
+
var marketplaceDocBlocks = [
|
|
4
|
+
{
|
|
5
|
+
id: "docs.examples.marketplace",
|
|
6
|
+
title: "Marketplace (2-sided)",
|
|
7
|
+
summary: "Two-sided marketplace with stores, products, orders, payouts, and reviews. Demonstrates multi-actor flows, payments, and attachments.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/examples/marketplace",
|
|
11
|
+
tags: ["marketplace", "orders", "payouts", "reviews"],
|
|
12
|
+
body: `## Entities
|
|
13
|
+
|
|
14
|
+
- Store, Product, Order, OrderItem, Payout, Review.
|
|
15
|
+
- Uses Files module for product media and receipt attachments.
|
|
16
|
+
|
|
17
|
+
## Contracts
|
|
18
|
+
|
|
19
|
+
- \`marketplace.store.create\`, \`marketplace.product.add\`, \`marketplace.order.place\`, \`marketplace.payout.process\`, \`marketplace.review.submit\`.
|
|
20
|
+
- Policy guards via Identity/RBAC for provider vs client actions.
|
|
21
|
+
|
|
22
|
+
## Events
|
|
23
|
+
|
|
24
|
+
- order.created/completed/cancelled, payout.queued/completed, review.submitted.
|
|
25
|
+
- Hooked into Notifications and Audit Trail modules.
|
|
26
|
+
|
|
27
|
+
## UI / Presentations
|
|
28
|
+
|
|
29
|
+
- Dashboard, product catalog, order list/detail, store management.
|
|
30
|
+
- Templates registered under \`marketplace\` in Studio Template Registry.
|
|
31
|
+
|
|
32
|
+
## Notes
|
|
33
|
+
|
|
34
|
+
- Commission model encoded in spec; payouts scheduled via Jobs module.
|
|
35
|
+
- Feature flags can gate beta checkout or new reviews flow.
|
|
36
|
+
`
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "docs.examples.marketplace.goal",
|
|
40
|
+
title: "Marketplace — Goal",
|
|
41
|
+
summary: "Why this marketplace template exists and the outcomes it targets.",
|
|
42
|
+
kind: "goal",
|
|
43
|
+
visibility: "public",
|
|
44
|
+
route: "/docs/examples/marketplace/goal",
|
|
45
|
+
tags: ["marketplace", "goal"],
|
|
46
|
+
body: `## Why it matters
|
|
47
|
+
- Provides a regenerable 2-sided marketplace baseline without bespoke glue.
|
|
48
|
+
- Keeps payouts, catalog, orders, and reviews consistent across surfaces.
|
|
49
|
+
|
|
50
|
+
## Business/Product goal
|
|
51
|
+
- Safe provider/client flows with auditable payouts and moderation-ready reviews.
|
|
52
|
+
- Staged rollouts for payments/reviews via feature flags; explicit commission/tax fields.
|
|
53
|
+
|
|
54
|
+
## Success criteria
|
|
55
|
+
- Orders/payouts regenerate cleanly after spec changes.
|
|
56
|
+
- Events emit for lifecycle + audit; PII is scoped/redacted in presentations.`
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "docs.examples.marketplace.usage",
|
|
60
|
+
title: "Marketplace — Usage",
|
|
61
|
+
summary: "How to seed, extend, and safely regenerate the marketplace.",
|
|
62
|
+
kind: "usage",
|
|
63
|
+
visibility: "public",
|
|
64
|
+
route: "/docs/examples/marketplace/usage",
|
|
65
|
+
tags: ["marketplace", "usage"],
|
|
66
|
+
body: `## Setup
|
|
67
|
+
1) Seed sample stores/products/orders via template registry (or create via UI).
|
|
68
|
+
2) Configure Files storage for media/receipts; set policy.pii for sensitive fields.
|
|
69
|
+
|
|
70
|
+
## Extend & regenerate
|
|
71
|
+
1) Adjust schemas for commission/tax/payout states or review moderation in the spec.
|
|
72
|
+
2) Regenerate to sync UI, API, events, notifications.
|
|
73
|
+
3) Gate risky changes (new payment providers) behind Feature Flags.
|
|
74
|
+
|
|
75
|
+
## Guardrails
|
|
76
|
+
- Emit events for order/payout state changes; log via Audit Trail.
|
|
77
|
+
- Avoid hidden commission math—keep explicit fields.
|
|
78
|
+
- Redact buyer/provider PII in markdown/JSON presentations.`
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "docs.examples.marketplace.constraints",
|
|
82
|
+
title: "Marketplace — Constraints & Safety",
|
|
83
|
+
summary: "Internal guardrails for payouts, order states, and regeneration semantics.",
|
|
84
|
+
kind: "reference",
|
|
85
|
+
visibility: "internal",
|
|
86
|
+
route: "/docs/examples/marketplace/constraints",
|
|
87
|
+
tags: ["marketplace", "constraints", "internal"],
|
|
88
|
+
body: `## Constraints
|
|
89
|
+
- Commission logic and order states must stay spec-defined; never adjust in code-only patches.
|
|
90
|
+
- Events to emit: order.created, order.completed, payout.queued, review.posted (minimum).
|
|
91
|
+
- Regeneration must not change payment semantics without explicit spec diff.
|
|
92
|
+
|
|
93
|
+
## Safety & PII
|
|
94
|
+
- Redact buyer/provider identifiers in markdown/JSON outputs; scope payouts per tenant/org.
|
|
95
|
+
- For MCP/web surfaces, avoid exposing raw payout calc inputs; use summaries.
|
|
96
|
+
|
|
97
|
+
## Testing/Verification
|
|
98
|
+
- Add fixtures covering order lifecycle and payout queueing.
|
|
99
|
+
- Run regeneration diff when changing commission/tax fields; verify presentations updated.
|
|
100
|
+
- Ensure Notifications/Audit wiring remains intact for order/payout/review events.`
|
|
101
|
+
}
|
|
102
|
+
];
|
|
103
|
+
registerDocBlocks(marketplaceDocBlocks);
|