@lssm/example.marketplace 0.0.0-canary-20251217080011 → 1.41.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.
Files changed (205) hide show
  1. package/dist/docs/index.js +1 -1
  2. package/dist/docs/marketplace.docblock.js +5 -61
  3. package/dist/entities/index.js +1 -45
  4. package/dist/entities/order.js +1 -173
  5. package/dist/entities/payout.js +1 -162
  6. package/dist/entities/product.js +1 -161
  7. package/dist/entities/review.js +1 -152
  8. package/dist/entities/store.js +1 -110
  9. package/dist/example.js +1 -50
  10. package/dist/index.js +1 -27
  11. package/dist/marketplace.feature.js +1 -308
  12. package/dist/order/index.js +1 -6
  13. package/dist/order/order.contracts.js +1 -74
  14. package/dist/order/order.enum.js +1 -22
  15. package/dist/order/order.event.js +1 -193
  16. package/dist/order/order.presentation.js +1 -72
  17. package/dist/order/order.schema.js +1 -156
  18. package/dist/payout/index.js +1 -6
  19. package/dist/payout/payout.contracts.js +1 -32
  20. package/dist/payout/payout.enum.js +1 -17
  21. package/dist/payout/payout.event.js +1 -84
  22. package/dist/payout/payout.presentation.js +1 -50
  23. package/dist/payout/payout.schema.js +1 -117
  24. package/dist/product/index.js +1 -6
  25. package/dist/product/product.contracts.js +1 -65
  26. package/dist/product/product.enum.js +1 -18
  27. package/dist/product/product.event.js +1 -103
  28. package/dist/product/product.presentation.js +1 -72
  29. package/dist/product/product.schema.js +1 -177
  30. package/dist/review/index.js +1 -6
  31. package/dist/review/review.contracts.js +1 -65
  32. package/dist/review/review.enum.js +1 -16
  33. package/dist/review/review.event.js +1 -76
  34. package/dist/review/review.presentation.js +1 -50
  35. package/dist/review/review.schema.js +1 -157
  36. package/dist/store/index.js +1 -6
  37. package/dist/store/store.contracts.js +1 -41
  38. package/dist/store/store.enum.js +1 -16
  39. package/dist/store/store.event.js +1 -72
  40. package/dist/store/store.presentation.js +1 -50
  41. package/dist/store/store.schema.js +1 -94
  42. package/dist/tsconfig.tsbuildinfo +1 -0
  43. package/package.json +53 -54
  44. package/dist/docs/index.d.ts +0 -1
  45. package/dist/docs/marketplace.docblock.d.ts +0 -1
  46. package/dist/entities/index.d.ts +0 -308
  47. package/dist/entities/order.d.ts +0 -104
  48. package/dist/entities/payout.d.ts +0 -91
  49. package/dist/entities/product.d.ts +0 -92
  50. package/dist/entities/review.d.ts +0 -82
  51. package/dist/entities/store.d.ts +0 -59
  52. package/dist/example.d.ts +0 -39
  53. package/dist/index.d.ts +0 -21
  54. package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -88
  55. package/dist/libs/contracts/dist/client/index.js +0 -5
  56. package/dist/libs/contracts/dist/client/react/feature-render.js +0 -2
  57. package/dist/libs/contracts/dist/client/react/form-render.js +0 -4
  58. package/dist/libs/contracts/dist/client/react/index.js +0 -4
  59. package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
  60. package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -60
  61. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
  62. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
  63. package/dist/libs/contracts/dist/docs/index.js +0 -29
  64. package/dist/libs/contracts/dist/docs/presentations.js +0 -71
  65. package/dist/libs/contracts/dist/docs/registry.js +0 -44
  66. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
  67. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
  68. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
  69. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
  70. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
  71. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
  72. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
  73. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
  74. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
  75. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
  76. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
  77. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
  78. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
  79. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
  80. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
  81. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
  82. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
  83. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
  84. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
  85. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
  86. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
  87. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
  88. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
  89. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
  90. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
  91. package/dist/libs/contracts/dist/events.js +0 -10
  92. package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
  93. package/dist/libs/contracts/dist/index.js +0 -71
  94. package/dist/libs/contracts/dist/install.js +0 -2
  95. package/dist/libs/contracts/dist/integrations/contracts.js +0 -377
  96. package/dist/libs/contracts/dist/integrations/index.js +0 -18
  97. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
  98. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
  99. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
  100. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
  101. package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -242
  102. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -13
  103. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
  104. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
  105. package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
  106. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
  107. package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
  108. package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
  109. package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
  110. package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
  111. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
  112. package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
  113. package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
  114. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
  115. package/dist/libs/contracts/dist/jsonschema.js +0 -1
  116. package/dist/libs/contracts/dist/knowledge/contracts.js +0 -306
  117. package/dist/libs/contracts/dist/knowledge/index.js +0 -7
  118. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
  119. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
  120. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
  121. package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
  122. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
  123. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
  124. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
  125. package/dist/libs/contracts/dist/llm/exporters.js +0 -19
  126. package/dist/libs/contracts/dist/llm/index.js +0 -2
  127. package/dist/libs/contracts/dist/llm/prompts.js +0 -1
  128. package/dist/libs/contracts/dist/onboarding-base.js +0 -196
  129. package/dist/libs/contracts/dist/openapi.js +0 -1
  130. package/dist/libs/contracts/dist/ownership.js +0 -21
  131. package/dist/libs/contracts/dist/presentations.js +0 -1
  132. package/dist/libs/contracts/dist/presentations.v2.js +0 -11
  133. package/dist/libs/contracts/dist/prompt.js +0 -1
  134. package/dist/libs/contracts/dist/promptRegistry.js +0 -1
  135. package/dist/libs/contracts/dist/regenerator/index.js +0 -1
  136. package/dist/libs/contracts/dist/regenerator/service.js +0 -6
  137. package/dist/libs/contracts/dist/registry.js +0 -2
  138. package/dist/libs/contracts/dist/resources.js +0 -1
  139. package/dist/libs/contracts/dist/schema/dist/EnumType.js +0 -2
  140. package/dist/libs/contracts/dist/schema/dist/FieldType.js +0 -49
  141. package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
  142. package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +0 -34
  143. package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
  144. package/dist/libs/contracts/dist/schema/dist/entity/index.js +0 -2
  145. package/dist/libs/contracts/dist/schema/dist/entity/types.js +0 -1
  146. package/dist/libs/contracts/dist/schema/dist/index.js +0 -6
  147. package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
  148. package/dist/libs/contracts/dist/server/index.js +0 -8
  149. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
  150. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
  151. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
  152. package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
  153. package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
  154. package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
  155. package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
  156. package/dist/libs/contracts/dist/server/rest-express.js +0 -1
  157. package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
  158. package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
  159. package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
  160. package/dist/libs/contracts/dist/spec.js +0 -34
  161. package/dist/libs/contracts/dist/telemetry/index.js +0 -1
  162. package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
  163. package/dist/libs/contracts/dist/tests/index.js +0 -1
  164. package/dist/libs/contracts/dist/tests/runner.js +0 -2
  165. package/dist/libs/contracts/dist/workflow/index.js +0 -1
  166. package/dist/libs/contracts/dist/workflow/runner.js +0 -1
  167. package/dist/libs/schema/dist/EnumType.js +0 -56
  168. package/dist/libs/schema/dist/FieldType.js +0 -49
  169. package/dist/libs/schema/dist/ScalarTypeEnum.js +0 -236
  170. package/dist/libs/schema/dist/SchemaModel.js +0 -39
  171. package/dist/libs/schema/dist/entity/defineEntity.js +0 -236
  172. package/dist/libs/schema/dist/entity/index.js +0 -2
  173. package/dist/libs/schema/dist/entity/types.js +0 -1
  174. package/dist/libs/schema/dist/index.js +0 -6
  175. package/dist/marketplace.feature.d.ts +0 -11
  176. package/dist/order/index.d.ts +0 -5
  177. package/dist/order/order.contracts.d.ts +0 -367
  178. package/dist/order/order.enum.d.ts +0 -9
  179. package/dist/order/order.event.d.ts +0 -144
  180. package/dist/order/order.presentation.d.ts +0 -8
  181. package/dist/order/order.schema.d.ts +0 -164
  182. package/dist/payout/index.d.ts +0 -5
  183. package/dist/payout/payout.contracts.d.ts +0 -96
  184. package/dist/payout/payout.enum.d.ts +0 -9
  185. package/dist/payout/payout.event.d.ts +0 -62
  186. package/dist/payout/payout.presentation.d.ts +0 -7
  187. package/dist/payout/payout.schema.d.ts +0 -156
  188. package/dist/product/index.d.ts +0 -5
  189. package/dist/product/product.contracts.d.ts +0 -272
  190. package/dist/product/product.enum.d.ts +0 -9
  191. package/dist/product/product.event.d.ts +0 -72
  192. package/dist/product/product.presentation.d.ts +0 -8
  193. package/dist/product/product.schema.d.ts +0 -217
  194. package/dist/review/index.d.ts +0 -5
  195. package/dist/review/review.contracts.d.ts +0 -236
  196. package/dist/review/review.enum.d.ts +0 -9
  197. package/dist/review/review.event.d.ts +0 -54
  198. package/dist/review/review.presentation.d.ts +0 -7
  199. package/dist/review/review.schema.d.ts +0 -189
  200. package/dist/store/index.d.ts +0 -5
  201. package/dist/store/store.contracts.d.ts +0 -130
  202. package/dist/store/store.enum.d.ts +0 -9
  203. package/dist/store/store.event.d.ts +0 -50
  204. package/dist/store/store.presentation.d.ts +0 -7
  205. package/dist/store/store.schema.d.ts +0 -83
