@contractspec/example.marketplace 0.0.0-canary-20260113170453
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/LICENSE +21 -0
- package/README.md +141 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +1 -0
- package/dist/docs/marketplace.docblock.d.ts +1 -0
- package/dist/docs/marketplace.docblock.js +115 -0
- package/dist/docs/marketplace.docblock.js.map +1 -0
- package/dist/entities/index.d.ts +309 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +46 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/order.d.ts +105 -0
- package/dist/entities/order.d.ts.map +1 -0
- package/dist/entities/order.js +173 -0
- package/dist/entities/order.js.map +1 -0
- package/dist/entities/payout.d.ts +92 -0
- package/dist/entities/payout.d.ts.map +1 -0
- package/dist/entities/payout.js +162 -0
- package/dist/entities/payout.js.map +1 -0
- package/dist/entities/product.d.ts +93 -0
- package/dist/entities/product.d.ts.map +1 -0
- package/dist/entities/product.js +161 -0
- package/dist/entities/product.js.map +1 -0
- package/dist/entities/review.d.ts +83 -0
- package/dist/entities/review.d.ts.map +1 -0
- package/dist/entities/review.js +152 -0
- package/dist/entities/review.js.map +1 -0
- package/dist/entities/store.d.ts +60 -0
- package/dist/entities/store.d.ts.map +1 -0
- package/dist/entities/store.js +110 -0
- package/dist/entities/store.js.map +1 -0
- package/dist/example.d.ts +7 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +58 -0
- package/dist/example.js.map +1 -0
- 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 +31 -0
- package/dist/index.js +32 -0
- 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 +12 -0
- package/dist/marketplace.feature.d.ts.map +1 -0
- package/dist/marketplace.feature.js +315 -0
- package/dist/marketplace.feature.js.map +1 -0
- package/dist/order/index.d.ts +5 -0
- package/dist/order/index.js +6 -0
- package/dist/order/order.enum.d.ts +10 -0
- package/dist/order/order.enum.d.ts.map +1 -0
- package/dist/order/order.enum.js +22 -0
- package/dist/order/order.enum.js.map +1 -0
- package/dist/order/order.event.d.ts +145 -0
- package/dist/order/order.event.d.ts.map +1 -0
- package/dist/order/order.event.js +216 -0
- package/dist/order/order.event.js.map +1 -0
- package/dist/order/order.operations.d.ts +368 -0
- package/dist/order/order.operations.d.ts.map +1 -0
- package/dist/order/order.operations.js +119 -0
- package/dist/order/order.operations.js.map +1 -0
- package/dist/order/order.presentation.d.ts +9 -0
- package/dist/order/order.presentation.d.ts.map +1 -0
- package/dist/order/order.presentation.js +86 -0
- package/dist/order/order.presentation.js.map +1 -0
- package/dist/order/order.schema.d.ts +165 -0
- package/dist/order/order.schema.d.ts.map +1 -0
- package/dist/order/order.schema.js +155 -0
- package/dist/order/order.schema.js.map +1 -0
- package/dist/payout/index.d.ts +5 -0
- package/dist/payout/index.js +6 -0
- package/dist/payout/payout.enum.d.ts +10 -0
- package/dist/payout/payout.enum.d.ts.map +1 -0
- package/dist/payout/payout.enum.js +17 -0
- package/dist/payout/payout.enum.js.map +1 -0
- package/dist/payout/payout.event.d.ts +63 -0
- package/dist/payout/payout.event.d.ts.map +1 -0
- package/dist/payout/payout.event.js +92 -0
- package/dist/payout/payout.event.js.map +1 -0
- package/dist/payout/payout.operations.d.ts +97 -0
- package/dist/payout/payout.operations.d.ts.map +1 -0
- package/dist/payout/payout.operations.js +53 -0
- package/dist/payout/payout.operations.js.map +1 -0
- package/dist/payout/payout.presentation.d.ts +8 -0
- package/dist/payout/payout.presentation.d.ts.map +1 -0
- package/dist/payout/payout.presentation.js +60 -0
- package/dist/payout/payout.presentation.js.map +1 -0
- package/dist/payout/payout.schema.d.ts +157 -0
- package/dist/payout/payout.schema.d.ts.map +1 -0
- package/dist/payout/payout.schema.js +116 -0
- package/dist/payout/payout.schema.js.map +1 -0
- package/dist/product/index.d.ts +5 -0
- package/dist/product/index.js +6 -0
- package/dist/product/product.enum.d.ts +10 -0
- package/dist/product/product.enum.d.ts.map +1 -0
- package/dist/product/product.enum.js +18 -0
- package/dist/product/product.enum.js.map +1 -0
- package/dist/product/product.event.d.ts +73 -0
- package/dist/product/product.event.d.ts.map +1 -0
- package/dist/product/product.event.js +120 -0
- package/dist/product/product.event.js.map +1 -0
- package/dist/product/product.operations.d.ts +273 -0
- package/dist/product/product.operations.d.ts.map +1 -0
- package/dist/product/product.operations.js +108 -0
- package/dist/product/product.operations.js.map +1 -0
- package/dist/product/product.presentation.d.ts +9 -0
- package/dist/product/product.presentation.d.ts.map +1 -0
- package/dist/product/product.presentation.js +86 -0
- package/dist/product/product.presentation.js.map +1 -0
- package/dist/product/product.schema.d.ts +218 -0
- package/dist/product/product.schema.d.ts.map +1 -0
- package/dist/product/product.schema.js +176 -0
- package/dist/product/product.schema.js.map +1 -0
- package/dist/review/index.d.ts +5 -0
- package/dist/review/index.js +6 -0
- package/dist/review/review.enum.d.ts +10 -0
- package/dist/review/review.enum.d.ts.map +1 -0
- package/dist/review/review.enum.js +16 -0
- package/dist/review/review.enum.js.map +1 -0
- package/dist/review/review.event.d.ts +55 -0
- package/dist/review/review.event.d.ts.map +1 -0
- package/dist/review/review.event.js +84 -0
- package/dist/review/review.event.js.map +1 -0
- package/dist/review/review.operations.d.ts +237 -0
- package/dist/review/review.operations.d.ts.map +1 -0
- package/dist/review/review.operations.js +106 -0
- package/dist/review/review.operations.js.map +1 -0
- package/dist/review/review.presentation.d.ts +8 -0
- package/dist/review/review.presentation.d.ts.map +1 -0
- package/dist/review/review.presentation.js +60 -0
- package/dist/review/review.presentation.js.map +1 -0
- package/dist/review/review.schema.d.ts +190 -0
- package/dist/review/review.schema.d.ts.map +1 -0
- package/dist/review/review.schema.js +156 -0
- package/dist/review/review.schema.js.map +1 -0
- 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/index.d.ts +5 -0
- package/dist/store/index.js +6 -0
- package/dist/store/store.enum.d.ts +10 -0
- package/dist/store/store.enum.d.ts.map +1 -0
- package/dist/store/store.enum.js +16 -0
- package/dist/store/store.enum.js.map +1 -0
- package/dist/store/store.event.d.ts +51 -0
- package/dist/store/store.event.d.ts.map +1 -0
- package/dist/store/store.event.js +80 -0
- package/dist/store/store.event.js.map +1 -0
- package/dist/store/store.operations.d.ts +131 -0
- package/dist/store/store.operations.d.ts.map +1 -0
- package/dist/store/store.operations.js +61 -0
- package/dist/store/store.operations.js.map +1 -0
- package/dist/store/store.presentation.d.ts +8 -0
- package/dist/store/store.presentation.d.ts.map +1 -0
- package/dist/store/store.presentation.js +60 -0
- package/dist/store/store.presentation.js.map +1 -0
- package/dist/store/store.schema.d.ts +84 -0
- package/dist/store/store.schema.d.ts.map +1 -0
- package/dist/store/store.schema.js +93 -0
- package/dist/store/store.schema.js.map +1 -0
- 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 +149 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import * as _contractspec_lib_contracts39 from "@contractspec/lib.contracts";
|
|
2
|
+
import * as _contractspec_lib_schema520 from "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/store/store.operations.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Create a new seller store.
|
|
7
|
+
*/
|
|
8
|
+
declare const CreateStoreContract: _contractspec_lib_contracts39.OperationSpec<_contractspec_lib_schema520.SchemaModel<{
|
|
9
|
+
name: {
|
|
10
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
slug: {
|
|
14
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
15
|
+
isOptional: false;
|
|
16
|
+
};
|
|
17
|
+
description: {
|
|
18
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
19
|
+
isOptional: true;
|
|
20
|
+
};
|
|
21
|
+
email: {
|
|
22
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
23
|
+
isOptional: true;
|
|
24
|
+
};
|
|
25
|
+
country: {
|
|
26
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
27
|
+
isOptional: true;
|
|
28
|
+
};
|
|
29
|
+
currency: {
|
|
30
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
31
|
+
isOptional: true;
|
|
32
|
+
};
|
|
33
|
+
}>, _contractspec_lib_schema520.SchemaModel<{
|
|
34
|
+
id: {
|
|
35
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
36
|
+
isOptional: false;
|
|
37
|
+
};
|
|
38
|
+
name: {
|
|
39
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
40
|
+
isOptional: false;
|
|
41
|
+
};
|
|
42
|
+
slug: {
|
|
43
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
44
|
+
isOptional: false;
|
|
45
|
+
};
|
|
46
|
+
description: {
|
|
47
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
48
|
+
isOptional: true;
|
|
49
|
+
};
|
|
50
|
+
status: {
|
|
51
|
+
type: _contractspec_lib_schema520.EnumType<[string, string, string, string]>;
|
|
52
|
+
isOptional: false;
|
|
53
|
+
};
|
|
54
|
+
ownerId: {
|
|
55
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
56
|
+
isOptional: false;
|
|
57
|
+
};
|
|
58
|
+
logoFileId: {
|
|
59
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
60
|
+
isOptional: true;
|
|
61
|
+
};
|
|
62
|
+
isVerified: {
|
|
63
|
+
type: _contractspec_lib_schema520.FieldType<boolean, boolean>;
|
|
64
|
+
isOptional: false;
|
|
65
|
+
};
|
|
66
|
+
totalProducts: {
|
|
67
|
+
type: _contractspec_lib_schema520.FieldType<number, number>;
|
|
68
|
+
isOptional: false;
|
|
69
|
+
};
|
|
70
|
+
averageRating: {
|
|
71
|
+
type: _contractspec_lib_schema520.FieldType<number, number>;
|
|
72
|
+
isOptional: false;
|
|
73
|
+
};
|
|
74
|
+
createdAt: {
|
|
75
|
+
type: _contractspec_lib_schema520.FieldType<Date, string>;
|
|
76
|
+
isOptional: false;
|
|
77
|
+
};
|
|
78
|
+
}>, {
|
|
79
|
+
key: string;
|
|
80
|
+
version: string;
|
|
81
|
+
when: string;
|
|
82
|
+
payload: _contractspec_lib_schema520.SchemaModel<{
|
|
83
|
+
id: {
|
|
84
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
85
|
+
isOptional: false;
|
|
86
|
+
};
|
|
87
|
+
name: {
|
|
88
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
89
|
+
isOptional: false;
|
|
90
|
+
};
|
|
91
|
+
slug: {
|
|
92
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
93
|
+
isOptional: false;
|
|
94
|
+
};
|
|
95
|
+
description: {
|
|
96
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
97
|
+
isOptional: true;
|
|
98
|
+
};
|
|
99
|
+
status: {
|
|
100
|
+
type: _contractspec_lib_schema520.EnumType<[string, string, string, string]>;
|
|
101
|
+
isOptional: false;
|
|
102
|
+
};
|
|
103
|
+
ownerId: {
|
|
104
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
105
|
+
isOptional: false;
|
|
106
|
+
};
|
|
107
|
+
logoFileId: {
|
|
108
|
+
type: _contractspec_lib_schema520.FieldType<string, string>;
|
|
109
|
+
isOptional: true;
|
|
110
|
+
};
|
|
111
|
+
isVerified: {
|
|
112
|
+
type: _contractspec_lib_schema520.FieldType<boolean, boolean>;
|
|
113
|
+
isOptional: false;
|
|
114
|
+
};
|
|
115
|
+
totalProducts: {
|
|
116
|
+
type: _contractspec_lib_schema520.FieldType<number, number>;
|
|
117
|
+
isOptional: false;
|
|
118
|
+
};
|
|
119
|
+
averageRating: {
|
|
120
|
+
type: _contractspec_lib_schema520.FieldType<number, number>;
|
|
121
|
+
isOptional: false;
|
|
122
|
+
};
|
|
123
|
+
createdAt: {
|
|
124
|
+
type: _contractspec_lib_schema520.FieldType<Date, string>;
|
|
125
|
+
isOptional: false;
|
|
126
|
+
};
|
|
127
|
+
}>;
|
|
128
|
+
}[]>;
|
|
129
|
+
//#endregion
|
|
130
|
+
export { CreateStoreContract };
|
|
131
|
+
//# sourceMappingURL=store.operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.operations.d.ts","names":[],"sources":["../../src/store/store.operations.ts"],"sourcesContent":[],"mappings":";;;;;;;cAQa,mDAAmB,0CAAA;EAAnB,IAAA,EAAA;IAyCX,IAAA,EAAA,2BAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;EAzC8B,WAAA,EAAA;;;;;;;;;;;;;;;;;;UAAA,2BAAA,CAAA;;;;;;;;+CAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { CreateStoreInputModel, StoreModel } from "./store.schema.js";
|
|
2
|
+
import { defineCommand } from "@contractspec/lib.contracts/operations";
|
|
3
|
+
|
|
4
|
+
//#region src/store/store.operations.ts
|
|
5
|
+
const OWNERS = ["@example.marketplace"];
|
|
6
|
+
/**
|
|
7
|
+
* Create a new seller store.
|
|
8
|
+
*/
|
|
9
|
+
const CreateStoreContract = defineCommand({
|
|
10
|
+
meta: {
|
|
11
|
+
key: "marketplace.store.create",
|
|
12
|
+
version: "1.0.0",
|
|
13
|
+
stability: "stable",
|
|
14
|
+
owners: [...OWNERS],
|
|
15
|
+
tags: [
|
|
16
|
+
"marketplace",
|
|
17
|
+
"store",
|
|
18
|
+
"create"
|
|
19
|
+
],
|
|
20
|
+
description: "Create a new seller store.",
|
|
21
|
+
goal: "Allow users to become sellers on the marketplace.",
|
|
22
|
+
context: "Seller onboarding."
|
|
23
|
+
},
|
|
24
|
+
io: {
|
|
25
|
+
input: CreateStoreInputModel,
|
|
26
|
+
output: StoreModel
|
|
27
|
+
},
|
|
28
|
+
policy: { auth: "user" },
|
|
29
|
+
sideEffects: {
|
|
30
|
+
emits: [{
|
|
31
|
+
key: "marketplace.store.created",
|
|
32
|
+
version: "1.0.0",
|
|
33
|
+
when: "Store is created",
|
|
34
|
+
payload: StoreModel
|
|
35
|
+
}],
|
|
36
|
+
audit: ["marketplace.store.created"]
|
|
37
|
+
},
|
|
38
|
+
acceptance: {
|
|
39
|
+
scenarios: [{
|
|
40
|
+
key: "create-store-happy-path",
|
|
41
|
+
given: ["User is authenticated"],
|
|
42
|
+
when: ["User creates a new store"],
|
|
43
|
+
then: ["Store is created", "StoreCreated event is emitted"]
|
|
44
|
+
}],
|
|
45
|
+
examples: [{
|
|
46
|
+
key: "create-fashion-store",
|
|
47
|
+
input: {
|
|
48
|
+
name: "Fashion Boutique",
|
|
49
|
+
category: "clothing"
|
|
50
|
+
},
|
|
51
|
+
output: {
|
|
52
|
+
id: "store-123",
|
|
53
|
+
status: "active"
|
|
54
|
+
}
|
|
55
|
+
}]
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
export { CreateStoreContract };
|
|
61
|
+
//# sourceMappingURL=store.operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.operations.js","names":[],"sources":["../../src/store/store.operations.ts"],"sourcesContent":["import { defineCommand } from '@contractspec/lib.contracts/operations';\nimport { StoreModel, CreateStoreInputModel } from './store.schema';\n\nconst OWNERS = ['@example.marketplace'] as const;\n\n/**\n * Create a new seller store.\n */\nexport const CreateStoreContract = defineCommand({\n meta: {\n key: 'marketplace.store.create',\n version: '1.0.0',\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['marketplace', 'store', 'create'],\n description: 'Create a new seller store.',\n goal: 'Allow users to become sellers on the marketplace.',\n context: 'Seller onboarding.',\n },\n io: { input: CreateStoreInputModel, output: StoreModel },\n policy: { auth: 'user' },\n sideEffects: {\n emits: [\n {\n key: 'marketplace.store.created',\n version: '1.0.0',\n when: 'Store is created',\n payload: StoreModel,\n },\n ],\n audit: ['marketplace.store.created'],\n },\n acceptance: {\n scenarios: [\n {\n key: 'create-store-happy-path',\n given: ['User is authenticated'],\n when: ['User creates a new store'],\n then: ['Store is created', 'StoreCreated event is emitted'],\n },\n ],\n examples: [\n {\n key: 'create-fashion-store',\n input: { name: 'Fashion Boutique', category: 'clothing' },\n output: { id: 'store-123', status: 'active' },\n },\n ],\n },\n});\n"],"mappings":";;;;AAGA,MAAM,SAAS,CAAC,uBAAuB;;;;AAKvC,MAAa,sBAAsB,cAAc;CAC/C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAe;GAAS;GAAS;EACxC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EAAE,OAAO;EAAuB,QAAQ;EAAY;CACxD,QAAQ,EAAE,MAAM,QAAQ;CACxB,aAAa;EACX,OAAO,CACL;GACE,KAAK;GACL,SAAS;GACT,MAAM;GACN,SAAS;GACV,CACF;EACD,OAAO,CAAC,4BAA4B;EACrC;CACD,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,wBAAwB;GAChC,MAAM,CAAC,2BAA2B;GAClC,MAAM,CAAC,oBAAoB,gCAAgC;GAC5D,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IAAE,MAAM;IAAoB,UAAU;IAAY;GACzD,QAAQ;IAAE,IAAI;IAAa,QAAQ;IAAU;GAC9C,CACF;EACF;CACF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _contractspec_lib_contracts41 from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/store/store.presentation.d.ts
|
|
4
|
+
declare const StoreProfilePresentation: _contractspec_lib_contracts41.PresentationSpec;
|
|
5
|
+
declare const SellerDashboardPresentation: _contractspec_lib_contracts41.PresentationSpec;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { SellerDashboardPresentation, StoreProfilePresentation };
|
|
8
|
+
//# sourceMappingURL=store.presentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.presentation.d.ts","names":[],"sources":["../../src/store/store.presentation.ts"],"sourcesContent":[],"mappings":";;;cAGa,0BAuBX,6BAAA,CAvBmC;cAyBxB,6BAyBZ,6BAAA,CAzBuC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { StoreModel } from "./store.schema.js";
|
|
2
|
+
import { StabilityEnum, definePresentation } from "@contractspec/lib.contracts";
|
|
3
|
+
|
|
4
|
+
//#region src/store/store.presentation.ts
|
|
5
|
+
const StoreProfilePresentation = definePresentation({
|
|
6
|
+
meta: {
|
|
7
|
+
key: "marketplace.store.profile",
|
|
8
|
+
version: "1.0.0",
|
|
9
|
+
title: "Store Profile",
|
|
10
|
+
description: "Public store profile page",
|
|
11
|
+
domain: "marketplace",
|
|
12
|
+
owners: ["@marketplace-team"],
|
|
13
|
+
tags: [
|
|
14
|
+
"marketplace",
|
|
15
|
+
"store",
|
|
16
|
+
"profile"
|
|
17
|
+
],
|
|
18
|
+
stability: StabilityEnum.Experimental,
|
|
19
|
+
goal: "Showcase a seller store with its products and reputation.",
|
|
20
|
+
context: "The public landing page for a marketplace seller."
|
|
21
|
+
},
|
|
22
|
+
source: {
|
|
23
|
+
type: "component",
|
|
24
|
+
framework: "react",
|
|
25
|
+
componentKey: "StoreProfile",
|
|
26
|
+
props: StoreModel
|
|
27
|
+
},
|
|
28
|
+
targets: ["react", "markdown"],
|
|
29
|
+
policy: { flags: ["marketplace.stores.enabled"] }
|
|
30
|
+
});
|
|
31
|
+
const SellerDashboardPresentation = definePresentation({
|
|
32
|
+
meta: {
|
|
33
|
+
key: "marketplace.seller.dashboard",
|
|
34
|
+
version: "1.0.0",
|
|
35
|
+
title: "Seller Dashboard",
|
|
36
|
+
description: "Seller dashboard with sales and analytics",
|
|
37
|
+
domain: "marketplace",
|
|
38
|
+
owners: ["@marketplace-team"],
|
|
39
|
+
tags: [
|
|
40
|
+
"marketplace",
|
|
41
|
+
"seller",
|
|
42
|
+
"dashboard"
|
|
43
|
+
],
|
|
44
|
+
stability: StabilityEnum.Experimental,
|
|
45
|
+
goal: "Provide sellers with an overview of their business performance.",
|
|
46
|
+
context: "The primary workspace for store owners."
|
|
47
|
+
},
|
|
48
|
+
source: {
|
|
49
|
+
type: "component",
|
|
50
|
+
framework: "react",
|
|
51
|
+
componentKey: "SellerDashboard",
|
|
52
|
+
props: StoreModel
|
|
53
|
+
},
|
|
54
|
+
targets: ["react"],
|
|
55
|
+
policy: { flags: ["marketplace.seller.enabled"] }
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
export { SellerDashboardPresentation, StoreProfilePresentation };
|
|
60
|
+
//# sourceMappingURL=store.presentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.presentation.js","names":[],"sources":["../../src/store/store.presentation.ts"],"sourcesContent":["import { definePresentation, StabilityEnum } from '@contractspec/lib.contracts';\nimport { StoreModel } from './store.schema';\n\nexport const StoreProfilePresentation = definePresentation({\n meta: {\n key: 'marketplace.store.profile',\n version: '1.0.0',\n title: 'Store Profile',\n description: 'Public store profile page',\n domain: 'marketplace',\n owners: ['@marketplace-team'],\n tags: ['marketplace', 'store', 'profile'],\n stability: StabilityEnum.Experimental,\n goal: 'Showcase a seller store with its products and reputation.',\n context: 'The public landing page for a marketplace seller.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'StoreProfile',\n props: StoreModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['marketplace.stores.enabled'],\n },\n});\n\nexport const SellerDashboardPresentation = definePresentation(\n {\n meta: {\n key: 'marketplace.seller.dashboard',\n version: '1.0.0',\n title: 'Seller Dashboard',\n description: 'Seller dashboard with sales and analytics',\n domain: 'marketplace',\n owners: ['@marketplace-team'],\n tags: ['marketplace', 'seller', 'dashboard'],\n stability: StabilityEnum.Experimental,\n goal: 'Provide sellers with an overview of their business performance.',\n context: 'The primary workspace for store owners.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'SellerDashboard',\n props: StoreModel,\n },\n targets: ['react'],\n policy: {\n flags: ['marketplace.seller.enabled'],\n },\n }\n);\n"],"mappings":";;;;AAGA,MAAa,2BAA2B,mBAAmB;CACzD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM;GAAC;GAAe;GAAS;GAAU;EACzC,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,6BAA6B,EACtC;CACF,CAAC;AAEF,MAAa,8BAA8B,mBACzC;CACE,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM;GAAC;GAAe;GAAU;GAAY;EAC5C,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,QAAQ;CAClB,QAAQ,EACN,OAAO,CAAC,6BAA6B,EACtC;CACF,CACF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as _contractspec_lib_schema501 from "@contractspec/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/store/store.schema.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A seller store.
|
|
6
|
+
*/
|
|
7
|
+
declare const StoreModel: _contractspec_lib_schema501.SchemaModel<{
|
|
8
|
+
id: {
|
|
9
|
+
type: _contractspec_lib_schema501.FieldType<string, string>;
|
|
10
|
+
isOptional: false;
|
|
11
|
+
};
|
|
12
|
+
name: {
|
|
13
|
+
type: _contractspec_lib_schema501.FieldType<string, string>;
|
|
14
|
+
isOptional: false;
|
|
15
|
+
};
|
|
16
|
+
slug: {
|
|
17
|
+
type: _contractspec_lib_schema501.FieldType<string, string>;
|
|
18
|
+
isOptional: false;
|
|
19
|
+
};
|
|
20
|
+
description: {
|
|
21
|
+
type: _contractspec_lib_schema501.FieldType<string, string>;
|
|
22
|
+
isOptional: true;
|
|
23
|
+
};
|
|
24
|
+
status: {
|
|
25
|
+
type: _contractspec_lib_schema501.EnumType<[string, string, string, string]>;
|
|
26
|
+
isOptional: false;
|
|
27
|
+
};
|
|
28
|
+
ownerId: {
|
|
29
|
+
type: _contractspec_lib_schema501.FieldType<string, string>;
|
|
30
|
+
isOptional: false;
|
|
31
|
+
};
|
|
32
|
+
logoFileId: {
|
|
33
|
+
type: _contractspec_lib_schema501.FieldType<string, string>;
|
|
34
|
+
isOptional: true;
|
|
35
|
+
};
|
|
36
|
+
isVerified: {
|
|
37
|
+
type: _contractspec_lib_schema501.FieldType<boolean, boolean>;
|
|
38
|
+
isOptional: false;
|
|
39
|
+
};
|
|
40
|
+
totalProducts: {
|
|
41
|
+
type: _contractspec_lib_schema501.FieldType<number, number>;
|
|
42
|
+
isOptional: false;
|
|
43
|
+
};
|
|
44
|
+
averageRating: {
|
|
45
|
+
type: _contractspec_lib_schema501.FieldType<number, number>;
|
|
46
|
+
isOptional: false;
|
|
47
|
+
};
|
|
48
|
+
createdAt: {
|
|
49
|
+
type: _contractspec_lib_schema501.FieldType<Date, string>;
|
|
50
|
+
isOptional: false;
|
|
51
|
+
};
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Input for creating a store.
|
|
55
|
+
*/
|
|
56
|
+
declare const CreateStoreInputModel: _contractspec_lib_schema501.SchemaModel<{
|
|
57
|
+
name: {
|
|
58
|
+
type: _contractspec_lib_schema501.FieldType<string, string>;
|
|
59
|
+
isOptional: false;
|
|
60
|
+
};
|
|
61
|
+
slug: {
|
|
62
|
+
type: _contractspec_lib_schema501.FieldType<string, string>;
|
|
63
|
+
isOptional: false;
|
|
64
|
+
};
|
|
65
|
+
description: {
|
|
66
|
+
type: _contractspec_lib_schema501.FieldType<string, string>;
|
|
67
|
+
isOptional: true;
|
|
68
|
+
};
|
|
69
|
+
email: {
|
|
70
|
+
type: _contractspec_lib_schema501.FieldType<string, string>;
|
|
71
|
+
isOptional: true;
|
|
72
|
+
};
|
|
73
|
+
country: {
|
|
74
|
+
type: _contractspec_lib_schema501.FieldType<string, string>;
|
|
75
|
+
isOptional: true;
|
|
76
|
+
};
|
|
77
|
+
currency: {
|
|
78
|
+
type: _contractspec_lib_schema501.FieldType<string, string>;
|
|
79
|
+
isOptional: true;
|
|
80
|
+
};
|
|
81
|
+
}>;
|
|
82
|
+
//#endregion
|
|
83
|
+
export { CreateStoreInputModel, StoreModel };
|
|
84
|
+
//# sourceMappingURL=store.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.schema.d.ts","names":[],"sources":["../../src/store/store.schema.ts"],"sourcesContent":[],"mappings":";;;;;;AAMa,cAAA,UAgBX,8BAhBqB,WAgBrB,CAAA;EAAA,EAAA,EAAA;UAAA,2BAAA,CAAA;;;;;;;;;;;;IAhBqB,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAqBV,UAAA,EAAA,IAAA;EAUX,CAAA;;;;;;+CAVgC,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;cAArB,mDAAqB;;UAUhC,2BAAA,CAAA"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { StoreStatusEnum } from "./store.enum.js";
|
|
2
|
+
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/store/store.schema.ts
|
|
5
|
+
/**
|
|
6
|
+
* A seller store.
|
|
7
|
+
*/
|
|
8
|
+
const StoreModel = defineSchemaModel({
|
|
9
|
+
name: "StoreModel",
|
|
10
|
+
description: "A seller store",
|
|
11
|
+
fields: {
|
|
12
|
+
id: {
|
|
13
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
14
|
+
isOptional: false
|
|
15
|
+
},
|
|
16
|
+
name: {
|
|
17
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
18
|
+
isOptional: false
|
|
19
|
+
},
|
|
20
|
+
slug: {
|
|
21
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
22
|
+
isOptional: false
|
|
23
|
+
},
|
|
24
|
+
description: {
|
|
25
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
26
|
+
isOptional: true
|
|
27
|
+
},
|
|
28
|
+
status: {
|
|
29
|
+
type: StoreStatusEnum,
|
|
30
|
+
isOptional: false
|
|
31
|
+
},
|
|
32
|
+
ownerId: {
|
|
33
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
34
|
+
isOptional: false
|
|
35
|
+
},
|
|
36
|
+
logoFileId: {
|
|
37
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
38
|
+
isOptional: true
|
|
39
|
+
},
|
|
40
|
+
isVerified: {
|
|
41
|
+
type: ScalarTypeEnum.Boolean(),
|
|
42
|
+
isOptional: false
|
|
43
|
+
},
|
|
44
|
+
totalProducts: {
|
|
45
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
46
|
+
isOptional: false
|
|
47
|
+
},
|
|
48
|
+
averageRating: {
|
|
49
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
50
|
+
isOptional: false
|
|
51
|
+
},
|
|
52
|
+
createdAt: {
|
|
53
|
+
type: ScalarTypeEnum.DateTime(),
|
|
54
|
+
isOptional: false
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Input for creating a store.
|
|
60
|
+
*/
|
|
61
|
+
const CreateStoreInputModel = defineSchemaModel({
|
|
62
|
+
name: "CreateStoreInput",
|
|
63
|
+
fields: {
|
|
64
|
+
name: {
|
|
65
|
+
type: ScalarTypeEnum.NonEmptyString(),
|
|
66
|
+
isOptional: false
|
|
67
|
+
},
|
|
68
|
+
slug: {
|
|
69
|
+
type: ScalarTypeEnum.NonEmptyString(),
|
|
70
|
+
isOptional: false
|
|
71
|
+
},
|
|
72
|
+
description: {
|
|
73
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
74
|
+
isOptional: true
|
|
75
|
+
},
|
|
76
|
+
email: {
|
|
77
|
+
type: ScalarTypeEnum.EmailAddress(),
|
|
78
|
+
isOptional: true
|
|
79
|
+
},
|
|
80
|
+
country: {
|
|
81
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
82
|
+
isOptional: true
|
|
83
|
+
},
|
|
84
|
+
currency: {
|
|
85
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
86
|
+
isOptional: true
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
//#endregion
|
|
92
|
+
export { CreateStoreInputModel, StoreModel };
|
|
93
|
+
//# sourceMappingURL=store.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.schema.js","names":[],"sources":["../../src/store/store.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport { StoreStatusEnum } from './store.enum';\n\n/**\n * A seller store.\n */\nexport const StoreModel = defineSchemaModel({\n name: 'StoreModel',\n description: 'A seller store',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n status: { type: StoreStatusEnum, isOptional: false },\n ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n logoFileId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isVerified: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n totalProducts: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n averageRating: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * Input for creating a store.\n */\nexport const CreateStoreInputModel = defineSchemaModel({\n name: 'CreateStoreInput',\n fields: {\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n slug: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: true },\n country: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n"],"mappings":";;;;;;;AAMA,MAAa,aAAa,kBAAkB;CAC1C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,QAAQ;GAAE,MAAM;GAAiB,YAAY;GAAO;EACpD,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACxE,YAAY;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAO;EACjE,eAAe;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACzE,eAAe;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EAC3E,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;;;;AAKF,MAAa,wBAAwB,kBAAkB;CACrD,MAAM;CACN,QAAQ;EACN,MAAM;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EAClE,MAAM;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EAClE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,OAAO;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAM;EAChE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACrE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACvE;CACF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as _contractspec_lib_contracts34 from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/tests/operations.test-spec.d.ts
|
|
4
|
+
declare const ProductListTest: _contractspec_lib_contracts34.TestSpec;
|
|
5
|
+
declare const OrderCreateTest: _contractspec_lib_contracts34.TestSpec;
|
|
6
|
+
declare const PayoutListTest: _contractspec_lib_contracts34.TestSpec;
|
|
7
|
+
declare const ReviewListTest: _contractspec_lib_contracts34.TestSpec;
|
|
8
|
+
declare const ReviewCreateTest: _contractspec_lib_contracts34.TestSpec;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { OrderCreateTest, PayoutListTest, ProductListTest, ReviewCreateTest, ReviewListTest };
|
|
11
|
+
//# sourceMappingURL=operations.test-spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.test-spec.d.ts","names":[],"sources":["../../src/tests/operations.test-spec.ts"],"sourcesContent":[],"mappings":";;;cAEa,iBAyBX,6BAAA,CAzB0B;cA2Bf,iBAyBX,6BAAA,CAzB0B;cA2Bf,gBAyBX,6BAAA,CAzByB;AAtDd,cAiFA,cAxDX,EAiFA,6BAAA,CAzByB,QAxDzB;AAEW,cAiFA,gBAxDX,EAiFA,6BAAA,CAzB2B,QAxD3B"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { defineTestSpec } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/tests/operations.test-spec.ts
|
|
4
|
+
const ProductListTest = defineTestSpec({
|
|
5
|
+
meta: {
|
|
6
|
+
key: "marketplace.product.list.test",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
stability: "experimental",
|
|
9
|
+
owners: ["@example.marketplace"],
|
|
10
|
+
description: "Test for listing products",
|
|
11
|
+
tags: ["test"]
|
|
12
|
+
},
|
|
13
|
+
target: {
|
|
14
|
+
type: "operation",
|
|
15
|
+
operation: {
|
|
16
|
+
key: "marketplace.product.list",
|
|
17
|
+
version: "1.0.0"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
scenarios: [{
|
|
21
|
+
key: "success",
|
|
22
|
+
when: { operation: { key: "marketplace.product.list" } },
|
|
23
|
+
then: [{
|
|
24
|
+
type: "expectOutput",
|
|
25
|
+
match: {}
|
|
26
|
+
}]
|
|
27
|
+
}, {
|
|
28
|
+
key: "error",
|
|
29
|
+
when: { operation: { key: "marketplace.product.list" } },
|
|
30
|
+
then: [{ type: "expectError" }]
|
|
31
|
+
}]
|
|
32
|
+
});
|
|
33
|
+
const OrderCreateTest = defineTestSpec({
|
|
34
|
+
meta: {
|
|
35
|
+
key: "marketplace.order.create.test",
|
|
36
|
+
version: "1.0.0",
|
|
37
|
+
stability: "experimental",
|
|
38
|
+
owners: ["@example.marketplace"],
|
|
39
|
+
description: "Test for creating order",
|
|
40
|
+
tags: ["test"]
|
|
41
|
+
},
|
|
42
|
+
target: {
|
|
43
|
+
type: "operation",
|
|
44
|
+
operation: {
|
|
45
|
+
key: "marketplace.order.create",
|
|
46
|
+
version: "1.0.0"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
scenarios: [{
|
|
50
|
+
key: "success",
|
|
51
|
+
when: { operation: { key: "marketplace.order.create" } },
|
|
52
|
+
then: [{
|
|
53
|
+
type: "expectOutput",
|
|
54
|
+
match: {}
|
|
55
|
+
}]
|
|
56
|
+
}, {
|
|
57
|
+
key: "error",
|
|
58
|
+
when: { operation: { key: "marketplace.order.create" } },
|
|
59
|
+
then: [{ type: "expectError" }]
|
|
60
|
+
}]
|
|
61
|
+
});
|
|
62
|
+
const PayoutListTest = defineTestSpec({
|
|
63
|
+
meta: {
|
|
64
|
+
key: "marketplace.payout.list.test",
|
|
65
|
+
version: "1.0.0",
|
|
66
|
+
stability: "experimental",
|
|
67
|
+
owners: ["@example.marketplace"],
|
|
68
|
+
description: "Test for listing payouts",
|
|
69
|
+
tags: ["test"]
|
|
70
|
+
},
|
|
71
|
+
target: {
|
|
72
|
+
type: "operation",
|
|
73
|
+
operation: {
|
|
74
|
+
key: "marketplace.payout.list",
|
|
75
|
+
version: "1.0.0"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
scenarios: [{
|
|
79
|
+
key: "success",
|
|
80
|
+
when: { operation: { key: "marketplace.payout.list" } },
|
|
81
|
+
then: [{
|
|
82
|
+
type: "expectOutput",
|
|
83
|
+
match: {}
|
|
84
|
+
}]
|
|
85
|
+
}, {
|
|
86
|
+
key: "error",
|
|
87
|
+
when: { operation: { key: "marketplace.payout.list" } },
|
|
88
|
+
then: [{ type: "expectError" }]
|
|
89
|
+
}]
|
|
90
|
+
});
|
|
91
|
+
const ReviewListTest = defineTestSpec({
|
|
92
|
+
meta: {
|
|
93
|
+
key: "marketplace.review.list.test",
|
|
94
|
+
version: "1.0.0",
|
|
95
|
+
stability: "experimental",
|
|
96
|
+
owners: ["@example.marketplace"],
|
|
97
|
+
description: "Test for listing reviews",
|
|
98
|
+
tags: ["test"]
|
|
99
|
+
},
|
|
100
|
+
target: {
|
|
101
|
+
type: "operation",
|
|
102
|
+
operation: {
|
|
103
|
+
key: "marketplace.review.list",
|
|
104
|
+
version: "1.0.0"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
scenarios: [{
|
|
108
|
+
key: "success",
|
|
109
|
+
when: { operation: { key: "marketplace.review.list" } },
|
|
110
|
+
then: [{
|
|
111
|
+
type: "expectOutput",
|
|
112
|
+
match: {}
|
|
113
|
+
}]
|
|
114
|
+
}, {
|
|
115
|
+
key: "error",
|
|
116
|
+
when: { operation: { key: "marketplace.review.list" } },
|
|
117
|
+
then: [{ type: "expectError" }]
|
|
118
|
+
}]
|
|
119
|
+
});
|
|
120
|
+
const ReviewCreateTest = defineTestSpec({
|
|
121
|
+
meta: {
|
|
122
|
+
key: "marketplace.review.create.test",
|
|
123
|
+
version: "1.0.0",
|
|
124
|
+
stability: "experimental",
|
|
125
|
+
owners: ["@example.marketplace"],
|
|
126
|
+
description: "Test for creating review",
|
|
127
|
+
tags: ["test"]
|
|
128
|
+
},
|
|
129
|
+
target: {
|
|
130
|
+
type: "operation",
|
|
131
|
+
operation: {
|
|
132
|
+
key: "marketplace.review.create",
|
|
133
|
+
version: "1.0.0"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
scenarios: [{
|
|
137
|
+
key: "success",
|
|
138
|
+
when: { operation: { key: "marketplace.review.create" } },
|
|
139
|
+
then: [{
|
|
140
|
+
type: "expectOutput",
|
|
141
|
+
match: {}
|
|
142
|
+
}]
|
|
143
|
+
}, {
|
|
144
|
+
key: "error",
|
|
145
|
+
when: { operation: { key: "marketplace.review.create" } },
|
|
146
|
+
then: [{ type: "expectError" }]
|
|
147
|
+
}]
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
//#endregion
|
|
151
|
+
export { OrderCreateTest, PayoutListTest, ProductListTest, ReviewCreateTest, ReviewListTest };
|
|
152
|
+
//# sourceMappingURL=operations.test-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.test-spec.js","names":[],"sources":["../../src/tests/operations.test-spec.ts"],"sourcesContent":["import { defineTestSpec } from '@contractspec/lib.contracts';\n\nexport const ProductListTest = defineTestSpec({\n meta: {\n key: 'marketplace.product.list.test',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@example.marketplace'],\n description: 'Test for listing products',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'marketplace.product.list', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'marketplace.product.list' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'marketplace.product.list' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n\nexport const OrderCreateTest = defineTestSpec({\n meta: {\n key: 'marketplace.order.create.test',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@example.marketplace'],\n description: 'Test for creating order',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'marketplace.order.create', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'marketplace.order.create' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'marketplace.order.create' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n\nexport const PayoutListTest = defineTestSpec({\n meta: {\n key: 'marketplace.payout.list.test',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@example.marketplace'],\n description: 'Test for listing payouts',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'marketplace.payout.list', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'marketplace.payout.list' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'marketplace.payout.list' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n\nexport const ReviewListTest = defineTestSpec({\n meta: {\n key: 'marketplace.review.list.test',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@example.marketplace'],\n description: 'Test for listing reviews',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'marketplace.review.list', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'marketplace.review.list' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'marketplace.review.list' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n\nexport const ReviewCreateTest = defineTestSpec({\n meta: {\n key: 'marketplace.review.create.test',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@example.marketplace'],\n description: 'Test for creating review',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'marketplace.review.create', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'marketplace.review.create' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'marketplace.review.create' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n"],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/ui/MarketplaceDashboard.d.ts
|
|
4
|
+
declare function MarketplaceDashboard(): react_jsx_runtime0.JSX.Element;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { MarketplaceDashboard };
|
|
7
|
+
//# sourceMappingURL=MarketplaceDashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarketplaceDashboard.d.ts","names":[],"sources":["../../src/ui/MarketplaceDashboard.tsx"],"sourcesContent":[],"mappings":";;;iBAiDgB,oBAAA,CAAA,GAAoB,kBAAA,CAAA,GAAA,CAAA"}
|