@porulle/plugin-marketplace 0.64.0 → 0.65.1

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 (57) hide show
  1. package/README.md +11 -59
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +3 -11
  4. package/dist/routes/b2b.d.ts +1 -3
  5. package/dist/routes/b2b.d.ts.map +1 -1
  6. package/dist/routes/b2b.js +2 -70
  7. package/dist/routes/sub-orders.js +3 -3
  8. package/dist/routes/vendor-portal.js +6 -6
  9. package/dist/schema.d.ts +0 -194
  10. package/dist/schema.d.ts.map +1 -1
  11. package/dist/schema.js +0 -14
  12. package/dist/schemas/b2b.d.ts +0 -986
  13. package/dist/schemas/b2b.d.ts.map +1 -1
  14. package/dist/schemas/b2b.js +1 -184
  15. package/dist/schemas/commission.d.ts +0 -495
  16. package/dist/schemas/commission.d.ts.map +1 -1
  17. package/dist/schemas/commission.js +1 -78
  18. package/dist/schemas/disputes-returns-reviews.d.ts +0 -1354
  19. package/dist/schemas/disputes-returns-reviews.d.ts.map +1 -1
  20. package/dist/schemas/disputes-returns-reviews.js +1 -208
  21. package/dist/schemas/sub-orders.d.ts +0 -290
  22. package/dist/schemas/sub-orders.d.ts.map +1 -1
  23. package/dist/schemas/sub-orders.js +1 -59
  24. package/dist/schemas/vendor-portal.d.ts +0 -1755
  25. package/dist/schemas/vendor-portal.d.ts.map +1 -1
  26. package/dist/schemas/vendor-portal.js +1 -247
  27. package/dist/schemas/vendors.d.ts +0 -1321
  28. package/dist/schemas/vendors.d.ts.map +1 -1
  29. package/dist/schemas/vendors.js +1 -205
  30. package/dist/services/sub-order.d.ts +1 -31
  31. package/dist/services/sub-order.d.ts.map +1 -1
  32. package/dist/services/sub-order.js +14 -22
  33. package/dist/types.d.ts +0 -17
  34. package/dist/types.d.ts.map +1 -1
  35. package/dist/types.js +0 -4
  36. package/package.json +13 -11
  37. package/src/index.ts +3 -11
  38. package/src/routes/b2b.ts +1 -76
  39. package/src/routes/sub-orders.ts +3 -3
  40. package/src/routes/vendor-portal.ts +6 -6
  41. package/src/schema.ts +0 -16
  42. package/src/schemas/b2b.ts +1 -208
  43. package/src/schemas/commission.ts +1 -86
  44. package/src/schemas/disputes-returns-reviews.ts +1 -225
  45. package/src/schemas/sub-orders.ts +1 -65
  46. package/src/schemas/vendor-portal.ts +1 -269
  47. package/src/schemas/vendors.ts +1 -222
  48. package/src/services/sub-order.ts +16 -18
  49. package/src/types.ts +0 -28
  50. package/dist/schemas/payouts.d.ts +0 -375
  51. package/dist/schemas/payouts.d.ts.map +0 -1
  52. package/dist/schemas/payouts.js +0 -78
  53. package/dist/services/contract-price.d.ts +0 -64
  54. package/dist/services/contract-price.d.ts.map +0 -1
  55. package/dist/services/contract-price.js +0 -57
  56. package/src/schemas/payouts.ts +0 -90
  57. package/src/services/contract-price.ts +0 -80
