feat: Add support for exporting products in backend (#8214)
CLOSES CC-221 CLOSES CC-223 CLOSES CC-224
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export * from "./jsontocsv"
|
||||
@@ -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: "",
|
||||
})
|
||||
}
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user