@mercurjs/core 2.2.0-canary.7 → 2.2.0-canary.9

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 (166) hide show
  1. package/.medusa/server/src/api/admin/products/[id]/attributes/[attribute_id]/route.d.ts +9 -0
  2. package/.medusa/server/src/api/admin/products/[id]/attributes/[attribute_id]/route.js +27 -2
  3. package/.medusa/server/src/api/admin/products/validators.d.ts +18 -0
  4. package/.medusa/server/src/api/admin/products/validators.js +8 -2
  5. package/.medusa/server/src/api/utils/format-product-attributes.js +3 -1
  6. package/.medusa/server/src/api/vendor/claims/[id]/cancel/route.d.ts +4 -0
  7. package/.medusa/server/src/api/vendor/claims/[id]/cancel/route.js +17 -0
  8. package/.medusa/server/src/api/vendor/claims/[id]/claim-items/[action_id]/route.d.ts +9 -0
  9. package/.medusa/server/src/api/vendor/claims/[id]/claim-items/[action_id]/route.js +32 -0
  10. package/.medusa/server/src/api/vendor/claims/[id]/claim-items/route.d.ts +6 -0
  11. package/.medusa/server/src/api/vendor/claims/[id]/claim-items/route.js +15 -0
  12. package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/[action_id]/route.d.ts +9 -0
  13. package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/[action_id]/route.js +46 -0
  14. package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/route.d.ts +6 -0
  15. package/.medusa/server/src/api/vendor/claims/[id]/inbound/items/route.js +26 -0
  16. package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/[action_id]/route.d.ts +9 -0
  17. package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/[action_id]/route.js +39 -0
  18. package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/route.d.ts +6 -0
  19. package/.medusa/server/src/api/vendor/claims/[id]/inbound/shipping-method/route.js +26 -0
  20. package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/[action_id]/route.d.ts +9 -0
  21. package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/[action_id]/route.js +32 -0
  22. package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/route.d.ts +12 -0
  23. package/.medusa/server/src/api/vendor/claims/[id]/outbound/items/route.js +47 -0
  24. package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/[action_id]/route.d.ts +9 -0
  25. package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/[action_id]/route.js +32 -0
  26. package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/route.d.ts +6 -0
  27. package/.medusa/server/src/api/vendor/claims/[id]/outbound/shipping-method/route.js +15 -0
  28. package/.medusa/server/src/api/vendor/claims/[id]/request/route.d.ts +6 -0
  29. package/.medusa/server/src/api/vendor/claims/[id]/request/route.js +34 -0
  30. package/.medusa/server/src/api/vendor/claims/[id]/route.d.ts +3 -0
  31. package/.medusa/server/src/api/vendor/claims/[id]/route.js +19 -0
  32. package/.medusa/server/src/api/vendor/claims/helpers.d.ts +2 -0
  33. package/.medusa/server/src/api/vendor/claims/helpers.js +19 -0
  34. package/.medusa/server/src/api/vendor/claims/middlewares.d.ts +2 -0
  35. package/.medusa/server/src/api/vendor/claims/middlewares.js +184 -0
  36. package/.medusa/server/src/api/vendor/claims/query-config.d.ts +12 -0
  37. package/.medusa/server/src/api/vendor/claims/query-config.js +31 -0
  38. package/.medusa/server/src/api/vendor/claims/route.d.ts +5 -0
  39. package/.medusa/server/src/api/vendor/claims/route.js +35 -0
  40. package/.medusa/server/src/api/vendor/claims/validators.d.ts +378 -0
  41. package/.medusa/server/src/api/vendor/claims/validators.js +89 -0
  42. package/.medusa/server/src/api/vendor/exchanges/[id]/cancel/route.d.ts +4 -0
  43. package/.medusa/server/src/api/vendor/exchanges/[id]/cancel/route.js +17 -0
  44. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/[action_id]/route.d.ts +9 -0
  45. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/[action_id]/route.js +46 -0
  46. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/route.d.ts +6 -0
  47. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/items/route.js +26 -0
  48. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/[action_id]/route.d.ts +9 -0
  49. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/[action_id]/route.js +45 -0
  50. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/route.d.ts +6 -0
  51. package/.medusa/server/src/api/vendor/exchanges/[id]/inbound/shipping-method/route.js +26 -0
  52. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/[action_id]/route.d.ts +9 -0
  53. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/[action_id]/route.js +32 -0
  54. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/route.d.ts +12 -0
  55. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/items/route.js +47 -0
  56. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/[action_id]/route.d.ts +9 -0
  57. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/[action_id]/route.js +32 -0
  58. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/route.d.ts +6 -0
  59. package/.medusa/server/src/api/vendor/exchanges/[id]/outbound/shipping-method/route.js +15 -0
  60. package/.medusa/server/src/api/vendor/exchanges/[id]/request/route.d.ts +6 -0
  61. package/.medusa/server/src/api/vendor/exchanges/[id]/request/route.js +34 -0
  62. package/.medusa/server/src/api/vendor/exchanges/helpers.d.ts +2 -0
  63. package/.medusa/server/src/api/vendor/exchanges/helpers.js +19 -0
  64. package/.medusa/server/src/api/vendor/exchanges/middlewares.d.ts +2 -0
  65. package/.medusa/server/src/api/vendor/exchanges/middlewares.js +155 -0
  66. package/.medusa/server/src/api/vendor/exchanges/query-config.d.ts +7 -0
  67. package/.medusa/server/src/api/vendor/exchanges/query-config.js +23 -0
  68. package/.medusa/server/src/api/vendor/exchanges/route.d.ts +5 -0
  69. package/.medusa/server/src/api/vendor/exchanges/route.js +35 -0
  70. package/.medusa/server/src/api/vendor/exchanges/validators.d.ts +313 -0
  71. package/.medusa/server/src/api/vendor/exchanges/validators.js +71 -0
  72. package/.medusa/server/src/api/vendor/middlewares.js +77 -67
  73. package/.medusa/server/src/api/vendor/order-edits/[id]/confirm/route.d.ts +9 -0
  74. package/.medusa/server/src/api/vendor/order-edits/[id]/confirm/route.js +24 -0
  75. package/.medusa/server/src/api/vendor/order-edits/[id]/items/[action_id]/route.d.ts +14 -0
  76. package/.medusa/server/src/api/vendor/order-edits/[id]/items/[action_id]/route.js +41 -0
  77. package/.medusa/server/src/api/vendor/order-edits/[id]/items/item/[item_id]/route.d.ts +10 -0
  78. package/.medusa/server/src/api/vendor/order-edits/[id]/items/item/[item_id]/route.js +30 -0
  79. package/.medusa/server/src/api/vendor/order-edits/[id]/items/route.d.ts +16 -0
  80. package/.medusa/server/src/api/vendor/order-edits/[id]/items/route.js +45 -0
  81. package/.medusa/server/src/api/vendor/order-edits/[id]/request/route.d.ts +10 -0
  82. package/.medusa/server/src/api/vendor/order-edits/[id]/request/route.js +25 -0
  83. package/.medusa/server/src/api/vendor/order-edits/[id]/route.d.ts +10 -0
  84. package/.medusa/server/src/api/vendor/order-edits/[id]/route.js +26 -0
  85. package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/[action_id]/route.d.ts +14 -0
  86. package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/[action_id]/route.js +41 -0
  87. package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/route.d.ts +9 -0
  88. package/.medusa/server/src/api/vendor/order-edits/[id]/shipping-method/route.js +20 -0
  89. package/.medusa/server/src/api/vendor/order-edits/middlewares.d.ts +2 -0
  90. package/.medusa/server/src/api/vendor/order-edits/middlewares.js +106 -0
  91. package/.medusa/server/src/api/vendor/order-edits/route.d.ts +10 -0
  92. package/.medusa/server/src/api/vendor/order-edits/route.js +21 -0
  93. package/.medusa/server/src/api/vendor/order-edits/validators.d.ts +166 -0
  94. package/.medusa/server/src/api/vendor/order-edits/validators.js +50 -0
  95. package/.medusa/server/src/api/vendor/orders/apply-request-filter.d.ts +2 -0
  96. package/.medusa/server/src/api/vendor/orders/apply-request-filter.js +99 -0
  97. package/.medusa/server/src/api/vendor/orders/middlewares.js +3 -1
  98. package/.medusa/server/src/api/vendor/orders/query-config.js +34 -11
  99. package/.medusa/server/src/api/vendor/orders/resolve-offer-items.d.ts +34 -0
  100. package/.medusa/server/src/api/vendor/orders/resolve-offer-items.js +66 -0
  101. package/.medusa/server/src/api/vendor/orders/validators.d.ts +5 -2
  102. package/.medusa/server/src/api/vendor/orders/validators.js +7 -1
  103. package/.medusa/server/src/api/vendor/payment-collections/[id]/mark-as-paid/route.d.ts +3 -0
  104. package/.medusa/server/src/api/vendor/payment-collections/[id]/mark-as-paid/route.js +25 -0
  105. package/.medusa/server/src/api/vendor/payment-collections/helpers.d.ts +3 -0
  106. package/.medusa/server/src/api/vendor/payment-collections/helpers.js +30 -0
  107. package/.medusa/server/src/api/vendor/payment-collections/middlewares.d.ts +2 -0
  108. package/.medusa/server/src/api/vendor/payment-collections/middlewares.js +17 -0
  109. package/.medusa/server/src/api/vendor/payment-collections/query-config.d.ts +7 -0
  110. package/.medusa/server/src/api/vendor/payment-collections/query-config.js +26 -0
  111. package/.medusa/server/src/api/vendor/payment-collections/validators.d.ts +17 -0
  112. package/.medusa/server/src/api/vendor/payment-collections/validators.js +12 -0
  113. package/.medusa/server/src/api/vendor/payments/helpers.d.ts +9 -0
  114. package/.medusa/server/src/api/vendor/payments/helpers.js +23 -8
  115. package/.medusa/server/src/api/vendor/product-categories/[id]/products/route.d.ts +4 -0
  116. package/.medusa/server/src/api/vendor/product-categories/[id]/products/route.js +36 -0
  117. package/.medusa/server/src/api/vendor/product-categories/middlewares.js +9 -1
  118. package/.medusa/server/src/api/vendor/product-categories/validators.d.ts +17 -0
  119. package/.medusa/server/src/api/vendor/product-categories/validators.js +7 -2
  120. package/.medusa/server/src/api/vendor/products/[id]/attributes/[attribute_id]/route.d.ts +12 -0
  121. package/.medusa/server/src/api/vendor/products/[id]/attributes/[attribute_id]/route.js +39 -4
  122. package/.medusa/server/src/api/vendor/products/[id]/attributes/batch/route.d.ts +12 -0
  123. package/.medusa/server/src/api/vendor/products/[id]/attributes/batch/route.js +46 -0
  124. package/.medusa/server/src/api/vendor/products/[id]/attributes/route.js +1 -3
  125. package/.medusa/server/src/api/vendor/products/[id]/cancel/route.js +1 -3
  126. package/.medusa/server/src/api/vendor/products/[id]/route.js +1 -4
  127. package/.medusa/server/src/api/vendor/products/[id]/variants/[variant_id]/route.js +1 -4
  128. package/.medusa/server/src/api/vendor/products/[id]/variants/route.js +1 -3
  129. package/.medusa/server/src/api/vendor/products/helpers.js +1 -1
  130. package/.medusa/server/src/api/vendor/products/middlewares.js +18 -1
  131. package/.medusa/server/src/api/vendor/products/validators.d.ts +86 -1
  132. package/.medusa/server/src/api/vendor/products/validators.js +39 -2
  133. package/.medusa/server/src/api/vendor/reservations/[id]/route.d.ts +5 -0
  134. package/.medusa/server/src/api/vendor/reservations/[id]/route.js +39 -0
  135. package/.medusa/server/src/api/vendor/reservations/helpers.d.ts +2 -0
  136. package/.medusa/server/src/api/vendor/reservations/helpers.js +21 -0
  137. package/.medusa/server/src/api/vendor/reservations/middlewares.d.ts +2 -0
  138. package/.medusa/server/src/api/vendor/reservations/middlewares.js +61 -0
  139. package/.medusa/server/src/api/vendor/reservations/query-config.d.ts +19 -0
  140. package/.medusa/server/src/api/vendor/reservations/query-config.js +48 -0
  141. package/.medusa/server/src/api/vendor/reservations/route.d.ts +4 -0
  142. package/.medusa/server/src/api/vendor/reservations/route.js +35 -0
  143. package/.medusa/server/src/api/vendor/reservations/validators.d.ts +296 -0
  144. package/.medusa/server/src/api/vendor/reservations/validators.js +40 -0
  145. package/.medusa/server/src/api/vendor/shipping-options/middlewares.js +13 -1
  146. package/.medusa/server/src/api/vendor/shipping-options/validators.d.ts +3 -0
  147. package/.medusa/server/src/api/vendor/shipping-options/validators.js +2 -1
  148. package/.medusa/server/src/links/cart-line-item-offer-link.js +9 -2
  149. package/.medusa/server/src/links/order-line-item-offer-link.js +10 -2
  150. package/.medusa/server/src/subscribers/link-order-line-items-to-offers.d.ts +6 -0
  151. package/.medusa/server/src/subscribers/link-order-line-items-to-offers.js +94 -0
  152. package/.medusa/server/src/subscribers/order-edit-confirmed.d.ts +5 -0
  153. package/.medusa/server/src/subscribers/order-edit-confirmed.js +22 -0
  154. package/.medusa/server/src/workflows/cart/utils/fields.js +29 -1
  155. package/.medusa/server/src/workflows/cart/workflows/complete-cart-with-split-orders.js +29 -3
  156. package/.medusa/server/src/workflows/order/workflows/confirm-claim-request.d.ts +7 -0
  157. package/.medusa/server/src/workflows/order/workflows/confirm-claim-request.js +151 -0
  158. package/.medusa/server/src/workflows/order/workflows/confirm-exchange-request.d.ts +7 -0
  159. package/.medusa/server/src/workflows/order/workflows/confirm-exchange-request.js +159 -0
  160. package/.medusa/server/src/workflows/order/workflows/index.d.ts +2 -0
  161. package/.medusa/server/src/workflows/order/workflows/index.js +3 -1
  162. package/.medusa/server/src/workflows/product-attribute/workflows/index.d.ts +1 -0
  163. package/.medusa/server/src/workflows/product-attribute/workflows/index.js +2 -1
  164. package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attribute.d.ts +23 -0
  165. package/.medusa/server/src/workflows/product-attribute/workflows/update-product-attribute.js +67 -0
  166. package/package.json +1 -1