@@ -1,50 +1 @@
1
- import { PayoutModel } from "./payout.schema.js";
2
-
3
- //#region src/payout/payout.presentation.ts
4
- const PayoutListPresentation = {
5
- meta: {
6
- name: "marketplace.payout.list",
7
- version: 1,
8
- description: "List of payouts for sellers",
9
- domain: "marketplace",
10
- owners: ["@marketplace-team"],
11
- tags: [
12
- "marketplace",
13
- "payout",
14
- "list"
15
- ]
16
- },
17
- source: {
18
- type: "component",
19
- framework: "react",
20
- componentKey: "PayoutList",
21
- props: PayoutModel
22
- },
23
- targets: ["react", "markdown"],
24
- policy: { flags: ["marketplace.payouts.enabled"] }
25
- };
26
- const PayoutDetailPresentation = {
27
- meta: {
28
- name: "marketplace.payout.detail",
29
- version: 1,
30
- description: "Payout detail with breakdown",
31
- domain: "marketplace",
32
- owners: ["@marketplace-team"],
33
- tags: [
34
- "marketplace",
35
- "payout",
36
- "detail"
37
- ]
38
- },
39
- source: {
40
- type: "component",
41
- framework: "react",
42
- componentKey: "PayoutDetail",
43
- props: PayoutModel
44
- },
45
- targets: ["react", "markdown"],
46
- policy: { flags: ["marketplace.payouts.enabled"] }
47
- };
48
-
49
- //#endregion
50
- export { PayoutDetailPresentation, PayoutListPresentation };
1
+ import{PayoutModel as e}from"./payout.schema.js";const t={meta:{name:`marketplace.payout.list`,version:1,description:`List of payouts for sellers`,domain:`marketplace`,owners:[`@marketplace-team`],tags:[`marketplace`,`payout`,`list`]},source:{type:`component`,framework:`react`,componentKey:`PayoutList`,props:e},targets:[`react`,`markdown`],policy:{flags:[`marketplace.payouts.enabled`]}},n={meta:{name:`marketplace.payout.detail`,version:1,description:`Payout detail with breakdown`,domain:`marketplace`,owners:[`@marketplace-team`],tags:[`marketplace`,`payout`,`detail`]},source:{type:`component`,framework:`react`,componentKey:`PayoutDetail`,props:e},targets:[`react`,`markdown`],policy:{flags:[`marketplace.payouts.enabled`]}};export{n as PayoutDetailPresentation,t as PayoutListPresentation};
@@ -1,117 +1 @@
1
- import { ScalarTypeEnum } from "../libs/schema/dist/ScalarTypeEnum.js";
2
- import { defineSchemaModel } from "../libs/schema/dist/SchemaModel.js";
3
- import "../libs/schema/dist/index.js";
4
- import { PayoutStatusEnum } from "./payout.enum.js";
5
-
6
- //#region src/payout/payout.schema.ts
7
- /**
8
- * A payout to seller.
9
- */
10
- const PayoutModel = defineSchemaModel({
11
- name: "PayoutModel",
12
- description: "A payout to seller",
13
- fields: {
14
- id: {
15
- type: ScalarTypeEnum.String_unsecure(),
16
- isOptional: false
17
- },
18
- payoutNumber: {
19
- type: ScalarTypeEnum.String_unsecure(),
20
- isOptional: false
21
- },
22
- storeId: {
23
- type: ScalarTypeEnum.String_unsecure(),
24
- isOptional: false
25
- },
26
- status: {
27
- type: PayoutStatusEnum,
28
- isOptional: false
29
- },
30
- grossAmount: {
31
- type: ScalarTypeEnum.Float_unsecure(),
32
- isOptional: false
33
- },
34
- platformFees: {
35
- type: ScalarTypeEnum.Float_unsecure(),
36
- isOptional: false
37
- },
38
- netAmount: {
39
- type: ScalarTypeEnum.Float_unsecure(),
40
- isOptional: false
41
- },
42
- currency: {
43
- type: ScalarTypeEnum.String_unsecure(),
44
- isOptional: false
45
- },
46
- periodStart: {
47
- type: ScalarTypeEnum.DateTime(),
48
- isOptional: false
49
- },
50
- periodEnd: {
51
- type: ScalarTypeEnum.DateTime(),
52
- isOptional: false
53
- },
54
- orderCount: {
55
- type: ScalarTypeEnum.Int_unsecure(),
56
- isOptional: false
57
- },
58
- createdAt: {
59
- type: ScalarTypeEnum.DateTime(),
60
- isOptional: false
61
- },
62
- paidAt: {
63
- type: ScalarTypeEnum.DateTime(),
64
- isOptional: true
65
- }
66
- }
67
- });
68
- /**
69
- * Input for listing payouts.
70
- */
71
- const ListPayoutsInputModel = defineSchemaModel({
72
- name: "ListPayoutsInput",
73
- fields: {
74
- storeId: {
75
- type: ScalarTypeEnum.String_unsecure(),
76
- isOptional: false
77
- },
78
- status: {
79
- type: PayoutStatusEnum,
80
- isOptional: true
81
- },
82
- limit: {
83
- type: ScalarTypeEnum.Int_unsecure(),
84
- isOptional: true,
85
- defaultValue: 20
86
- },
87
- offset: {
88
- type: ScalarTypeEnum.Int_unsecure(),
89
- isOptional: true,
90
- defaultValue: 0
91
- }
92
- }
93
- });
94
- /**
95
- * Output for listing payouts.
96
- */
97
- const ListPayoutsOutputModel = defineSchemaModel({
98
- name: "ListPayoutsOutput",
99
- fields: {
100
- payouts: {
101
- type: PayoutModel,
102
- isArray: true,
103
- isOptional: false
104
- },
105
- total: {
106
- type: ScalarTypeEnum.Int_unsecure(),
107
- isOptional: false
108
- },
109
- totalPending: {
110
- type: ScalarTypeEnum.Float_unsecure(),
111
- isOptional: false
112
- }
113
- }
114
- });
115
-
116
- //#endregion
117
- export { ListPayoutsInputModel, ListPayoutsOutputModel, PayoutModel };
1
+ import{PayoutStatusEnum as e}from"./payout.enum.js";import{ScalarTypeEnum as t,defineSchemaModel as n}from"@lssm/lib.schema";const r=n({name:`PayoutModel`,description:`A payout to seller`,fields:{id:{type:t.String_unsecure(),isOptional:!1},payoutNumber:{type:t.String_unsecure(),isOptional:!1},storeId:{type:t.String_unsecure(),isOptional:!1},status:{type:e,isOptional:!1},grossAmount:{type:t.Float_unsecure(),isOptional:!1},platformFees:{type:t.Float_unsecure(),isOptional:!1},netAmount:{type:t.Float_unsecure(),isOptional:!1},currency:{type:t.String_unsecure(),isOptional:!1},periodStart:{type:t.DateTime(),isOptional:!1},periodEnd:{type:t.DateTime(),isOptional:!1},orderCount:{type:t.Int_unsecure(),isOptional:!1},createdAt:{type:t.DateTime(),isOptional:!1},paidAt:{type:t.DateTime(),isOptional:!0}}}),i=n({name:`ListPayoutsInput`,fields:{storeId:{type:t.String_unsecure(),isOptional:!1},status:{type:e,isOptional:!0},limit:{type:t.Int_unsecure(),isOptional:!0,defaultValue:20},offset:{type:t.Int_unsecure(),isOptional:!0,defaultValue:0}}}),a=n({name:`ListPayoutsOutput`,fields:{payouts:{type:r,isArray:!0,isOptional:!1},total:{type:t.Int_unsecure(),isOptional:!1},totalPending:{type:t.Float_unsecure(),isOptional:!1}}});export{i as ListPayoutsInputModel,a as ListPayoutsOutputModel,r as PayoutModel};
@@ -1,6 +1 @@
1
- import { ProductStatusEnum } from "./product.enum.js";
2
- import { CreateProductInputModel, ListProductsInputModel, ListProductsOutputModel, ProductModel } from "./product.schema.js";
3
- import { CreateProductContract, ListProductsContract } from "./product.contracts.js";
4
- import { InventoryUpdatedEvent, ProductCreatedEvent, ProductPublishedEvent } from "./product.event.js";
5
-
6
- export { CreateProductContract, CreateProductInputModel, InventoryUpdatedEvent, ListProductsContract, ListProductsInputModel, ListProductsOutputModel, ProductCreatedEvent, ProductModel, ProductPublishedEvent, ProductStatusEnum };
1
+ import{ProductStatusEnum as e}from"./product.enum.js";import{CreateProductInputModel as t,ListProductsInputModel as n,ListProductsOutputModel as r,ProductModel as i}from"./product.schema.js";import{CreateProductContract as a,ListProductsContract as o}from"./product.contracts.js";import{InventoryUpdatedEvent as s,ProductCreatedEvent as c,ProductPublishedEvent as l}from"./product.event.js";export{a as CreateProductContract,t as CreateProductInputModel,s as InventoryUpdatedEvent,o as ListProductsContract,n as ListProductsInputModel,r as ListProductsOutputModel,c as ProductCreatedEvent,i as ProductModel,l as ProductPublishedEvent,e as ProductStatusEnum};
@@ -1,65 +1 @@
1
- import { defineCommand, defineQuery } from "../libs/contracts/dist/spec.js";
2
- import { CreateProductInputModel, ListProductsInputModel, ListProductsOutputModel, ProductModel } from "./product.schema.js";
3
-
4
- //#region src/product/product.contracts.ts
5
- const OWNERS = ["@example.marketplace"];
6
- /**
7
- * Create a new product listing.
8
- */
9
- const CreateProductContract = defineCommand({
10
- meta: {
11
- name: "marketplace.product.create",
12
- version: 1,
13
- stability: "stable",
14
- owners: [...OWNERS],
15
- tags: [
16
- "marketplace",
17
- "product",
18
- "create"
19
- ],
20
- description: "Create a new product listing.",
21
- goal: "Allow sellers to list products.",
22
- context: "Product management."
23
- },
24
- io: {
25
- input: CreateProductInputModel,
26
- output: ProductModel
27
- },
28
- policy: { auth: "user" },
29
- sideEffects: {
30
- emits: [{
31
- name: "marketplace.product.created",
32
- version: 1,
33
- when: "Product is created",
34
- payload: ProductModel
35
- }],
36
- audit: ["marketplace.product.created"]
37
- }
38
- });
39
- /**
40
- * List products with filters.
41
- */
42
- const ListProductsContract = defineQuery({
43
- meta: {
44
- name: "marketplace.product.list",
45
- version: 1,
46
- stability: "stable",
47
- owners: [...OWNERS],
48
- tags: [
49
- "marketplace",
50
- "product",
51
- "list"
52
- ],
53
- description: "List products with filters.",
54
- goal: "Browse products on the marketplace.",
55
- context: "Product catalog, search."
56
- },
57
- io: {
58
- input: ListProductsInputModel,
59
- output: ListProductsOutputModel
60
- },
61
- policy: { auth: "anonymous" }
62
- });
63
-
64
- //#endregion
65
- export { CreateProductContract, ListProductsContract };
1
+ import{CreateProductInputModel as e,ListProductsInputModel as t,ListProductsOutputModel as n,ProductModel as r}from"./product.schema.js";import{defineCommand as i,defineQuery as a}from"@lssm/lib.contracts/spec";const o=[`@example.marketplace`],s=i({meta:{name:`marketplace.product.create`,version:1,stability:`stable`,owners:[...o],tags:[`marketplace`,`product`,`create`],description:`Create a new product listing.`,goal:`Allow sellers to list products.`,context:`Product management.`},io:{input:e,output:r},policy:{auth:`user`},sideEffects:{emits:[{name:`marketplace.product.created`,version:1,when:`Product is created`,payload:r}],audit:[`marketplace.product.created`]}}),c=a({meta:{name:`marketplace.product.list`,version:1,stability:`stable`,owners:[...o],tags:[`marketplace`,`product`,`list`],description:`List products with filters.`,goal:`Browse products on the marketplace.`,context:`Product catalog, search.`},io:{input:t,output:n},policy:{auth:`anonymous`}});export{s as CreateProductContract,c as ListProductsContract};
@@ -1,18 +1 @@
1
- import { defineEnum } from "../libs/schema/dist/EnumType.js";
2
- import "../libs/schema/dist/index.js";
3
-
4
- //#region src/product/product.enum.ts
5
- /**
6
- * Product status enum.
7
- */
8
- const ProductStatusEnum = defineEnum("ProductStatus", [
9
- "DRAFT",
10
- "PENDING_REVIEW",
11
- "ACTIVE",
12
- "OUT_OF_STOCK",
13
- "DISCONTINUED",
14
- "REJECTED"
15
- ]);
16
-
17
- //#endregion
18
- export { ProductStatusEnum };
1
+ import{defineEnum as e}from"@lssm/lib.schema";const t=e(`ProductStatus`,[`DRAFT`,`PENDING_REVIEW`,`ACTIVE`,`OUT_OF_STOCK`,`DISCONTINUED`,`REJECTED`]);export{t as ProductStatusEnum};
@@ -1,103 +1 @@
1
- import { ScalarTypeEnum } from "../libs/schema/dist/ScalarTypeEnum.js";
2
- import { defineSchemaModel } from "../libs/schema/dist/SchemaModel.js";
3
- import "../libs/schema/dist/index.js";
4
- import { defineEvent } from "../libs/contracts/dist/events.js";
5
- import "../libs/contracts/dist/index.js";
6
-
7
- //#region src/product/product.event.ts
8
- const ProductCreatedPayload = defineSchemaModel({
9
- name: "ProductCreatedEventPayload",
10
- fields: {
11
- productId: {
12
- type: ScalarTypeEnum.String_unsecure(),
13
- isOptional: false
14
- },
15
- storeId: {
16
- type: ScalarTypeEnum.String_unsecure(),
17
- isOptional: false
18
- },
19
- name: {
20
- type: ScalarTypeEnum.String_unsecure(),
21
- isOptional: false
22
- },
23
- price: {
24
- type: ScalarTypeEnum.Float_unsecure(),
25
- isOptional: false
26
- },
27
- currency: {
28
- type: ScalarTypeEnum.String_unsecure(),
29
- isOptional: false
30
- },
31
- timestamp: {
32
- type: ScalarTypeEnum.DateTime(),
33
- isOptional: false
34
- }
35
- }
36
- });
37
- const ProductPublishedPayload = defineSchemaModel({
38
- name: "ProductPublishedEventPayload",
39
- fields: {
40
- productId: {
41
- type: ScalarTypeEnum.String_unsecure(),
42
- isOptional: false
43
- },
44
- storeId: {
45
- type: ScalarTypeEnum.String_unsecure(),
46
- isOptional: false
47
- },
48
- timestamp: {
49
- type: ScalarTypeEnum.DateTime(),
50
- isOptional: false
51
- }
52
- }
53
- });
54
- const InventoryUpdatedPayload = defineSchemaModel({
55
- name: "InventoryUpdatedEventPayload",
56
- fields: {
57
- productId: {
58
- type: ScalarTypeEnum.String_unsecure(),
59
- isOptional: false
60
- },
61
- variantId: {
62
- type: ScalarTypeEnum.String_unsecure(),
63
- isOptional: true
64
- },
65
- previousQuantity: {
66
- type: ScalarTypeEnum.Int_unsecure(),
67
- isOptional: false
68
- },
69
- newQuantity: {
70
- type: ScalarTypeEnum.Int_unsecure(),
71
- isOptional: false
72
- },
73
- reason: {
74
- type: ScalarTypeEnum.String_unsecure(),
75
- isOptional: false
76
- },
77
- timestamp: {
78
- type: ScalarTypeEnum.DateTime(),
79
- isOptional: false
80
- }
81
- }
82
- });
83
- const ProductCreatedEvent = defineEvent({
84
- name: "marketplace.product.created",
85
- version: 1,
86
- description: "A new product has been created.",
87
- payload: ProductCreatedPayload
88
- });
89
- const ProductPublishedEvent = defineEvent({
90
- name: "marketplace.product.published",
91
- version: 1,
92
- description: "A product has been published.",
93
- payload: ProductPublishedPayload
94
- });
95
- const InventoryUpdatedEvent = defineEvent({
96
- name: "marketplace.inventory.updated",
97
- version: 1,
98
- description: "Product inventory has been updated.",
99
- payload: InventoryUpdatedPayload
100
- });
101
-
102
- //#endregion
103
- export { InventoryUpdatedEvent, ProductCreatedEvent, ProductPublishedEvent };
1
+ import{ScalarTypeEnum as e,defineSchemaModel as t}from"@lssm/lib.schema";import{defineEvent as n}from"@lssm/lib.contracts";const r=t({name:`ProductCreatedEventPayload`,fields:{productId:{type:e.String_unsecure(),isOptional:!1},storeId:{type:e.String_unsecure(),isOptional:!1},name:{type:e.String_unsecure(),isOptional:!1},price:{type:e.Float_unsecure(),isOptional:!1},currency:{type:e.String_unsecure(),isOptional:!1},timestamp:{type:e.DateTime(),isOptional:!1}}}),i=t({name:`ProductPublishedEventPayload`,fields:{productId:{type:e.String_unsecure(),isOptional:!1},storeId:{type:e.String_unsecure(),isOptional:!1},timestamp:{type:e.DateTime(),isOptional:!1}}}),a=t({name:`InventoryUpdatedEventPayload`,fields:{productId:{type:e.String_unsecure(),isOptional:!1},variantId:{type:e.String_unsecure(),isOptional:!0},previousQuantity:{type:e.Int_unsecure(),isOptional:!1},newQuantity:{type:e.Int_unsecure(),isOptional:!1},reason:{type:e.String_unsecure(),isOptional:!1},timestamp:{type:e.DateTime(),isOptional:!1}}}),o=n({name:`marketplace.product.created`,version:1,description:`A new product has been created.`,payload:r}),s=n({name:`marketplace.product.published`,version:1,description:`A product has been published.`,payload:i}),c=n({name:`marketplace.inventory.updated`,version:1,description:`Product inventory has been updated.`,payload:a});export{c as InventoryUpdatedEvent,o as ProductCreatedEvent,s as ProductPublishedEvent};
@@ -1,72 +1 @@
1
- import { ProductModel } from "./product.schema.js";
2
-
3
- //#region src/product/product.presentation.ts
4
- const ProductCatalogPresentation = {
5
- meta: {
6
- name: "marketplace.product.catalog",
7
- version: 1,
8
- description: "Product catalog with search and filters",
9
- domain: "marketplace",
10
- owners: ["@marketplace-team"],
11
- tags: [
12
- "marketplace",
13
- "product",
14
- "catalog"
15
- ]
16
- },
17
- source: {
18
- type: "component",
19
- framework: "react",
20
- componentKey: "ProductCatalog",
21
- props: ProductModel
22
- },
23
- targets: ["react", "markdown"],
24
- policy: { flags: ["marketplace.products.enabled"] }
25
- };
26
- const ProductDetailPresentation = {
27
- meta: {
28
- name: "marketplace.product.detail",
29
- version: 1,
30
- description: "Product detail page with images and reviews",
31
- domain: "marketplace",
32
- owners: ["@marketplace-team"],
33
- tags: [
34
- "marketplace",
35
- "product",
36
- "detail"
37
- ]
38
- },
39
- source: {
40
- type: "component",
41
- framework: "react",
42
- componentKey: "ProductDetail",
43
- props: ProductModel
44
- },
45
- targets: ["react", "markdown"],
46
- policy: { flags: ["marketplace.products.enabled"] }
47
- };
48
- const ProductEditorPresentation = {
49
- meta: {
50
- name: "marketplace.product.editor",
51
- version: 1,
52
- description: "Product editor for sellers",
53
- domain: "marketplace",
54
- owners: ["@marketplace-team"],
55
- tags: [
56
- "marketplace",
57
- "product",
58
- "editor"
59
- ]
60
- },
61
- source: {
62
- type: "component",
63
- framework: "react",
64
- componentKey: "ProductEditor",
65
- props: ProductModel
66
- },
67
- targets: ["react"],
68
- policy: { flags: ["marketplace.seller.enabled"] }
69
- };
70
-
71
- //#endregion
72
- export { ProductCatalogPresentation, ProductDetailPresentation, ProductEditorPresentation };
1
+ import{ProductModel as e}from"./product.schema.js";const t={meta:{name:`marketplace.product.catalog`,version:1,description:`Product catalog with search and filters`,domain:`marketplace`,owners:[`@marketplace-team`],tags:[`marketplace`,`product`,`catalog`]},source:{type:`component`,framework:`react`,componentKey:`ProductCatalog`,props:e},targets:[`react`,`markdown`],policy:{flags:[`marketplace.products.enabled`]}},n={meta:{name:`marketplace.product.detail`,version:1,description:`Product detail page with images and reviews`,domain:`marketplace`,owners:[`@marketplace-team`],tags:[`marketplace`,`product`,`detail`]},source:{type:`component`,framework:`react`,componentKey:`ProductDetail`,props:e},targets:[`react`,`markdown`],policy:{flags:[`marketplace.products.enabled`]}},r={meta:{name:`marketplace.product.editor`,version:1,description:`Product editor for sellers`,domain:`marketplace`,owners:[`@marketplace-team`],tags:[`marketplace`,`product`,`editor`]},source:{type:`component`,framework:`react`,componentKey:`ProductEditor`,props:e},targets:[`react`],policy:{flags:[`marketplace.seller.enabled`]}};export{t as ProductCatalogPresentation,n as ProductDetailPresentation,r as ProductEditorPresentation};
@@ -1,177 +1 @@
1
- import { ScalarTypeEnum } from "../libs/schema/dist/ScalarTypeEnum.js";
2
- import { defineSchemaModel } from "../libs/schema/dist/SchemaModel.js";
3
- import "../libs/schema/dist/index.js";
4
- import { ProductStatusEnum } from "./product.enum.js";
5
-
6
- //#region src/product/product.schema.ts
7
- /**
8
- * A product listing.
9
- */
10
- const ProductModel = defineSchemaModel({
11
- name: "ProductModel",
12
- description: "A product listing",
13
- fields: {
14
- id: {
15
- type: ScalarTypeEnum.String_unsecure(),
16
- isOptional: false
17
- },
18
- storeId: {
19
- type: ScalarTypeEnum.String_unsecure(),
20
- isOptional: false
21
- },
22
- name: {
23
- type: ScalarTypeEnum.String_unsecure(),
24
- isOptional: false
25
- },
26
- slug: {
27
- type: ScalarTypeEnum.String_unsecure(),
28
- isOptional: false
29
- },
30
- description: {
31
- type: ScalarTypeEnum.String_unsecure(),
32
- isOptional: true
33
- },
34
- status: {
35
- type: ProductStatusEnum,
36
- isOptional: false
37
- },
38
- price: {
39
- type: ScalarTypeEnum.Float_unsecure(),
40
- isOptional: false
41
- },
42
- currency: {
43
- type: ScalarTypeEnum.String_unsecure(),
44
- isOptional: false
45
- },
46
- quantity: {
47
- type: ScalarTypeEnum.Int_unsecure(),
48
- isOptional: false
49
- },
50
- categoryId: {
51
- type: ScalarTypeEnum.String_unsecure(),
52
- isOptional: true
53
- },
54
- primaryImageId: {
55
- type: ScalarTypeEnum.String_unsecure(),
56
- isOptional: true
57
- },
58
- averageRating: {
59
- type: ScalarTypeEnum.Float_unsecure(),
60
- isOptional: false
61
- },
62
- totalSold: {
63
- type: ScalarTypeEnum.Int_unsecure(),
64
- isOptional: false
65
- },
66
- createdAt: {
67
- type: ScalarTypeEnum.DateTime(),
68
- isOptional: false
69
- }
70
- }
71
- });
72
- /**
73
- * Input for creating a product.
74
- */
75
- const CreateProductInputModel = defineSchemaModel({
76
- name: "CreateProductInput",
77
- fields: {
78
- storeId: {
79
- type: ScalarTypeEnum.String_unsecure(),
80
- isOptional: false
81
- },
82
- name: {
83
- type: ScalarTypeEnum.NonEmptyString(),
84
- isOptional: false
85
- },
86
- slug: {
87
- type: ScalarTypeEnum.NonEmptyString(),
88
- isOptional: false
89
- },
90
- description: {
91
- type: ScalarTypeEnum.String_unsecure(),
92
- isOptional: true
93
- },
94
- price: {
95
- type: ScalarTypeEnum.Float_unsecure(),
96
- isOptional: false
97
- },
98
- currency: {
99
- type: ScalarTypeEnum.String_unsecure(),
100
- isOptional: true
101
- },
102
- quantity: {
103
- type: ScalarTypeEnum.Int_unsecure(),
104
- isOptional: true
105
- },
106
- categoryId: {
107
- type: ScalarTypeEnum.String_unsecure(),
108
- isOptional: true
109
- },
110
- sku: {
111
- type: ScalarTypeEnum.String_unsecure(),
112
- isOptional: true
113
- }
114
- }
115
- });
116
- /**
117
- * Input for listing products.
118
- */
119
- const ListProductsInputModel = defineSchemaModel({
120
- name: "ListProductsInput",
121
- fields: {
122
- storeId: {
123
- type: ScalarTypeEnum.String_unsecure(),
124
- isOptional: true
125
- },
126
- categoryId: {
127
- type: ScalarTypeEnum.String_unsecure(),
128
- isOptional: true
129
- },
130
- status: {
131
- type: ProductStatusEnum,
132
- isOptional: true
133
- },
134
- search: {
135
- type: ScalarTypeEnum.String_unsecure(),
136
- isOptional: true
137
- },
138
- minPrice: {
139
- type: ScalarTypeEnum.Float_unsecure(),
140
- isOptional: true
141
- },
142
- maxPrice: {
143
- type: ScalarTypeEnum.Float_unsecure(),
144
- isOptional: true
145
- },
146
- limit: {
147
- type: ScalarTypeEnum.Int_unsecure(),
148
- isOptional: true,
149
- defaultValue: 20
150
- },
151
- offset: {
152
- type: ScalarTypeEnum.Int_unsecure(),
153
- isOptional: true,
154
- defaultValue: 0
155
- }
156
- }
157
- });
158
- /**
159
- * Output for listing products.
160
- */
161
- const ListProductsOutputModel = defineSchemaModel({
162
- name: "ListProductsOutput",
163
- fields: {
164
- products: {
165
- type: ProductModel,
166
- isArray: true,
167
- isOptional: false
168
- },
169
- total: {
170
- type: ScalarTypeEnum.Int_unsecure(),
171
- isOptional: false
172
- }
173
- }
174
- });
175
-
176
- //#endregion
177
- export { CreateProductInputModel, ListProductsInputModel, ListProductsOutputModel, ProductModel };
1
+ import{ProductStatusEnum as e}from"./product.enum.js";import{ScalarTypeEnum as t,defineSchemaModel as n}from"@lssm/lib.schema";const r=n({name:`ProductModel`,description:`A product listing`,fields:{id:{type:t.String_unsecure(),isOptional:!1},storeId:{type:t.String_unsecure(),isOptional:!1},name:{type:t.String_unsecure(),isOptional:!1},slug:{type:t.String_unsecure(),isOptional:!1},description:{type:t.String_unsecure(),isOptional:!0},status:{type:e,isOptional:!1},price:{type:t.Float_unsecure(),isOptional:!1},currency:{type:t.String_unsecure(),isOptional:!1},quantity:{type:t.Int_unsecure(),isOptional:!1},categoryId:{type:t.String_unsecure(),isOptional:!0},primaryImageId:{type:t.String_unsecure(),isOptional:!0},averageRating:{type:t.Float_unsecure(),isOptional:!1},totalSold:{type:t.Int_unsecure(),isOptional:!1},createdAt:{type:t.DateTime(),isOptional:!1}}}),i=n({name:`CreateProductInput`,fields:{storeId:{type:t.String_unsecure(),isOptional:!1},name:{type:t.NonEmptyString(),isOptional:!1},slug:{type:t.NonEmptyString(),isOptional:!1},description:{type:t.String_unsecure(),isOptional:!0},price:{type:t.Float_unsecure(),isOptional:!1},currency:{type:t.String_unsecure(),isOptional:!0},quantity:{type:t.Int_unsecure(),isOptional:!0},categoryId:{type:t.String_unsecure(),isOptional:!0},sku:{type:t.String_unsecure(),isOptional:!0}}}),a=n({name:`ListProductsInput`,fields:{storeId:{type:t.String_unsecure(),isOptional:!0},categoryId:{type:t.String_unsecure(),isOptional:!0},status:{type:e,isOptional:!0},search:{type:t.String_unsecure(),isOptional:!0},minPrice:{type:t.Float_unsecure(),isOptional:!0},maxPrice:{type:t.Float_unsecure(),isOptional:!0},limit:{type:t.Int_unsecure(),isOptional:!0,defaultValue:20},offset:{type:t.Int_unsecure(),isOptional:!0,defaultValue:0}}}),o=n({name:`ListProductsOutput`,fields:{products:{type:r,isArray:!0,isOptional:!1},total:{type:t.Int_unsecure(),isOptional:!1}}});export{i as CreateProductInputModel,a as ListProductsInputModel,o as ListProductsOutputModel,r as ProductModel};
@@ -1,6 +1 @@
1
- import { ReviewStatusEnum } from "./review.enum.js";
2
- import { CreateReviewInputModel, ListReviewsInputModel, ListReviewsOutputModel, ReviewModel } from "./review.schema.js";
3
- import { CreateReviewContract, ListReviewsContract } from "./review.contracts.js";
4
- import { ReviewCreatedEvent, ReviewRespondedEvent } from "./review.event.js";
5
-
6
- export { CreateReviewContract, CreateReviewInputModel, ListReviewsContract, ListReviewsInputModel, ListReviewsOutputModel, ReviewCreatedEvent, ReviewModel, ReviewRespondedEvent, ReviewStatusEnum };
1
+ import{ReviewStatusEnum as e}from"./review.enum.js";import{CreateReviewInputModel as t,ListReviewsInputModel as n,ListReviewsOutputModel as r,ReviewModel as i}from"./review.schema.js";import{CreateReviewContract as a,ListReviewsContract as o}from"./review.contracts.js";import{ReviewCreatedEvent as s,ReviewRespondedEvent as c}from"./review.event.js";export{a as CreateReviewContract,t as CreateReviewInputModel,o as ListReviewsContract,n as ListReviewsInputModel,r as ListReviewsOutputModel,s as ReviewCreatedEvent,i as ReviewModel,c as ReviewRespondedEvent,e as ReviewStatusEnum};