@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
package/dist/store/index.js
CHANGED
|
@@ -1,6 +1,143 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/store/store.enum.ts
|
|
3
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
4
|
+
var StoreStatusEnum = defineEnum("StoreStatus", [
|
|
5
|
+
"PENDING",
|
|
6
|
+
"ACTIVE",
|
|
7
|
+
"SUSPENDED",
|
|
8
|
+
"CLOSED"
|
|
9
|
+
]);
|
|
5
10
|
|
|
6
|
-
|
|
11
|
+
// src/store/store.schema.ts
|
|
12
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
13
|
+
var StoreModel = defineSchemaModel({
|
|
14
|
+
name: "StoreModel",
|
|
15
|
+
description: "A seller store",
|
|
16
|
+
fields: {
|
|
17
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
18
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
19
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
20
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
21
|
+
status: { type: StoreStatusEnum, isOptional: false },
|
|
22
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
23
|
+
logoFileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
24
|
+
isVerified: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
25
|
+
totalProducts: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
26
|
+
averageRating: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
27
|
+
createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var CreateStoreInputModel = defineSchemaModel({
|
|
31
|
+
name: "CreateStoreInput",
|
|
32
|
+
fields: {
|
|
33
|
+
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
34
|
+
slug: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
35
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
36
|
+
email: { type: ScalarTypeEnum.EmailAddress(), isOptional: true },
|
|
37
|
+
country: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
38
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// src/store/store.operations.ts
|
|
43
|
+
import { defineCommand } from "@contractspec/lib.contracts/operations";
|
|
44
|
+
var OWNERS = ["@example.marketplace"];
|
|
45
|
+
var CreateStoreContract = defineCommand({
|
|
46
|
+
meta: {
|
|
47
|
+
key: "marketplace.store.create",
|
|
48
|
+
version: "1.0.0",
|
|
49
|
+
stability: "stable",
|
|
50
|
+
owners: [...OWNERS],
|
|
51
|
+
tags: ["marketplace", "store", "create"],
|
|
52
|
+
description: "Create a new seller store.",
|
|
53
|
+
goal: "Allow users to become sellers on the marketplace.",
|
|
54
|
+
context: "Seller onboarding."
|
|
55
|
+
},
|
|
56
|
+
io: { input: CreateStoreInputModel, output: StoreModel },
|
|
57
|
+
policy: { auth: "user" },
|
|
58
|
+
sideEffects: {
|
|
59
|
+
emits: [
|
|
60
|
+
{
|
|
61
|
+
key: "marketplace.store.created",
|
|
62
|
+
version: "1.0.0",
|
|
63
|
+
when: "Store is created",
|
|
64
|
+
payload: StoreModel
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
audit: ["marketplace.store.created"]
|
|
68
|
+
},
|
|
69
|
+
acceptance: {
|
|
70
|
+
scenarios: [
|
|
71
|
+
{
|
|
72
|
+
key: "create-store-happy-path",
|
|
73
|
+
given: ["User is authenticated"],
|
|
74
|
+
when: ["User creates a new store"],
|
|
75
|
+
then: ["Store is created", "StoreCreated event is emitted"]
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
examples: [
|
|
79
|
+
{
|
|
80
|
+
key: "create-fashion-store",
|
|
81
|
+
input: { name: "Fashion Boutique", category: "clothing" },
|
|
82
|
+
output: { id: "store-123", status: "active" }
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
});
|
|
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";
|
|
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
|
+
export {
|
|
137
|
+
StoreStatusEnum,
|
|
138
|
+
StoreStatusChangedEvent,
|
|
139
|
+
StoreModel,
|
|
140
|
+
StoreCreatedEvent,
|
|
141
|
+
CreateStoreInputModel,
|
|
142
|
+
CreateStoreContract
|
|
143
|
+
};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import * as _contractspec_lib_schema1088 from "@contractspec/lib.schema";
|
|
2
|
-
|
|
3
|
-
//#region src/store/store.enum.d.ts
|
|
4
1
|
/**
|
|
5
2
|
* Store status enum.
|
|
6
3
|
*/
|
|
7
|
-
declare const StoreStatusEnum:
|
|
8
|
-
//#endregion
|
|
9
|
-
export { StoreStatusEnum };
|
|
4
|
+
export declare const StoreStatusEnum: import("@contractspec/lib.schema").EnumType<[string, string, string, string]>;
|
|
10
5
|
//# sourceMappingURL=store.enum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.enum.d.ts","
|
|
1
|
+
{"version":3,"file":"store.enum.d.ts","sourceRoot":"","sources":["../../src/store/store.enum.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,eAAe,+EAK1B,CAAC"}
|
package/dist/store/store.enum.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/store/store.enum.ts
|
|
1
3
|
import { defineEnum } from "@contractspec/lib.schema";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const StoreStatusEnum = defineEnum("StoreStatus", [
|
|
8
|
-
"PENDING",
|
|
9
|
-
"ACTIVE",
|
|
10
|
-
"SUSPENDED",
|
|
11
|
-
"CLOSED"
|
|
4
|
+
var StoreStatusEnum = defineEnum("StoreStatus", [
|
|
5
|
+
"PENDING",
|
|
6
|
+
"ACTIVE",
|
|
7
|
+
"SUSPENDED",
|
|
8
|
+
"CLOSED"
|
|
12
9
|
]);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=store.enum.js.map
|
|
10
|
+
export {
|
|
11
|
+
StoreStatusEnum
|
|
12
|
+
};
|
|
@@ -1,51 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
timestamp: {
|
|
23
|
-
type: _contractspec_lib_schema1089.FieldType<Date, string>;
|
|
24
|
-
isOptional: false;
|
|
25
|
-
};
|
|
1
|
+
export declare const StoreCreatedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
2
|
+
storeId: {
|
|
3
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
4
|
+
isOptional: false;
|
|
5
|
+
};
|
|
6
|
+
name: {
|
|
7
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
8
|
+
isOptional: false;
|
|
9
|
+
};
|
|
10
|
+
slug: {
|
|
11
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
12
|
+
isOptional: false;
|
|
13
|
+
};
|
|
14
|
+
ownerId: {
|
|
15
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
16
|
+
isOptional: false;
|
|
17
|
+
};
|
|
18
|
+
timestamp: {
|
|
19
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
20
|
+
isOptional: false;
|
|
21
|
+
};
|
|
26
22
|
}>>;
|
|
27
|
-
declare const StoreStatusChangedEvent:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
23
|
+
export declare const StoreStatusChangedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
24
|
+
storeId: {
|
|
25
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
26
|
+
isOptional: false;
|
|
27
|
+
};
|
|
28
|
+
previousStatus: {
|
|
29
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
30
|
+
isOptional: false;
|
|
31
|
+
};
|
|
32
|
+
newStatus: {
|
|
33
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
34
|
+
isOptional: false;
|
|
35
|
+
};
|
|
36
|
+
reason: {
|
|
37
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
38
|
+
isOptional: true;
|
|
39
|
+
};
|
|
40
|
+
timestamp: {
|
|
41
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
42
|
+
isOptional: false;
|
|
43
|
+
};
|
|
48
44
|
}>>;
|
|
49
|
-
//#endregion
|
|
50
|
-
export { StoreCreatedEvent, StoreStatusChangedEvent };
|
|
51
45
|
//# sourceMappingURL=store.event.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.event.d.ts","
|
|
1
|
+
{"version":3,"file":"store.event.d.ts","sourceRoot":"","sources":["../../src/store/store.event.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;GAU5B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;GAUlC,CAAC"}
|
|
@@ -1,80 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/store/store.event.ts
|
|
2
3
|
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
14
|
-
isOptional: false
|
|
15
|
-
},
|
|
16
|
-
slug: {
|
|
17
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
18
|
-
isOptional: false
|
|
19
|
-
},
|
|
20
|
-
ownerId: {
|
|
21
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
22
|
-
isOptional: false
|
|
23
|
-
},
|
|
24
|
-
timestamp: {
|
|
25
|
-
type: ScalarTypeEnum.DateTime(),
|
|
26
|
-
isOptional: false
|
|
27
|
-
}
|
|
28
|
-
}
|
|
4
|
+
import { defineEvent } from "@contractspec/lib.contracts";
|
|
5
|
+
var StoreCreatedPayload = defineSchemaModel({
|
|
6
|
+
name: "StoreCreatedEventPayload",
|
|
7
|
+
fields: {
|
|
8
|
+
storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
9
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
13
|
+
}
|
|
29
14
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
43
|
-
isOptional: false
|
|
44
|
-
},
|
|
45
|
-
reason: {
|
|
46
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
47
|
-
isOptional: true
|
|
48
|
-
},
|
|
49
|
-
timestamp: {
|
|
50
|
-
type: ScalarTypeEnum.DateTime(),
|
|
51
|
-
isOptional: false
|
|
52
|
-
}
|
|
53
|
-
}
|
|
15
|
+
var StoreStatusChangedPayload = defineSchemaModel({
|
|
16
|
+
name: "StoreStatusChangedEventPayload",
|
|
17
|
+
fields: {
|
|
18
|
+
storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
19
|
+
previousStatus: {
|
|
20
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
21
|
+
isOptional: false
|
|
22
|
+
},
|
|
23
|
+
newStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
24
|
+
reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
25
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
26
|
+
}
|
|
54
27
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
28
|
+
var StoreCreatedEvent = defineEvent({
|
|
29
|
+
meta: {
|
|
30
|
+
key: "marketplace.store.created",
|
|
31
|
+
version: "1.0.0",
|
|
32
|
+
description: "A new seller store has been created.",
|
|
33
|
+
stability: "experimental",
|
|
34
|
+
owners: ["@marketplace-team"],
|
|
35
|
+
tags: ["marketplace", "store"]
|
|
36
|
+
},
|
|
37
|
+
payload: StoreCreatedPayload
|
|
65
38
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
39
|
+
var StoreStatusChangedEvent = defineEvent({
|
|
40
|
+
meta: {
|
|
41
|
+
key: "marketplace.store.statusChanged",
|
|
42
|
+
version: "1.0.0",
|
|
43
|
+
description: "A store status has changed.",
|
|
44
|
+
stability: "experimental",
|
|
45
|
+
owners: ["@marketplace-team"],
|
|
46
|
+
tags: ["marketplace", "store"]
|
|
47
|
+
},
|
|
48
|
+
payload: StoreStatusChangedPayload
|
|
76
49
|
});
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
50
|
+
export {
|
|
51
|
+
StoreStatusChangedEvent,
|
|
52
|
+
StoreCreatedEvent
|
|
53
|
+
};
|
|
@@ -1,131 +1,125 @@
|
|
|
1
|
-
import * as _contractspec_lib_contracts35 from "@contractspec/lib.contracts";
|
|
2
|
-
import * as _contractspec_lib_schema1101 from "@contractspec/lib.schema";
|
|
3
|
-
|
|
4
|
-
//#region src/store/store.operations.d.ts
|
|
5
1
|
/**
|
|
6
2
|
* Create a new seller store.
|
|
7
3
|
*/
|
|
8
|
-
declare const CreateStoreContract:
|
|
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
|
-
id: {
|
|
35
|
-
type: _contractspec_lib_schema1101.FieldType<string, string>;
|
|
36
|
-
isOptional: false;
|
|
37
|
-
};
|
|
38
|
-
name: {
|
|
39
|
-
type: _contractspec_lib_schema1101.FieldType<string, string>;
|
|
40
|
-
isOptional: false;
|
|
41
|
-
};
|
|
42
|
-
slug: {
|
|
43
|
-
type: _contractspec_lib_schema1101.FieldType<string, string>;
|
|
44
|
-
isOptional: false;
|
|
45
|
-
};
|
|
46
|
-
description: {
|
|
47
|
-
type: _contractspec_lib_schema1101.FieldType<string, string>;
|
|
48
|
-
isOptional: true;
|
|
49
|
-
};
|
|
50
|
-
status: {
|
|
51
|
-
type: _contractspec_lib_schema1101.EnumType<[string, string, string, string]>;
|
|
52
|
-
isOptional: false;
|
|
53
|
-
};
|
|
54
|
-
ownerId: {
|
|
55
|
-
type: _contractspec_lib_schema1101.FieldType<string, string>;
|
|
56
|
-
isOptional: false;
|
|
57
|
-
};
|
|
58
|
-
logoFileId: {
|
|
59
|
-
type: _contractspec_lib_schema1101.FieldType<string, string>;
|
|
60
|
-
isOptional: true;
|
|
61
|
-
};
|
|
62
|
-
isVerified: {
|
|
63
|
-
type: _contractspec_lib_schema1101.FieldType<boolean, boolean>;
|
|
64
|
-
isOptional: false;
|
|
65
|
-
};
|
|
66
|
-
totalProducts: {
|
|
67
|
-
type: _contractspec_lib_schema1101.FieldType<number, number>;
|
|
68
|
-
isOptional: false;
|
|
69
|
-
};
|
|
70
|
-
averageRating: {
|
|
71
|
-
type: _contractspec_lib_schema1101.FieldType<number, number>;
|
|
72
|
-
isOptional: false;
|
|
73
|
-
};
|
|
74
|
-
createdAt: {
|
|
75
|
-
type: _contractspec_lib_schema1101.FieldType<Date, string>;
|
|
76
|
-
isOptional: false;
|
|
77
|
-
};
|
|
78
|
-
}>, {
|
|
79
|
-
key: string;
|
|
80
|
-
version: string;
|
|
81
|
-
when: string;
|
|
82
|
-
payload: _contractspec_lib_schema1101.SchemaModel<{
|
|
4
|
+
export declare const CreateStoreContract: import("@contractspec/lib.contracts").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
5
|
+
name: {
|
|
6
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
7
|
+
isOptional: false;
|
|
8
|
+
};
|
|
9
|
+
slug: {
|
|
10
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
description: {
|
|
14
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
15
|
+
isOptional: true;
|
|
16
|
+
};
|
|
17
|
+
email: {
|
|
18
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
19
|
+
isOptional: true;
|
|
20
|
+
};
|
|
21
|
+
country: {
|
|
22
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
23
|
+
isOptional: true;
|
|
24
|
+
};
|
|
25
|
+
currency: {
|
|
26
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
27
|
+
isOptional: true;
|
|
28
|
+
};
|
|
29
|
+
}>, import("@contractspec/lib.schema").SchemaModel<{
|
|
83
30
|
id: {
|
|
84
|
-
|
|
85
|
-
|
|
31
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
32
|
+
isOptional: false;
|
|
86
33
|
};
|
|
87
34
|
name: {
|
|
88
|
-
|
|
89
|
-
|
|
35
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
36
|
+
isOptional: false;
|
|
90
37
|
};
|
|
91
38
|
slug: {
|
|
92
|
-
|
|
93
|
-
|
|
39
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
40
|
+
isOptional: false;
|
|
94
41
|
};
|
|
95
42
|
description: {
|
|
96
|
-
|
|
97
|
-
|
|
43
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
44
|
+
isOptional: true;
|
|
98
45
|
};
|
|
99
46
|
status: {
|
|
100
|
-
|
|
101
|
-
|
|
47
|
+
type: import("@contractspec/lib.schema").EnumType<[string, string, string, string]>;
|
|
48
|
+
isOptional: false;
|
|
102
49
|
};
|
|
103
50
|
ownerId: {
|
|
104
|
-
|
|
105
|
-
|
|
51
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
52
|
+
isOptional: false;
|
|
106
53
|
};
|
|
107
54
|
logoFileId: {
|
|
108
|
-
|
|
109
|
-
|
|
55
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
56
|
+
isOptional: true;
|
|
110
57
|
};
|
|
111
58
|
isVerified: {
|
|
112
|
-
|
|
113
|
-
|
|
59
|
+
type: import("@contractspec/lib.schema").FieldType<boolean, boolean>;
|
|
60
|
+
isOptional: false;
|
|
114
61
|
};
|
|
115
62
|
totalProducts: {
|
|
116
|
-
|
|
117
|
-
|
|
63
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
64
|
+
isOptional: false;
|
|
118
65
|
};
|
|
119
66
|
averageRating: {
|
|
120
|
-
|
|
121
|
-
|
|
67
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
68
|
+
isOptional: false;
|
|
122
69
|
};
|
|
123
70
|
createdAt: {
|
|
124
|
-
|
|
125
|
-
|
|
71
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
72
|
+
isOptional: false;
|
|
126
73
|
};
|
|
127
|
-
|
|
74
|
+
}>, {
|
|
75
|
+
key: string;
|
|
76
|
+
version: string;
|
|
77
|
+
when: string;
|
|
78
|
+
payload: import("@contractspec/lib.schema").SchemaModel<{
|
|
79
|
+
id: {
|
|
80
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
81
|
+
isOptional: false;
|
|
82
|
+
};
|
|
83
|
+
name: {
|
|
84
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
85
|
+
isOptional: false;
|
|
86
|
+
};
|
|
87
|
+
slug: {
|
|
88
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
89
|
+
isOptional: false;
|
|
90
|
+
};
|
|
91
|
+
description: {
|
|
92
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
93
|
+
isOptional: true;
|
|
94
|
+
};
|
|
95
|
+
status: {
|
|
96
|
+
type: import("@contractspec/lib.schema").EnumType<[string, string, string, string]>;
|
|
97
|
+
isOptional: false;
|
|
98
|
+
};
|
|
99
|
+
ownerId: {
|
|
100
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
101
|
+
isOptional: false;
|
|
102
|
+
};
|
|
103
|
+
logoFileId: {
|
|
104
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
105
|
+
isOptional: true;
|
|
106
|
+
};
|
|
107
|
+
isVerified: {
|
|
108
|
+
type: import("@contractspec/lib.schema").FieldType<boolean, boolean>;
|
|
109
|
+
isOptional: false;
|
|
110
|
+
};
|
|
111
|
+
totalProducts: {
|
|
112
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
113
|
+
isOptional: false;
|
|
114
|
+
};
|
|
115
|
+
averageRating: {
|
|
116
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
117
|
+
isOptional: false;
|
|
118
|
+
};
|
|
119
|
+
createdAt: {
|
|
120
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
121
|
+
isOptional: false;
|
|
122
|
+
};
|
|
123
|
+
}>;
|
|
128
124
|
}[]>;
|
|
129
|
-
//#endregion
|
|
130
|
-
export { CreateStoreContract };
|
|
131
125
|
//# sourceMappingURL=store.operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.operations.d.ts","
|
|
1
|
+
{"version":3,"file":"store.operations.d.ts","sourceRoot":"","sources":["../../src/store/store.operations.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyC9B,CAAC"}
|