@@ -0,0 +1,313 @@
1
+ import { z } from "zod";
2
+ export declare const VendorGetExchangesParams: z.ZodObject<{
3
+ fields: z.ZodOptional<z.ZodString>;
4
+ } & {
5
+ offset: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodNumber>>, number, unknown>;
6
+ limit: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodNumber>>, number, unknown>;
7
+ order: z.ZodOptional<z.ZodString> | z.ZodDefault<z.ZodOptional<z.ZodString>>;
8
+ with_deleted: z.ZodEffects<z.ZodOptional<z.ZodBoolean>, boolean | undefined, unknown>;
9
+ } & {
10
+ id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
11
+ order_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
12
+ return_id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
13
+ created_at: z.ZodOptional<z.ZodUnion<[any, z.ZodObject<{
14
+ $eq: any;
15
+ $ne: any;
16
+ $in: any;
17
+ $nin: any;
18
+ $like: any;
19
+ $ilike: any;
20
+ $re: any;
21
+ $contains: any;
22
+ $gt: any;
23
+ $gte: any;
24
+ $lt: any;
25
+ $lte: any;
26
+ }, "strip", z.ZodTypeAny, {
27
+ $eq?: any;
28
+ $ne?: any;
29
+ $in?: any;
30
+ $nin?: any;
31
+ $like?: any;
32
+ $ilike?: any;
33
+ $re?: any;
34
+ $contains?: any;
35
+ $gt?: any;
36
+ $gte?: any;
37
+ $lt?: any;
38
+ $lte?: any;
39
+ }, {
40
+ $eq?: any;
41
+ $ne?: any;
42
+ $in?: any;
43
+ $nin?: any;
44
+ $like?: any;
45
+ $ilike?: any;
46
+ $re?: any;
47
+ $contains?: any;
48
+ $gt?: any;
49
+ $gte?: any;
50
+ $lt?: any;
51
+ $lte?: any;
52
+ }>]>>;
53
+ updated_at: z.ZodOptional<z.ZodUnion<[any, z.ZodObject<{
54
+ $eq: any;
55
+ $ne: any;
56
+ $in: any;
57
+ $nin: any;
58
+ $like: any;
59
+ $ilike: any;
60
+ $re: any;
61
+ $contains: any;
62
+ $gt: any;
63
+ $gte: any;
64
+ $lt: any;
65
+ $lte: any;
66
+ }, "strip", z.ZodTypeAny, {
67
+ $eq?: any;
68
+ $ne?: any;
69
+ $in?: any;
70
+ $nin?: any;
71
+ $like?: any;
72
+ $ilike?: any;
73
+ $re?: any;
74
+ $contains?: any;
75
+ $gt?: any;
76
+ $gte?: any;
77
+ $lt?: any;
78
+ $lte?: any;
79
+ }, {
80
+ $eq?: any;
81
+ $ne?: any;
82
+ $in?: any;
83
+ $nin?: any;
84
+ $like?: any;
85
+ $ilike?: any;
86
+ $re?: any;
87
+ $contains?: any;
88
+ $gt?: any;
89
+ $gte?: any;
90
+ $lt?: any;
91
+ $lte?: any;
92
+ }>]>>;
93
+ }, "strip", z.ZodTypeAny, {
94
+ offset: number;
95
+ limit: number;
96
+ id?: string | string[] | undefined;
97
+ created_at?: any;
98
+ updated_at?: any;
99
+ fields?: string | undefined;
100
+ order?: string | undefined;
101
+ with_deleted?: boolean | undefined;
102
+ order_id?: string | string[] | undefined;
103
+ return_id?: string | string[] | undefined;
104
+ }, {
105
+ id?: string | string[] | undefined;
106
+ created_at?: any;
107
+ updated_at?: any;
108
+ offset?: unknown;
109
+ limit?: unknown;
110
+ fields?: string | undefined;
111
+ order?: string | undefined;
112
+ with_deleted?: unknown;
113
+ order_id?: string | string[] | undefined;
114
+ return_id?: string | string[] | undefined;
115
+ }>;
116
+ export type VendorGetExchangesParamsType = z.infer<typeof VendorGetExchangesParams>;
117
+ export declare const VendorPostOrderExchangesReq: z.ZodObject<{
118
+ order_id: z.ZodString;
119
+ description: z.ZodOptional<z.ZodString>;
120
+ internal_note: z.ZodOptional<z.ZodString>;
121
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
122
+ }, "strip", z.ZodTypeAny, {
123
+ order_id: string;
124
+ metadata?: Record<string, unknown> | null | undefined;
125
+ description?: string | undefined;
126
+ internal_note?: string | undefined;
127
+ }, {
128
+ order_id: string;
129
+ metadata?: Record<string, unknown> | null | undefined;
130
+ description?: string | undefined;
131
+ internal_note?: string | undefined;
132
+ }>;
133
+ export type VendorPostOrderExchangesReqType = z.infer<typeof VendorPostOrderExchangesReq>;
134
+ export declare const VendorPostCancelExchangeReq: z.ZodObject<{
135
+ no_notification: z.ZodOptional<z.ZodBoolean>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ no_notification?: boolean | undefined;
138
+ }, {
139
+ no_notification?: boolean | undefined;
140
+ }>;
141
+ export type VendorPostCancelExchangeReqType = z.infer<typeof VendorPostCancelExchangeReq>;
142
+ export declare const VendorPostExchangesReturnRequestItemsReq: z.ZodObject<{
143
+ location_id: z.ZodOptional<z.ZodString>;
144
+ items: z.ZodArray<z.ZodObject<{
145
+ id: z.ZodString;
146
+ quantity: z.ZodNumber;
147
+ description: z.ZodOptional<z.ZodString>;
148
+ internal_note: z.ZodOptional<z.ZodString>;
149
+ reason_id: z.ZodOptional<z.ZodString>;
150
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
151
+ }, "strip", z.ZodTypeAny, {
152
+ id: string;
153
+ quantity: number;
154
+ metadata?: Record<string, unknown> | undefined;
155
+ description?: string | undefined;
156
+ internal_note?: string | undefined;
157
+ reason_id?: string | undefined;
158
+ }, {
159
+ id: string;
160
+ quantity: number;
161
+ metadata?: Record<string, unknown> | undefined;
162
+ description?: string | undefined;
163
+ internal_note?: string | undefined;
164
+ reason_id?: string | undefined;
165
+ }>, "many">;
166
+ }, "strip", z.ZodTypeAny, {
167
+ items: {
168
+ id: string;
169
+ quantity: number;
170
+ metadata?: Record<string, unknown> | undefined;
171
+ description?: string | undefined;
172
+ internal_note?: string | undefined;
173
+ reason_id?: string | undefined;
174
+ }[];
175
+ location_id?: string | undefined;
176
+ }, {
177
+ items: {
178
+ id: string;
179
+ quantity: number;
180
+ metadata?: Record<string, unknown> | undefined;
181
+ description?: string | undefined;
182
+ internal_note?: string | undefined;
183
+ reason_id?: string | undefined;
184
+ }[];
185
+ location_id?: string | undefined;
186
+ }>;
187
+ export type VendorPostExchangesReturnRequestItemsReqType = z.infer<typeof VendorPostExchangesReturnRequestItemsReq>;
188
+ export declare const VendorPostExchangesRequestItemsReturnActionReq: z.ZodObject<{
189
+ quantity: z.ZodOptional<z.ZodNumber>;
190
+ internal_note: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
191
+ reason_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
192
+ metadata: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
193
+ }, "strip", z.ZodTypeAny, {
194
+ metadata?: Record<string, unknown> | null | undefined;
195
+ internal_note?: string | null | undefined;
196
+ quantity?: number | undefined;
197
+ reason_id?: string | null | undefined;
198
+ }, {
199
+ metadata?: Record<string, unknown> | null | undefined;
200
+ internal_note?: string | null | undefined;
201
+ quantity?: number | undefined;
202
+ reason_id?: string | null | undefined;
203
+ }>;
204
+ export type VendorPostExchangesRequestItemsReturnActionReqType = z.infer<typeof VendorPostExchangesRequestItemsReturnActionReq>;
205
+ export declare const VendorPostExchangesAddItemsReq: z.ZodObject<{
206
+ items: z.ZodArray<z.ZodEffects<z.ZodObject<{
207
+ variant_id: z.ZodOptional<z.ZodString>;
208
+ offer_id: z.ZodOptional<z.ZodString>;
209
+ quantity: z.ZodNumber;
210
+ unit_price: z.ZodOptional<z.ZodNumber>;
211
+ internal_note: z.ZodOptional<z.ZodString>;
212
+ allow_backorder: z.ZodOptional<z.ZodBoolean>;
213
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
214
+ }, "strip", z.ZodTypeAny, {
215
+ quantity: number;
216
+ variant_id?: string | undefined;
217
+ metadata?: Record<string, unknown> | undefined;
218
+ allow_backorder?: boolean | undefined;
219
+ internal_note?: string | undefined;
220
+ offer_id?: string | undefined;
221
+ unit_price?: number | undefined;
222
+ }, {
223
+ quantity: number;
224
+ variant_id?: string | undefined;
225
+ metadata?: Record<string, unknown> | undefined;
226
+ allow_backorder?: boolean | undefined;
227
+ internal_note?: string | undefined;
228
+ offer_id?: string | undefined;
229
+ unit_price?: number | undefined;
230
+ }>, {
231
+ quantity: number;
232
+ variant_id?: string | undefined;
233
+ metadata?: Record<string, unknown> | undefined;
234
+ allow_backorder?: boolean | undefined;
235
+ internal_note?: string | undefined;
236
+ offer_id?: string | undefined;
237
+ unit_price?: number | undefined;
238
+ }, {
239
+ quantity: number;
240
+ variant_id?: string | undefined;
241
+ metadata?: Record<string, unknown> | undefined;
242
+ allow_backorder?: boolean | undefined;
243
+ internal_note?: string | undefined;
244
+ offer_id?: string | undefined;
245
+ unit_price?: number | undefined;
246
+ }>, "many">;
247
+ }, "strip", z.ZodTypeAny, {
248
+ items: {
249
+ quantity: number;
250
+ variant_id?: string | undefined;
251
+ metadata?: Record<string, unknown> | undefined;
252
+ allow_backorder?: boolean | undefined;
253
+ internal_note?: string | undefined;
254
+ offer_id?: string | undefined;
255
+ unit_price?: number | undefined;
256
+ }[];
257
+ }, {
258
+ items: {
259
+ quantity: number;
260
+ variant_id?: string | undefined;
261
+ metadata?: Record<string, unknown> | undefined;
262
+ allow_backorder?: boolean | undefined;
263
+ internal_note?: string | undefined;
264
+ offer_id?: string | undefined;
265
+ unit_price?: number | undefined;
266
+ }[];
267
+ }>;
268
+ export type VendorPostExchangesAddItemsReqType = z.infer<typeof VendorPostExchangesAddItemsReq>;
269
+ export declare const VendorPostExchangesItemsActionReq: z.ZodObject<{
270
+ quantity: z.ZodOptional<z.ZodNumber>;
271
+ internal_note: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
272
+ }, "strip", z.ZodTypeAny, {
273
+ internal_note?: string | null | undefined;
274
+ quantity?: number | undefined;
275
+ }, {
276
+ internal_note?: string | null | undefined;
277
+ quantity?: number | undefined;
278
+ }>;
279
+ export type VendorPostExchangesItemsActionReqType = z.infer<typeof VendorPostExchangesItemsActionReq>;
280
+ export declare const VendorPostExchangesShippingReq: z.ZodObject<{
281
+ shipping_option_id: z.ZodString;
282
+ custom_amount: z.ZodOptional<z.ZodNumber>;
283
+ description: z.ZodOptional<z.ZodString>;
284
+ internal_note: z.ZodOptional<z.ZodString>;
285
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
286
+ }, "strip", z.ZodTypeAny, {
287
+ shipping_option_id: string;
288
+ metadata?: Record<string, unknown> | undefined;
289
+ description?: string | undefined;
290
+ internal_note?: string | undefined;
291
+ custom_amount?: number | undefined;
292
+ }, {
293
+ shipping_option_id: string;
294
+ metadata?: Record<string, unknown> | undefined;
295
+ description?: string | undefined;
296
+ internal_note?: string | undefined;
297
+ custom_amount?: number | undefined;
298
+ }>;
299
+ export type VendorPostExchangesShippingReqType = z.infer<typeof VendorPostExchangesShippingReq>;
300
+ export declare const VendorPostExchangesShippingActionReq: z.ZodObject<{
301
+ custom_amount: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
302
+ internal_note: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
303
+ metadata: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
304
+ }, "strip", z.ZodTypeAny, {
305
+ metadata?: Record<string, unknown> | null | undefined;
306
+ internal_note?: string | null | undefined;
307
+ custom_amount?: number | null | undefined;
308
+ }, {
309
+ metadata?: Record<string, unknown> | null | undefined;
310
+ internal_note?: string | null | undefined;
311
+ custom_amount?: number | null | undefined;
312
+ }>;
313
+ export type VendorPostExchangesShippingActionReqType = z.infer<typeof VendorPostExchangesShippingActionReq>;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VendorPostExchangesShippingActionReq = exports.VendorPostExchangesShippingReq = exports.VendorPostExchangesItemsActionReq = exports.VendorPostExchangesAddItemsReq = exports.VendorPostExchangesRequestItemsReturnActionReq = exports.VendorPostExchangesReturnRequestItemsReq = exports.VendorPostCancelExchangeReq = exports.VendorPostOrderExchangesReq = exports.VendorGetExchangesParams = void 0;
4
+ const zod_1 = require("zod");
5
+ const validators_1 = require("@medusajs/medusa/api/utils/validators");
6
+ exports.VendorGetExchangesParams = (0, validators_1.createFindParams)({
7
+ limit: 20,
8
+ offset: 0,
9
+ }).merge(zod_1.z.object({
10
+ id: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
11
+ order_id: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
12
+ return_id: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]).optional(),
13
+ created_at: (0, validators_1.createOperatorMap)().optional(),
14
+ updated_at: (0, validators_1.createOperatorMap)().optional(),
15
+ }));
16
+ exports.VendorPostOrderExchangesReq = zod_1.z.object({
17
+ order_id: zod_1.z.string(),
18
+ description: zod_1.z.string().optional(),
19
+ internal_note: zod_1.z.string().optional(),
20
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).nullish(),
21
+ });
22
+ exports.VendorPostCancelExchangeReq = zod_1.z.object({
23
+ no_notification: zod_1.z.boolean().optional(),
24
+ });
25
+ exports.VendorPostExchangesReturnRequestItemsReq = zod_1.z.object({
26
+ location_id: zod_1.z.string().optional(),
27
+ items: zod_1.z.array(zod_1.z.object({
28
+ id: zod_1.z.string(),
29
+ quantity: zod_1.z.number(),
30
+ description: zod_1.z.string().optional(),
31
+ internal_note: zod_1.z.string().optional(),
32
+ reason_id: zod_1.z.string().optional(),
33
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
34
+ })),
35
+ });
36
+ exports.VendorPostExchangesRequestItemsReturnActionReq = zod_1.z.object({
37
+ quantity: zod_1.z.number().optional(),
38
+ internal_note: zod_1.z.string().nullish().optional(),
39
+ reason_id: zod_1.z.string().nullish().optional(),
40
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).nullish().optional(),
41
+ });
42
+ exports.VendorPostExchangesAddItemsReq = zod_1.z.object({
43
+ items: zod_1.z.array(zod_1.z
44
+ .object({
45
+ variant_id: zod_1.z.string().optional(),
46
+ offer_id: zod_1.z.string().optional(),
47
+ quantity: zod_1.z.number(),
48
+ unit_price: zod_1.z.number().optional(),
49
+ internal_note: zod_1.z.string().optional(),
50
+ allow_backorder: zod_1.z.boolean().optional(),
51
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
52
+ })
53
+ .refine((data) => !!data.offer_id || !!data.variant_id, "Each item must include either offer_id or variant_id")),
54
+ });
55
+ exports.VendorPostExchangesItemsActionReq = zod_1.z.object({
56
+ quantity: zod_1.z.number().optional(),
57
+ internal_note: zod_1.z.string().nullish().optional(),
58
+ });
59
+ exports.VendorPostExchangesShippingReq = zod_1.z.object({
60
+ shipping_option_id: zod_1.z.string(),
61
+ custom_amount: zod_1.z.number().optional(),
62
+ description: zod_1.z.string().optional(),
63
+ internal_note: zod_1.z.string().optional(),
64
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
65
+ });
66
+ exports.VendorPostExchangesShippingActionReq = zod_1.z.object({
67
+ custom_amount: zod_1.z.number().nullish().optional(),
68
+ internal_note: zod_1.z.string().nullish().optional(),
69
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).nullish().optional(),
70
+ });
71
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9hcGkvdmVuZG9yL2V4Y2hhbmdlcy92YWxpZGF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDZCQUF1QjtBQUN2QixzRUFHOEM7QUFFakMsUUFBQSx3QkFBd0IsR0FBRyxJQUFBLDZCQUFnQixFQUFDO0lBQ3ZELEtBQUssRUFBRSxFQUFFO0lBQ1QsTUFBTSxFQUFFLENBQUM7Q0FDVixDQUFDLENBQUMsS0FBSyxDQUNOLE9BQUMsQ0FBQyxNQUFNLENBQUM7SUFDUCxFQUFFLEVBQUUsT0FBQyxDQUFD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LENBQUMsUUFBUSxFQUFFO0lBQzlDLFFBQVEsRUFBRSxPQUFDLENBQUMsTUFBTSxDQUFDLE9BQUMsQ0FBQyxNQUFNLEVBQUUsRUFBRSxPQUFDLENBQUMsT0FBTyxFQUFFLENBQUMsQ0FBQyxPQUFPLEVBQUUsQ0FBQyxRQUFRLEVBQUU7Q0FDakUsQ0FBQyxDQUFBIn0=
@@ -3,40 +3,45 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.vendorMiddlewares = void 0;
4
4
  const framework_1 = require("@medusajs/framework");
