feat: Add support for exporting products in backend (#8214)

CLOSES CC-221
CLOSES CC-223
CLOSES CC-224
This commit is contained in:
Stevche Radevski
2024-07-22 15:40:04 +02:00
committed by GitHub
parent e9f1aafbb1
commit 0d2e7befbd
29 changed files with 615 additions and 690 deletions
+1
View File
@@ -0,0 +1 @@
export * from "./jsontocsv"
+17
View File
@@ -0,0 +1,17 @@
import { json2csv } from "json-2-csv"
export interface ConvertJsonToCsvOptions<T> {}
export const convertJsonToCsv = <T extends object>(
data: T[],
options?: ConvertJsonToCsvOptions<T>
) => {
return json2csv(data, {
prependHeader: true,
arrayIndexesAsKeys: true,
expandNestedObjects: true,
expandArrayObjects: true,
unwindArrays: false,
emptyFieldValue: "",
})
}
+1
View File
@@ -26,5 +26,6 @@ export * from "./shipping"
export * from "./totals"
export * from "./totals/big-number"
export * from "./user"
export * from "./csv"
export const MedusaModuleType = Symbol.for("MedusaModule")
@@ -0,0 +1,9 @@
import { buildEventNamesFromEntityName } from "../event-bus"
import { Modules } from "../modules-sdk"
const eventBaseNames: ["notification"] = ["notification"]
export const NotificationEvents = buildEventNamesFromEntityName(
eventBaseNames,
Modules.NOTIFICATION
)
@@ -1 +1,2 @@
export * from "./abstract-notification-provider"
export * from "./events"