@@ -1 +1 @@
1
- {"version":3,"file":"b2b.d.ts","sourceRoot":"","sources":["../../src/schemas/b2b.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAe,MAAM,mBAAmB,CAAC;AAyBnD,eAAO,MAAM,mBAAmB;;;;;;;;;;iBAUF,CAAC;AAE/B,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYzB,CAAC;AAIH,eAAO,MAAM,oBAAoB;;;;;;iBAMF,CAAC;AAEhC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAa1B,CAAC;AAIH,eAAO,MAAM,kBAAkB;;iBAEF,CAAC;AAE9B,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,"file":"b2b.d.ts","sourceRoot":"","sources":["../../src/schemas/b2b.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAItC,eAAO,MAAM,mBAAmB;;;;;;;;;;iBAUF,CAAC;AAI/B,eAAO,MAAM,oBAAoB;;;;;;iBAMF,CAAC;AAIhC,eAAO,MAAM,kBAAkB;;iBAEF,CAAC"}
@@ -1,21 +1,4 @@
1
- import { z, createRoute } from "@hono/zod-openapi";
2
- const ErrorSchema = z.object({
3
- error: z.object({
4
- code: z.string(),
5
- message: z.string(),
6
- }),
7
- });
8
- const errorResponses = {
9
- 401: { content: { "application/json": { schema: ErrorSchema } }, description: "Authentication required." },
10
- 403: { content: { "application/json": { schema: ErrorSchema } }, description: "Insufficient permissions." },
11
- 404: { content: { "application/json": { schema: ErrorSchema } }, description: "Not found." },
12
- 422: { content: { "application/json": { schema: ErrorSchema } }, description: "Validation error." },
13
- 500: { content: { "application/json": { schema: ErrorSchema } }, description: "Server error." },
14
- };
15
- const DataResponseSchema = z.object({ data: z.any() });
16
- // ═══════════════════════════════════════════════════════════════════════════════
17
- // RFQ (Request for Quote)
18
- // ═══════════════════════════════════════════════════════════════════════════════
1
+ import { z } from "@hono/zod-openapi";
19
2
  // ─── Create RFQ ─────────────────────────────────────────────────────────────
20
3
  export const CreateRFQBodySchema = z.object({
21
4
  title: z.string().min(1).openapi({ example: "Bulk order: 500 widgets" }),
@@ -28,19 +11,6 @@ export const CreateRFQBodySchema = z.object({
28
11
  deadlineAt: z.string().optional().openapi({ example: "2026-04-01T00:00:00Z", description: "ISO 8601 date string" }),
29
12
  metadata: z.record(z.string(), z.unknown()).optional(),
30
13
  }).openapi("CreateRFQRequest");
31
- export const createRFQRoute = createRoute({
32
- method: "post",
33
- path: "/api/marketplace/rfq",
34
- tags: ["Marketplace - B2B"],
35
- summary: "Create a Request for Quote",
36
- request: {
37
- body: { content: { "application/json": { schema: CreateRFQBodySchema } }, required: true },
38
- },
39
- responses: {
40
- 201: { content: { "application/json": { schema: DataResponseSchema } }, description: "RFQ created." },
41
- ...errorResponses,
42
- },
43
- });
44
14
  // ─── Respond to RFQ ─────────────────────────────────────────────────────────
45
15
  export const RespondRFQBodySchema = z.object({
46
16
  vendorId: z.string().min(1).openapi({ example: "vendor_abc" }),
@@ -49,160 +19,7 @@ export const RespondRFQBodySchema = z.object({
49
19
  leadTimeDays: z.number().int().optional().openapi({ example: 14 }),
50
20
  notes: z.string().optional(),
51
21
  }).openapi("RespondRFQRequest");
52
- export const respondRFQRoute = createRoute({
53
- method: "post",
54
- path: "/api/marketplace/rfq/{id}/respond",
55
- tags: ["Marketplace - B2B"],
56
- summary: "Submit a vendor response to an RFQ",
57
- request: {
58
- params: z.object({ id: z.string() }),
59
- body: { content: { "application/json": { schema: RespondRFQBodySchema } }, required: true },
60
- },
61
- responses: {
62
- 201: { content: { "application/json": { schema: DataResponseSchema } }, description: "RFQ response submitted." },
63
- ...errorResponses,
64
- },
65
- });
66
22
  // ─── Award RFQ ──────────────────────────────────────────────────────────────
67
23
  export const AwardRFQBodySchema = z.object({
68
24
  vendorId: z.string().min(1).openapi({ example: "vendor_abc" }),
69
25
  }).openapi("AwardRFQRequest");
70
- export const awardRFQRoute = createRoute({
71
- method: "post",
72
- path: "/api/marketplace/rfq/{id}/award",
73
- tags: ["Marketplace - B2B"],
74
- summary: "Award an RFQ to a vendor",
75
- request: {
76
- params: z.object({ id: z.string() }),
77
- body: { content: { "application/json": { schema: AwardRFQBodySchema } }, required: true },
78
- },
79
- responses: {
80
- 200: { content: { "application/json": { schema: DataResponseSchema } }, description: "RFQ awarded." },
81
- ...errorResponses,
82
- },
83
- });
84
- // ═══════════════════════════════════════════════════════════════════════════════
85
- // CONTRACT PRICES
86
- // ═══════════════════════════════════════════════════════════════════════════════
87
- // ─── Create Contract Price ──────────────────────────────────────────────────
88
- export const CreateContractPriceBodySchema = z.object({
89
- vendorId: z.string().min(1).openapi({ example: "vendor_abc" }),
90
- buyerId: z.string().min(1).openapi({ example: "buyer_xyz" }),
91
- entityId: z.string().min(1).openapi({ example: "product_001" }),
92
- variantId: z.string().optional(),
93
- priceCents: z.number().int().openapi({ example: 7500 }),
94
- minQuantity: z.number().int().optional().openapi({ example: 100 }),
95
- currency: z.string().optional().openapi({ example: "USD" }),
96
- validFrom: z.string().optional().openapi({ example: "2026-01-01T00:00:00Z", description: "ISO 8601 date string" }),
97
- validUntil: z.string().optional().openapi({ example: "2026-12-31T23:59:59Z", description: "ISO 8601 date string" }),
98
- }).openapi("CreateContractPriceRequest");
99
- export const createContractPriceRoute = createRoute({
100
- method: "post",
101
- path: "/api/marketplace/contract-prices",
102
- tags: ["Marketplace - B2B"],
103
- summary: "Create a contract price",
104
- request: {
105
- body: { content: { "application/json": { schema: CreateContractPriceBodySchema } }, required: true },
106
- },
107
- responses: {
108
- 201: { content: { "application/json": { schema: DataResponseSchema } }, description: "Contract price created." },
109
- ...errorResponses,
110
- },
111
- });
112
- // ─── Update Contract Price ──────────────────────────────────────────────────
113
- export const UpdateContractPriceBodySchema = z.object({
114
- priceCents: z.number().int().optional().openapi({ example: 7000 }),
115
- minQuantity: z.number().int().optional(),
116
- validFrom: z.string().nullable().optional().openapi({ description: "ISO 8601 date string or null to clear" }),
117
- validUntil: z.string().nullable().optional().openapi({ description: "ISO 8601 date string or null to clear" }),
118
- }).openapi("UpdateContractPriceRequest");
119
- export const updateContractPriceRoute = createRoute({
120
- method: "patch",
121
- path: "/api/marketplace/contract-prices/{id}",
122
- tags: ["Marketplace - B2B"],
123
- summary: "Update a contract price",
124
- request: {
125
- params: z.object({ id: z.string() }),
126
- body: { content: { "application/json": { schema: UpdateContractPriceBodySchema } }, required: true },
127
- },
128
- responses: {
129
- 200: { content: { "application/json": { schema: DataResponseSchema } }, description: "Contract price updated." },
130
- ...errorResponses,
131
- },
132
- });
133
- // ─── List RFQs ──────────────────────────────────────────────────────────────
134
- export const listRFQsRoute = createRoute({
135
- method: "get",
136
- path: "/api/marketplace/rfq",
137
- tags: ["Marketplace - B2B"],
138
- summary: "List Requests for Quote",
139
- request: {
140
- query: z.object({
141
- status: z.string().optional(),
142
- categorySlug: z.string().optional(),
143
- }),
144
- },
145
- responses: {
146
- 200: { content: { "application/json": { schema: DataResponseSchema } }, description: "Success" },
147
- ...errorResponses,
148
- },
149
- });
150
- // ─── Get RFQ ────────────────────────────────────────────────────────────────
151
- export const getRFQRoute = createRoute({
152
- method: "get",
153
- path: "/api/marketplace/rfq/{id}",
154
- tags: ["Marketplace - B2B"],
155
- summary: "Get RFQ detail",
156
- request: {
157
- params: z.object({ id: z.string() }),
158
- },
159
- responses: {
160
- 200: { content: { "application/json": { schema: DataResponseSchema } }, description: "Success" },
161
- ...errorResponses,
162
- },
163
- });
164
- // ─── Close RFQ ──────────────────────────────────────────────────────────────
165
- export const closeRFQRoute = createRoute({
166
- method: "post",
167
- path: "/api/marketplace/rfq/{id}/close",
168
- tags: ["Marketplace - B2B"],
169
- summary: "Close an RFQ",
170
- request: {
171
- params: z.object({ id: z.string() }),
172
- },
173
- responses: {
174
- 200: { content: { "application/json": { schema: DataResponseSchema } }, description: "RFQ closed." },
175
- ...errorResponses,
176
- },
177
- });
178
- // ─── List Contract Prices ───────────────────────────────────────────────────
179
- export const listContractPricesRoute = createRoute({
180
- method: "get",
181
- path: "/api/marketplace/contract-prices",
182
- tags: ["Marketplace - B2B"],
183
- summary: "List contract prices",
184
- request: {
185
- query: z.object({
186
- vendorId: z.string().optional(),
187
- buyerId: z.string().optional(),
188
- }),
189
- },
190
- responses: {
191
- 200: { content: { "application/json": { schema: DataResponseSchema } }, description: "Success" },
192
- ...errorResponses,
193
- },
194
- });
195
- // ─── Delete Contract Price ──────────────────────────────────────────────────
196
- export const deleteContractPriceRoute = createRoute({
197
- method: "delete",
198
- path: "/api/marketplace/contract-prices/{id}",
199
- tags: ["Marketplace - B2B"],
200
- summary: "Delete a contract price",
201
- request: {
202
- params: z.object({ id: z.string() }),
203
- },
204
- responses: {
205
- 200: { content: { "application/json": { schema: DataResponseSchema } }, description: "Contract price deleted." },
206
- ...errorResponses,
207
- },
208
- });