5
5
  const middlewares_1 = require("./campaigns/middlewares");
6
- const middlewares_2 = require("./collections/middlewares");
7
- const middlewares_3 = require("./members/middlewares");
8
- const middlewares_4 = require("./currencies/middlewares");
9
- const middlewares_5 = require("./customers/middlewares");
10
- const middlewares_6 = require("./fulfillment-providers/middlewares");
11
- const middlewares_7 = require("./fulfillment-sets/middlewares");
12
- const middlewares_8 = require("./inventory-items/middlewares");
13
- const middlewares_9 = require("./offers/middlewares");
14
- const middlewares_10 = require("./orders/middlewares");
15
- const middlewares_11 = require("./payments/middlewares");
16
- const middlewares_12 = require("./payouts/middlewares");
17
- const middlewares_13 = require("./payout-accounts/middlewares");
18
- const middlewares_14 = require("./price-lists/middlewares");
19
- const middlewares_15 = require("./price-preferences/middlewares");
20
- const middlewares_16 = require("./product-categories/middlewares");
21
- const middlewares_17 = require("./products/middlewares");
22
- const middlewares_18 = require("./product-types/middlewares");
23
- const middlewares_19 = require("./product-variants/middlewares");
24
- const middlewares_20 = require("./promotions/middlewares");
25
- const middlewares_21 = require("./regions/middlewares");
26
- const middlewares_22 = require("./refund-reasons/middlewares");
27
- const middlewares_23 = require("./return-reasons/middlewares");
28
- const middlewares_24 = require("./returns/middlewares");
29
- const middlewares_25 = require("./sales-channels/middlewares");
30
- const middlewares_26 = require("./sellers/middlewares");
31
- const middlewares_27 = require("./shipping-options/middlewares");
32
- const middlewares_28 = require("./shipping-option-types/middlewares");
33
- const middlewares_29 = require("./shipping-profiles/middlewares");
34
- const middlewares_30 = require("./stock-locations/middlewares");
35
- const middlewares_31 = require("./stores/middlewares");
36
- const middlewares_32 = require("./uploads/middlewares");
6
+ const middlewares_2 = require("./claims/middlewares");
7
+ const middlewares_3 = require("./collections/middlewares");
8
+ const middlewares_4 = require("./members/middlewares");
9
+ const middlewares_5 = require("./currencies/middlewares");
10
+ const middlewares_6 = require("./customers/middlewares");
11
+ const middlewares_7 = require("./exchanges/middlewares");
12
+ const middlewares_8 = require("./fulfillment-providers/middlewares");
13
+ const middlewares_9 = require("./fulfillment-sets/middlewares");
14
+ const middlewares_10 = require("./inventory-items/middlewares");
15
+ const middlewares_11 = require("./offers/middlewares");
16
+ const middlewares_12 = require("./order-edits/middlewares");
17
+ const middlewares_13 = require("./orders/middlewares");
18
+ const middlewares_14 = require("./payment-collections/middlewares");
19
+ const middlewares_15 = require("./payments/middlewares");
20
+ const middlewares_16 = require("./payouts/middlewares");
21
+ const middlewares_17 = require("./payout-accounts/middlewares");
22
+ const middlewares_18 = require("./price-lists/middlewares");
23
+ const middlewares_19 = require("./price-preferences/middlewares");
24
+ const middlewares_20 = require("./product-categories/middlewares");
25
+ const middlewares_21 = require("./products/middlewares");
26
+ const middlewares_22 = require("./product-types/middlewares");
27
+ const middlewares_23 = require("./product-variants/middlewares");
28
+ const middlewares_24 = require("./promotions/middlewares");
29
+ const middlewares_25 = require("./regions/middlewares");
30
+ const middlewares_26 = require("./refund-reasons/middlewares");
31
+ const middlewares_27 = require("./reservations/middlewares");
32
+ const middlewares_28 = require("./return-reasons/middlewares");
33
+ const middlewares_29 = require("./returns/middlewares");
34
+ const middlewares_30 = require("./sales-channels/middlewares");
35
+ const middlewares_31 = require("./sellers/middlewares");
36
+ const middlewares_32 = require("./shipping-options/middlewares");
37
+ const middlewares_33 = require("./shipping-option-types/middlewares");
38
+ const middlewares_34 = require("./shipping-profiles/middlewares");
39
+ const middlewares_35 = require("./stock-locations/middlewares");
40
+ const middlewares_36 = require("./stores/middlewares");
41
+ const middlewares_37 = require("./uploads/middlewares");
37
42
  const utils_1 = require("../utils");
