Skip to content

Commit

Permalink
Notion and Airtable output CSV and JSON, JSON now uses array for Audi…
Browse files Browse the repository at this point in the history
…o Role (#21)
  • Loading branch information
orchetect committed Dec 5, 2023
1 parent b7e926c commit 901c281
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,17 @@ extension AirtableExportProfile {
preparedMarkers
)

// skip exporting JSON because we don't need it for Airlift (3rd-party library)
// try jsonWriteManifest(
// jsonPath: payload.jsonPayload.jsonPath,
// noMedia: noMedia,
// preparedMarkers
// )
try jsonWriteManifest(
jsonPath: payload.jsonPayload.jsonPath,
noMedia: noMedia,
preparedMarkers
)
}

public func resultFileContent(payload: Payload) throws -> ExportResult.ResultDictionary {
[
.csvManifestPath: .url(payload.csvPayload.csvPath)
// skip exporting JSON because we don't need it for Airlift (3rd-party library)
// .jsonManifestPath: .url(payload.jsonPayload.jsonPath)
.csvManifestPath: .url(payload.csvPayload.csvPath),
.jsonManifestPath: .url(payload.jsonPayload.jsonPath)
]
}

Expand All @@ -76,6 +74,7 @@ extension AirtableExportProfile {
dict[.eventName] = marker.eventName
dict[.projectName] = marker.projectName
dict[.libraryName] = marker.libraryName
// no iconImage

if !noMedia {
dict[.imageFileName] = marker.imageFileName
Expand Down Expand Up @@ -105,6 +104,7 @@ extension AirtableExportProfile {
dict[.eventName] = .string(marker.eventName)
dict[.projectName] = .string(marker.projectName)
dict[.libraryName] = .string(marker.libraryName)
// no iconImage

if !noMedia {
dict[.imageFileName] = .string(marker.imageFileName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,24 @@ extension NotionExportProfile {
payload: Payload,
noMedia: Bool
) throws {
try csvWriteManifest(csvPath: payload.csvPath, noMedia: noMedia, preparedMarkers)
try csvWriteManifest(
csvPath: payload.csvPayload.csvPath,
noMedia: noMedia,
preparedMarkers
)

try jsonWriteManifest(
jsonPath: payload.jsonPayload.jsonPath,
noMedia: noMedia,
preparedMarkers
)
}

public func resultFileContent(payload: Payload) throws -> ExportResult.ResultDictionary {
[.csvManifestPath: .url(payload.csvPath)]
[
.csvManifestPath: .url(payload.csvPayload.csvPath),
.jsonManifestPath: .url(payload.jsonPayload.jsonPath)
]
}

public func tableManifestFields(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Logging

public class NotionExportProfile: NSObject, ProgressReporting, ExportProfile {
// ExportProfile
public typealias Payload = CSVExportPayload
public typealias Payload = CSVJSONExportPayload
public typealias PreparedMarker = StandardExportMarker
public static let profile: ExportProfileFormat = .notion
public static let isMediaCapable: Bool = true
Expand Down

0 comments on commit 901c281

Please sign in to comment.