38
- const middlewares_33 = require("./product-attributes/middlewares");
39
- const middlewares_34 = require("./product-tags/middlewares");
43
+ const middlewares_38 = require("./product-attributes/middlewares");
44
+ const middlewares_39 = require("./product-tags/middlewares");
40
45
  const unauthenticatedRoutes = [
41
46
  /^\/vendor\/sellers$/,
42
47
  /^\/vendor\/sellers\/select$/,
@@ -74,39 +79,44 @@ exports.vendorMiddlewares = [
74
79
  (0, utils_1.unlessBaseUrl)(unauthenticatedRoutes, utils_1.ensureSellerMiddleware),
75
80
  ],
76
81
  },
77
- ...middlewares_3.vendorMembersMiddlewares,
82
+ ...middlewares_4.vendorMembersMiddlewares,
78
83
  ...middlewares_1.vendorCampaignsMiddlewares,
79
- ...middlewares_2.vendorCollectionsMiddlewares,
80
- ...middlewares_4.vendorCurrenciesMiddlewares,
81
- ...middlewares_5.vendorCustomersMiddlewares,
82
- ...middlewares_6.vendorFulfillmentProvidersMiddlewares,
83
- ...middlewares_7.vendorFulfillmentSetsMiddlewares,
84
- ...middlewares_8.vendorInventoryItemsMiddlewares,
85
- ...middlewares_9.vendorOffersMiddlewares,
86
- ...middlewares_10.vendorOrdersMiddlewares,
87
- ...middlewares_11.vendorPaymentsMiddlewares,
88
- ...middlewares_12.vendorPayoutsMiddlewares,
89
- ...middlewares_13.vendorPayoutAccountsMiddlewares,
90
- ...middlewares_14.vendorPriceListsMiddlewares,
91
- ...middlewares_15.vendorPricePreferencesMiddlewares,
92
- ...middlewares_16.vendorProductCategoriesMiddlewares,
93
- ...middlewares_33.vendorProductAttributesMiddlewares,
94
- ...middlewares_17.vendorProductsMiddlewares,
95
- ...middlewares_18.vendorProductTypesMiddlewares,
96
- ...middlewares_19.vendorProductVariantsMiddlewares,
97
- ...middlewares_20.vendorPromotionsMiddlewares,
98
- ...middlewares_21.vendorRegionsMiddlewares,
99
- ...middlewares_22.vendorRefundReasonsMiddlewares,
100
- ...middlewares_23.vendorReturnReasonsMiddlewares,
101
- ...middlewares_24.vendorReturnsMiddlewares,
102
- ...middlewares_25.vendorSalesChannelsMiddlewares,
103
- ...middlewares_26.vendorSellersMiddlewares,
104
- ...middlewares_27.vendorShippingOptionsMiddlewares,
105
- ...middlewares_28.vendorShippingOptionTypesMiddlewares,
106
- ...middlewares_29.vendorShippingProfilesMiddlewares,
107
- ...middlewares_30.vendorStockLocationsMiddlewares,
108
- ...middlewares_31.vendorStoresMiddlewares,
109
- ...middlewares_32.vendorUploadsMiddlewares,
110
- ...middlewares_34.vendorProductTagsMiddlewares,
84
+ ...middlewares_2.vendorClaimsMiddlewares,
85
+ ...middlewares_3.vendorCollectionsMiddlewares,
86
+ ...middlewares_5.vendorCurrenciesMiddlewares,
87
+ ...middlewares_6.vendorCustomersMiddlewares,
88
+ ...middlewares_7.vendorExchangesMiddlewares,
89
+ ...middlewares_8.vendorFulfillmentProvidersMiddlewares,
90
+ ...middlewares_9.vendorFulfillmentSetsMiddlewares,
91
+ ...middlewares_10.vendorInventoryItemsMiddlewares,
92
+ ...middlewares_11.vendorOffersMiddlewares,
93
+ ...middlewares_12.vendorOrderEditsMiddlewares,
94
+ ...middlewares_13.vendorOrdersMiddlewares,
95
+ ...middlewares_14.vendorPaymentCollectionsMiddlewares,
96
+ ...middlewares_15.vendorPaymentsMiddlewares,
97
+ ...middlewares_16.vendorPayoutsMiddlewares,
98
+ ...middlewares_17.vendorPayoutAccountsMiddlewares,
99
+ ...middlewares_18.vendorPriceListsMiddlewares,
100
+ ...middlewares_19.vendorPricePreferencesMiddlewares,
101
+ ...middlewares_20.vendorProductCategoriesMiddlewares,
102
+ ...middlewares_38.vendorProductAttributesMiddlewares,
103
+ ...middlewares_21.vendorProductsMiddlewares,
104
+ ...middlewares_22.vendorProductTypesMiddlewares,
105
+ ...middlewares_23.vendorProductVariantsMiddlewares,
106
+ ...middlewares_24.vendorPromotionsMiddlewares,
107
+ ...middlewares_25.vendorRegionsMiddlewares,
108
+ ...middlewares_26.vendorRefundReasonsMiddlewares,
109
+ ...middlewares_27.vendorReservationsMiddlewares,
110
+ ...middlewares_28.vendorReturnReasonsMiddlewares,
111
+ ...middlewares_29.vendorReturnsMiddlewares,
112
+ ...middlewares_30.vendorSalesChannelsMiddlewares,
113
+ ...middlewares_31.vendorSellersMiddlewares,
114
+ ...middlewares_32.vendorShippingOptionsMiddlewares,
115
+ ...middlewares_33.vendorShippingOptionTypesMiddlewares,
116
+ ...middlewares_34.vendorShippingProfilesMiddlewares,
117
+ ...middlewares_35.vendorStockLocationsMiddlewares,
118
+ ...middlewares_36.vendorStoresMiddlewares,
119
+ ...middlewares_37.vendorUploadsMiddlewares,
120
+ ...middlewares_39.vendorProductTagsMiddlewares,
111
121
  ];
112
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlkZGxld2FyZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvYXBpL3ZlbmRvci9taWRkbGV3YXJlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxtREFHNEI7QUFFNUIseURBQW9FO0FBQ3BFLDJEQUF3RTtBQUN4RSx1REFBZ0U7QUFDaEUsMERBQXNFO0FBQ3RFLHlEQUFvRTtBQUNwRSxxRUFBMkY7QUFDM0YsZ0VBQWlGO0FBQ2pGLCtEQUErRTtBQUMvRSxzREFBOEQ7QUFDOUQsdURBQThEO0FBQzlELHlEQUFrRTtBQUNsRSx3REFBZ0U7QUFDaEUsZ0VBQStFO0FBQy9FLDREQUF1RTtBQUN2RSxrRUFBbUY7QUFDbkYsbUVBQXFGO0FBQ3JGLHlEQUFrRTtBQUNsRSw4REFBMkU7QUFDM0UsaUVBQWlGO0FBQ2pGLDJEQUFzRTtBQUN0RSx3REFBZ0U7QUFDaEUsK0RBQTZFO0FBQzdFLCtEQUE2RTtBQUM3RSx3REFBZ0U7QUFDaEUsK0R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BQzdCLEdBQUcsd0NBQTBCO0lBQzdCLEdBQUcsbURBQXFDO0lBQ3hDLEdBQUcsOENBQWdDO0lBQ25DLEdBQUcsOENBQStCO0lBQ2xDLEdBQUcsc0NBQXVCO0lBQzFCLEdBQUcsMENBQTJCO0lBQzlCLEdBQUcsc0NBQXVCO0lBQzFCLEdBQUcsa0RBQW1DO0lBQ3RDLEdBQUcsd0NBQXlCO0lBQzVCLEdBQUcsdUNBQXdCO0lBQzNCLEdBQUcsOENBQStCO0lBQ2xDLEdBQUcsMENBQTJCO0lBQzlCLEdBQUcsZ0RBQWlDO0lBQ3BDLEdBQUcsaURBQWtDO0lBQ3JDLEdBQUcsaURBQWtDO0lBQ3JDLEdBQUcsd0NBQXlCO0lBQzVCLEdBQUcsNENBQTZCO0lBQ2hDLEdBQUcsK0NBQWdDO0lBQ25DLEdBQUcsMENBQTJCO0lBQzlCLEdBQUcsdUNBQXdCO0lBQzNCLEdBQUcsNkNBQThCO0lBQ2pDLEdBQUcsNENBQTZCO0lBQ2hDLEdBQUcsNkNBQThCO0lBQ2pDLEdBQUcsdUNBQXdCO0lBQzNCLEdBQUcsNkNBQThCO0lBQ2pDLEdBQUcsdUNBQXdCO0lBQzNCLEdBQUcsK0NBQWdDO0lBQ25DLEdBQUcsbURBQW9DO0lBQ3ZDLEdBQUcsZ0RBQWlDO0lBQ3BDLEdBQUcsOENBQStCO0lBQ2xDLEdBQUcsc0NBQXVCO0lBQzFCLEdBQUcsdUNBQXdCO0lBQzNCLEdBQUcsMkNBQTRCO0NBQ2hDLENBQUEifQ==
@@ -0,0 +1,9 @@
1
+ import { HttpTypes } from "@medusajs/framework/types";
2
+ import { AuthenticatedMedusaRequest, MedusaResponse } from "@medusajs/framework/http";
3
+ /**
4
+ * `POST /vendor/order-edits/:id/confirm` — mirrors
5
+ * `POST /admin/order-edits/:id/confirm`. Flips a requested edit to
6
+ * `confirmed` and applies its actions. `confirmed_by` is stamped with
7
+ * the seller's id (vendor equivalent of admin's `actor_id`).
8
+ */
9
+ export declare const POST: (req: AuthenticatedMedusaRequest, res: MedusaResponse<HttpTypes.AdminOrderEditPreviewResponse>) => Promise<void>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.POST = void 0;
4
+ const core_flows_1 = require("@medusajs/core-flows");
5
+ /**
6
+ * `POST /vendor/order-edits/:id/confirm` — mirrors
7
+ * `POST /admin/order-edits/:id/confirm`. Flips a requested edit to
8
+ * `confirmed` and applies its actions. `confirmed_by` is stamped with
9
+ * the seller's id (vendor equivalent of admin's `actor_id`).
10
+ */
11
+ const POST = async (req, res) => {
12
+ const { id } = req.params;
13
+ const { result } = await (0, core_flows_1.confirmOrderEditRequestWorkflow)(req.scope).run({
14
+ input: {
15
+ order_id: id,
16
+ confirmed_by: req.seller_context.seller_id,
17
+ },
18
+ });
19
+ res.json({
20
+ order_preview: result,
21
+ });
22
+ };
23
+ exports.POST = POST;
24
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBpL3ZlbmRvci9vcmRlci1lZGl0cy9baWRdL2NvbmZpcm0vcm91dGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEscURBQXNFO0FBT3RFOzs7OztHQUtHO0FBQ0ksTUFBTSxJQUFJLEdBQUcsS0FBSyxFQUN2QixHQUErQixFQUMvQixHQUE0RCxFQUM1RCxFQUFFO0lBQ0YsTUFBTSxFQUFFLEVBQUUsRUFBRSxHQUFHLEdBQUcsQ0FBQyxNQUFNLENBQUE7SUFFekIsTUFBTSxFQUFFLE1BQU0sRUFBRSxHQUFHLE1BQU0sSUFBQSw0Q0FBK0IsRUFBQyxHQUFHLENBQUMsS0FBSyxDQUFDLENBQUMsR0FBRyxDQUFDO1FBQ3RFLEtBQUssRUFBRTtZQUNMLFFBQVEsRUFBRSxFQUFFO1lBQ1osWUFBWSxFQUFFLEdBQUcsQ0FBQyxjQUFlLENBQUMsU0FBUztTQUM1QztLQUNGLENBQUMsQ0FBQTtJQUVGLEdBQUcsQ0FBQyxJQUFJLENBQUM7UUFDUCxhQUFhLEVBQUUsTUFBZ0Q7S0FDaEUsQ0FBQyxDQUFBO0FBQ0osQ0FBQyxDQUFBO0FBaEJZLFFBQUEsSUFBSSxRQWdCaEIifQ==
@@ -0,0 +1,14 @@
1
+ import { HttpTypes } from "@medusajs/framework/types";
2
+ import { AuthenticatedMedusaRequest, MedusaResponse } from "@medusajs/framework/http";
3
+ import { VendorPostOrderEditsItemsActionReqType } from "../../../validators";
4
+ /**
5
+ * `POST /vendor/order-edits/:id/items/:action_id` — mirrors
6
+ * `POST /admin/order-edits/:id/items/:action_id`. Updates an
7
+ * existing add-item action on the draft.
8
+ */
9
+ export declare const POST: (req: AuthenticatedMedusaRequest<VendorPostOrderEditsItemsActionReqType>, res: MedusaResponse<HttpTypes.AdminOrderEditPreviewResponse>) => Promise<void>;
10
+ /**
11
+ * `DELETE /vendor/order-edits/:id/items/:action_id` — removes the
12
+ * add-item action from the draft.
13
+ */
14
+ export declare const DELETE: (req: AuthenticatedMedusaRequest, res: MedusaResponse<HttpTypes.AdminOrderEditPreviewResponse>) => Promise<void>;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DELETE = exports.POST = void 0;
4
+ const core_flows_1 = require("@medusajs/core-flows");
5
+ /**
6
+ * `POST /vendor/order-edits/:id/items/:action_id` — mirrors
7
+ * `POST /admin/order-edits/:id/items/:action_id`. Updates an
8
+ * existing add-item action on the draft.
9
+ */
10
+ const POST = async (req, res) => {
11
+ const { id, action_id } = req.params;
12
+ const { result } = await (0, core_flows_1.updateOrderEditAddItemWorkflow)(req.scope).run({
13
+ input: {
14
+ data: { ...req.validatedBody },
15
+ order_id: id,
16
+ action_id,
17
+ },
18
+ });
19
+ res.json({
20
+ order_preview: result,
21
+ });
22
+ };
23
+ exports.POST = POST;
24
+ /**
25
+ * `DELETE /vendor/order-edits/:id/items/:action_id` — removes the
26
+ * add-item action from the draft.
27
+ */
28
+ const DELETE = async (req, res) => {
29
+ const { id, action_id } = req.params;
30
+ const { result: orderPreview } = await (0, core_flows_1.removeItemOrderEditActionWorkflow)(req.scope).run({
31
+ input: {
32
+ order_id: id,
33
+ action_id,
34
+ },
35
+ });
36
+ res.json({
37
+ order_preview: orderPreview,
38
+ });
39
+ };
40
+ exports.DELETE = DELETE;
41
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBpL3ZlbmRvci9vcmRlci1lZGl0cy9baWRdL2l0ZW1zL1thY3Rpb25faWRdL3JvdXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFEQUc2QjtBQVM3Qjs7OztHQUlHO0FBQ0ksTUFBTSxJQUFJLEdBQUcsS0FBSyxFQUN2QixHQUF1RSxFQUN2RSxHQUE0RCxFQUM1RCxFQUFFO0lBQ0YsTUFBTSxFQUFFLEVBQUUsRUFBRSxTQUFTLEVBQUUsR0FBRyxHQUFHLENBQUMsTUFBTSxDQUFBO0lBRXBDLE1BQU0sRUFBRSxNQUFNLEVBQUUsR0FBRyxNQUFNLElBQUEsMkNBQThCLEVBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxDQUFDLEdBQUcsQ0FBQztRQUNyRSxLQUFLLEVBQUU7WUFDTCxJQUFJLEVBQUUsRUFBRSxHQUFHLEdBQUcsQ0FBQyxhQUFhLEVBQUU7WUFDOUIsUUFBUSxFQUFFLEVBQUU7WUFDWixTQUFTO1NBQ1Y7S0FDRixDQUFDLENBQUE7SU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