diff --git a/.gitignore b/.gitignore index 9daa824..0f9fd5a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .DS_Store node_modules +dist +tmp \ No newline at end of file diff --git a/packages/common/.prettierrc b/.prettierrc similarity index 100% rename from packages/common/.prettierrc rename to .prettierrc diff --git a/packages/app/.gitignore b/apps/app/.gitignore similarity index 100% rename from packages/app/.gitignore rename to apps/app/.gitignore diff --git a/packages/app/Brand/Assets.xcassets/AccentBlue.colorset/Contents.json b/apps/app/Brand/Assets.xcassets/AccentBlue.colorset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/AccentBlue.colorset/Contents.json rename to apps/app/Brand/Assets.xcassets/AccentBlue.colorset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/AccentColor.colorset/Contents.json b/apps/app/Brand/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/AccentColor.colorset/Contents.json rename to apps/app/Brand/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/Contents.json b/apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/Contents.json rename to apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_1024.png b/apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_1024.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_1024.png rename to apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_1024.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_120.png b/apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_120.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_120.png rename to apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_120.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_152.png b/apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_152.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_152.png rename to apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_152.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_167.png b/apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_167.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_167.png rename to apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_167.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_180.png b/apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_180.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_180.png rename to apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_180.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_20.png b/apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_20.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_20.png rename to apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_20.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_29.png b/apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_29.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_29.png rename to apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_29.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_40.png b/apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_40.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_40.png rename to apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_40.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_58.png b/apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_58.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_58.png rename to apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_58.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_60.png b/apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_60.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_60.png rename to apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_60.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_76.png b/apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_76.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_76.png rename to apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_76.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_80.png b/apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_80.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_80.png rename to apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_80.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_87.png b/apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_87.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_87.png rename to apps/app/Brand/Assets.xcassets/AppIcon-iOS.appiconset/icon_87.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/Contents.json b/apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/Contents.json rename to apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_1024.png b/apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_1024.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_1024.png rename to apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_1024.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_128.png b/apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_128.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_128.png rename to apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_128.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_16.png b/apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_16.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_16.png rename to apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_16.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_256.png b/apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_256.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_256.png rename to apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_256.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_32.png b/apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_32.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_32.png rename to apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_32.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_512.png b/apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_512.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_512.png rename to apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_512.png diff --git a/packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_64.png b/apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_64.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_64.png rename to apps/app/Brand/Assets.xcassets/AppIcon-macOS.appiconset/icon_64.png diff --git a/packages/app/Brand/Assets.xcassets/Background.colorset/Contents.json b/apps/app/Brand/Assets.xcassets/Background.colorset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/Background.colorset/Contents.json rename to apps/app/Brand/Assets.xcassets/Background.colorset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/Brown.colorset/Contents.json b/apps/app/Brand/Assets.xcassets/Brown.colorset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/Brown.colorset/Contents.json rename to apps/app/Brand/Assets.xcassets/Brown.colorset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/Contents.json b/apps/app/Brand/Assets.xcassets/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/Contents.json rename to apps/app/Brand/Assets.xcassets/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/CrateGlyph.imageset/Contents.json b/apps/app/Brand/Assets.xcassets/CrateGlyph.imageset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/CrateGlyph.imageset/Contents.json rename to apps/app/Brand/Assets.xcassets/CrateGlyph.imageset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/CrateGlyph.imageset/dark-crate-glyph.svg b/apps/app/Brand/Assets.xcassets/CrateGlyph.imageset/dark-crate-glyph.svg similarity index 100% rename from packages/app/Brand/Assets.xcassets/CrateGlyph.imageset/dark-crate-glyph.svg rename to apps/app/Brand/Assets.xcassets/CrateGlyph.imageset/dark-crate-glyph.svg diff --git a/packages/app/Brand/Assets.xcassets/CrateGlyph.imageset/light-crate-glyph.svg b/apps/app/Brand/Assets.xcassets/CrateGlyph.imageset/light-crate-glyph.svg similarity index 100% rename from packages/app/Brand/Assets.xcassets/CrateGlyph.imageset/light-crate-glyph.svg rename to apps/app/Brand/Assets.xcassets/CrateGlyph.imageset/light-crate-glyph.svg diff --git a/packages/app/Brand/Assets.xcassets/CrateSymbol.symbolset/Contents.json b/apps/app/Brand/Assets.xcassets/CrateSymbol.symbolset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/CrateSymbol.symbolset/Contents.json rename to apps/app/Brand/Assets.xcassets/CrateSymbol.symbolset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/CrateSymbol.symbolset/crate.svg b/apps/app/Brand/Assets.xcassets/CrateSymbol.symbolset/crate.svg similarity index 100% rename from packages/app/Brand/Assets.xcassets/CrateSymbol.symbolset/crate.svg rename to apps/app/Brand/Assets.xcassets/CrateSymbol.symbolset/crate.svg diff --git a/packages/app/Brand/Assets.xcassets/DeepBlue.colorset/Contents.json b/apps/app/Brand/Assets.xcassets/DeepBlue.colorset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/DeepBlue.colorset/Contents.json rename to apps/app/Brand/Assets.xcassets/DeepBlue.colorset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/GitHub Logo.imageset/Contents.json b/apps/app/Brand/Assets.xcassets/GitHub Logo.imageset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/GitHub Logo.imageset/Contents.json rename to apps/app/Brand/Assets.xcassets/GitHub Logo.imageset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/GitHub Logo.imageset/GitHub_Mark.png b/apps/app/Brand/Assets.xcassets/GitHub Logo.imageset/GitHub_Mark.png similarity index 100% rename from packages/app/Brand/Assets.xcassets/GitHub Logo.imageset/GitHub_Mark.png rename to apps/app/Brand/Assets.xcassets/GitHub Logo.imageset/GitHub_Mark.png diff --git a/packages/app/Brand/Assets.xcassets/Google Logo.imageset/Contents.json b/apps/app/Brand/Assets.xcassets/Google Logo.imageset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/Google Logo.imageset/Contents.json rename to apps/app/Brand/Assets.xcassets/Google Logo.imageset/Contents.json diff --git "a/packages/app/Brand/Assets.xcassets/Google Logo.imageset/Google_\"G\"_Logo.svg.png" "b/apps/app/Brand/Assets.xcassets/Google Logo.imageset/Google_\"G\"_Logo.svg.png" similarity index 100% rename from "packages/app/Brand/Assets.xcassets/Google Logo.imageset/Google_\"G\"_Logo.svg.png" rename to "apps/app/Brand/Assets.xcassets/Google Logo.imageset/Google_\"G\"_Logo.svg.png" diff --git a/packages/app/Brand/Assets.xcassets/Orange.colorset/Contents.json b/apps/app/Brand/Assets.xcassets/Orange.colorset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/Orange.colorset/Contents.json rename to apps/app/Brand/Assets.xcassets/Orange.colorset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/SecondaryBackground.colorset/Contents.json b/apps/app/Brand/Assets.xcassets/SecondaryBackground.colorset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/SecondaryBackground.colorset/Contents.json rename to apps/app/Brand/Assets.xcassets/SecondaryBackground.colorset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/SecondaryText.colorset/Contents.json b/apps/app/Brand/Assets.xcassets/SecondaryText.colorset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/SecondaryText.colorset/Contents.json rename to apps/app/Brand/Assets.xcassets/SecondaryText.colorset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/SystemBackground.colorset/Contents.json b/apps/app/Brand/Assets.xcassets/SystemBackground.colorset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/SystemBackground.colorset/Contents.json rename to apps/app/Brand/Assets.xcassets/SystemBackground.colorset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/TertiaryText.colorset/Contents.json b/apps/app/Brand/Assets.xcassets/TertiaryText.colorset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/TertiaryText.colorset/Contents.json rename to apps/app/Brand/Assets.xcassets/TertiaryText.colorset/Contents.json diff --git a/packages/app/Brand/Assets.xcassets/Text.colorset/Contents.json b/apps/app/Brand/Assets.xcassets/Text.colorset/Contents.json similarity index 100% rename from packages/app/Brand/Assets.xcassets/Text.colorset/Contents.json rename to apps/app/Brand/Assets.xcassets/Text.colorset/Contents.json diff --git a/packages/app/Brand/Color.swift b/apps/app/Brand/Color.swift similarity index 100% rename from packages/app/Brand/Color.swift rename to apps/app/Brand/Color.swift diff --git a/packages/app/Crate (iOS)Debug.entitlements b/apps/app/Crate (iOS)Debug.entitlements similarity index 100% rename from packages/app/Crate (iOS)Debug.entitlements rename to apps/app/Crate (iOS)Debug.entitlements diff --git a/packages/app/Crate (macOS).entitlements b/apps/app/Crate (macOS).entitlements similarity index 100% rename from packages/app/Crate (macOS).entitlements rename to apps/app/Crate (macOS).entitlements diff --git a/packages/app/Crate--iOS--Info.plist b/apps/app/Crate--iOS--Info.plist similarity index 100% rename from packages/app/Crate--iOS--Info.plist rename to apps/app/Crate--iOS--Info.plist diff --git a/packages/app/Crate--macOS--Info.plist b/apps/app/Crate--macOS--Info.plist similarity index 100% rename from packages/app/Crate--macOS--Info.plist rename to apps/app/Crate--macOS--Info.plist diff --git a/packages/app/Crate.entitlements b/apps/app/Crate.entitlements similarity index 100% rename from packages/app/Crate.entitlements rename to apps/app/Crate.entitlements diff --git a/packages/app/Crate.xcodeproj/project.pbxproj b/apps/app/Crate.xcodeproj/project.pbxproj similarity index 100% rename from packages/app/Crate.xcodeproj/project.pbxproj rename to apps/app/Crate.xcodeproj/project.pbxproj diff --git a/packages/app/Crate.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/apps/app/Crate.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from packages/app/Crate.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to apps/app/Crate.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/packages/app/Crate.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/app/Crate.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from packages/app/Crate.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to apps/app/Crate.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/packages/app/Crate.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/apps/app/Crate.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved similarity index 100% rename from packages/app/Crate.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved rename to apps/app/Crate.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/packages/app/Crate.xcodeproj/xcshareddata/xcschemes/Crate (iOS).xcscheme b/apps/app/Crate.xcodeproj/xcshareddata/xcschemes/Crate (iOS).xcscheme similarity index 100% rename from packages/app/Crate.xcodeproj/xcshareddata/xcschemes/Crate (iOS).xcscheme rename to apps/app/Crate.xcodeproj/xcshareddata/xcschemes/Crate (iOS).xcscheme diff --git a/packages/app/Crate.xcodeproj/xcshareddata/xcschemes/Crate (macOS).xcscheme b/apps/app/Crate.xcodeproj/xcshareddata/xcschemes/Crate (macOS).xcscheme similarity index 100% rename from packages/app/Crate.xcodeproj/xcshareddata/xcschemes/Crate (macOS).xcscheme rename to apps/app/Crate.xcodeproj/xcshareddata/xcschemes/Crate (macOS).xcscheme diff --git a/packages/app/CrateDataProvider.swift b/apps/app/CrateDataProvider.swift similarity index 100% rename from packages/app/CrateDataProvider.swift rename to apps/app/CrateDataProvider.swift diff --git a/packages/app/CrateFilesAppProvider/CrateFilesAppProvider.entitlements b/apps/app/CrateFilesAppProvider/CrateFilesAppProvider.entitlements similarity index 100% rename from packages/app/CrateFilesAppProvider/CrateFilesAppProvider.entitlements rename to apps/app/CrateFilesAppProvider/CrateFilesAppProvider.entitlements diff --git a/packages/app/CrateFilesAppProvider/CrateFilesAppProviderDebug.entitlements b/apps/app/CrateFilesAppProvider/CrateFilesAppProviderDebug.entitlements similarity index 100% rename from packages/app/CrateFilesAppProvider/CrateFilesAppProviderDebug.entitlements rename to apps/app/CrateFilesAppProvider/CrateFilesAppProviderDebug.entitlements diff --git a/packages/app/CrateFilesAppProvider/FileProviderEnumerator.swift b/apps/app/CrateFilesAppProvider/FileProviderEnumerator.swift similarity index 100% rename from packages/app/CrateFilesAppProvider/FileProviderEnumerator.swift rename to apps/app/CrateFilesAppProvider/FileProviderEnumerator.swift diff --git a/packages/app/CrateFilesAppProvider/FileProviderExtension.swift b/apps/app/CrateFilesAppProvider/FileProviderExtension.swift similarity index 100% rename from packages/app/CrateFilesAppProvider/FileProviderExtension.swift rename to apps/app/CrateFilesAppProvider/FileProviderExtension.swift diff --git a/packages/app/CrateFilesAppProvider/FileProviderItem.swift b/apps/app/CrateFilesAppProvider/FileProviderItem.swift similarity index 100% rename from packages/app/CrateFilesAppProvider/FileProviderItem.swift rename to apps/app/CrateFilesAppProvider/FileProviderItem.swift diff --git a/packages/app/CrateFilesAppProvider/Info.plist b/apps/app/CrateFilesAppProvider/Info.plist similarity index 100% rename from packages/app/CrateFilesAppProvider/Info.plist rename to apps/app/CrateFilesAppProvider/Info.plist diff --git a/packages/app/CrateFilesAppProviderUI/Base.lproj/MainInterface.storyboard b/apps/app/CrateFilesAppProviderUI/Base.lproj/MainInterface.storyboard similarity index 100% rename from packages/app/CrateFilesAppProviderUI/Base.lproj/MainInterface.storyboard rename to apps/app/CrateFilesAppProviderUI/Base.lproj/MainInterface.storyboard diff --git a/packages/app/CrateFilesAppProviderUI/CrateFilesAppProviderUI.entitlements b/apps/app/CrateFilesAppProviderUI/CrateFilesAppProviderUI.entitlements similarity index 100% rename from packages/app/CrateFilesAppProviderUI/CrateFilesAppProviderUI.entitlements rename to apps/app/CrateFilesAppProviderUI/CrateFilesAppProviderUI.entitlements diff --git a/packages/app/CrateFilesAppProviderUI/DocumentActionViewController.swift b/apps/app/CrateFilesAppProviderUI/DocumentActionViewController.swift similarity index 100% rename from packages/app/CrateFilesAppProviderUI/DocumentActionViewController.swift rename to apps/app/CrateFilesAppProviderUI/DocumentActionViewController.swift diff --git a/packages/app/CrateFilesAppProviderUI/Info.plist b/apps/app/CrateFilesAppProviderUI/Info.plist similarity index 100% rename from packages/app/CrateFilesAppProviderUI/Info.plist rename to apps/app/CrateFilesAppProviderUI/Info.plist diff --git a/packages/app/CrateFinderProvider/CrateFinderProvider.entitlements b/apps/app/CrateFinderProvider/CrateFinderProvider.entitlements similarity index 100% rename from packages/app/CrateFinderProvider/CrateFinderProvider.entitlements rename to apps/app/CrateFinderProvider/CrateFinderProvider.entitlements diff --git a/packages/app/CrateFinderProvider/CrateFinderRegistration.swift b/apps/app/CrateFinderProvider/CrateFinderRegistration.swift similarity index 100% rename from packages/app/CrateFinderProvider/CrateFinderRegistration.swift rename to apps/app/CrateFinderProvider/CrateFinderRegistration.swift diff --git a/packages/app/CrateFinderProvider/FileProviderEnumerator.swift b/apps/app/CrateFinderProvider/FileProviderEnumerator.swift similarity index 100% rename from packages/app/CrateFinderProvider/FileProviderEnumerator.swift rename to apps/app/CrateFinderProvider/FileProviderEnumerator.swift diff --git a/packages/app/CrateFinderProvider/FileProviderExtension.swift b/apps/app/CrateFinderProvider/FileProviderExtension.swift similarity index 100% rename from packages/app/CrateFinderProvider/FileProviderExtension.swift rename to apps/app/CrateFinderProvider/FileProviderExtension.swift diff --git a/packages/app/CrateFinderProvider/FileProviderItem.swift b/apps/app/CrateFinderProvider/FileProviderItem.swift similarity index 100% rename from packages/app/CrateFinderProvider/FileProviderItem.swift rename to apps/app/CrateFinderProvider/FileProviderItem.swift diff --git a/packages/app/CrateFinderProvider/Info.plist b/apps/app/CrateFinderProvider/Info.plist similarity index 100% rename from packages/app/CrateFinderProvider/Info.plist rename to apps/app/CrateFinderProvider/Info.plist diff --git a/packages/app/Model/CoreDataManager.swift b/apps/app/Model/CoreDataManager.swift similarity index 100% rename from packages/app/Model/CoreDataManager.swift rename to apps/app/Model/CoreDataManager.swift diff --git a/packages/app/Model/CrateModel.xcdatamodeld/CrateModel.xcdatamodel/contents b/apps/app/Model/CrateModel.xcdatamodeld/CrateModel.xcdatamodel/contents similarity index 100% rename from packages/app/Model/CrateModel.xcdatamodeld/CrateModel.xcdatamodel/contents rename to apps/app/Model/CrateModel.xcdatamodeld/CrateModel.xcdatamodel/contents diff --git a/packages/app/README.md b/apps/app/README.md similarity index 100% rename from packages/app/README.md rename to apps/app/README.md diff --git a/packages/app/Server/Crypto.swift b/apps/app/Server/Crypto.swift similarity index 100% rename from packages/app/Server/Crypto.swift rename to apps/app/Server/Crypto.swift diff --git a/packages/app/Server/IPFS/IPFSCore.swift b/apps/app/Server/IPFS/IPFSCore.swift similarity index 100% rename from packages/app/Server/IPFS/IPFSCore.swift rename to apps/app/Server/IPFS/IPFSCore.swift diff --git a/packages/app/Server/IPFS/IPFSExternalCore.swift b/apps/app/Server/IPFS/IPFSExternalCore.swift similarity index 100% rename from packages/app/Server/IPFS/IPFSExternalCore.swift rename to apps/app/Server/IPFS/IPFSExternalCore.swift diff --git a/packages/app/Server/IPFS/IPFSGateway.swift b/apps/app/Server/IPFS/IPFSGateway.swift similarity index 100% rename from packages/app/Server/IPFS/IPFSGateway.swift rename to apps/app/Server/IPFS/IPFSGateway.swift diff --git a/packages/app/Server/IPFS/IPFSTypes.swift b/apps/app/Server/IPFS/IPFSTypes.swift similarity index 100% rename from packages/app/Server/IPFS/IPFSTypes.swift rename to apps/app/Server/IPFS/IPFSTypes.swift diff --git a/packages/app/Server/Random.swift b/apps/app/Server/Random.swift similarity index 100% rename from packages/app/Server/Random.swift rename to apps/app/Server/Random.swift diff --git a/packages/app/Server/SHA256.swift b/apps/app/Server/SHA256.swift similarity index 100% rename from packages/app/Server/SHA256.swift rename to apps/app/Server/SHA256.swift diff --git a/packages/app/Shared/Crate/Account.swift b/apps/app/Shared/Crate/Account.swift similarity index 100% rename from packages/app/Shared/Crate/Account.swift rename to apps/app/Shared/Crate/Account.swift diff --git a/packages/app/Tests iOS/Tests_iOS.swift b/apps/app/Tests iOS/Tests_iOS.swift similarity index 100% rename from packages/app/Tests iOS/Tests_iOS.swift rename to apps/app/Tests iOS/Tests_iOS.swift diff --git a/packages/app/Tests macOS/Tests_macOS.swift b/apps/app/Tests macOS/Tests_macOS.swift similarity index 100% rename from packages/app/Tests macOS/Tests_macOS.swift rename to apps/app/Tests macOS/Tests_macOS.swift diff --git a/packages/app/User/ASAccount.swift b/apps/app/User/ASAccount.swift similarity index 100% rename from packages/app/User/ASAccount.swift rename to apps/app/User/ASAccount.swift diff --git a/packages/app/User/CrateAppConstants.swift b/apps/app/User/CrateAppConstants.swift similarity index 100% rename from packages/app/User/CrateAppConstants.swift rename to apps/app/User/CrateAppConstants.swift diff --git a/packages/app/User/CrateAuthentication.swift b/apps/app/User/CrateAuthentication.swift similarity index 100% rename from packages/app/User/CrateAuthentication.swift rename to apps/app/User/CrateAuthentication.swift diff --git a/packages/app/User/CrateUser.swift b/apps/app/User/CrateUser.swift similarity index 100% rename from packages/app/User/CrateUser.swift rename to apps/app/User/CrateUser.swift diff --git a/packages/app/User/FirebaseConstants.swift b/apps/app/User/FirebaseConstants.swift similarity index 100% rename from packages/app/User/FirebaseConstants.swift rename to apps/app/User/FirebaseConstants.swift diff --git a/packages/app/Vendor/Fonts/iAWriterQuattroS-Bold.ttf b/apps/app/Vendor/Fonts/iAWriterQuattroS-Bold.ttf similarity index 100% rename from packages/app/Vendor/Fonts/iAWriterQuattroS-Bold.ttf rename to apps/app/Vendor/Fonts/iAWriterQuattroS-Bold.ttf diff --git a/packages/app/Vendor/Fonts/iAWriterQuattroS-BoldItalic.ttf b/apps/app/Vendor/Fonts/iAWriterQuattroS-BoldItalic.ttf similarity index 100% rename from packages/app/Vendor/Fonts/iAWriterQuattroS-BoldItalic.ttf rename to apps/app/Vendor/Fonts/iAWriterQuattroS-BoldItalic.ttf diff --git a/packages/app/Vendor/Fonts/iAWriterQuattroS-Italic.ttf b/apps/app/Vendor/Fonts/iAWriterQuattroS-Italic.ttf similarity index 100% rename from packages/app/Vendor/Fonts/iAWriterQuattroS-Italic.ttf rename to apps/app/Vendor/Fonts/iAWriterQuattroS-Italic.ttf diff --git a/packages/app/Vendor/Fonts/iAWriterQuattroS-Regular.ttf b/apps/app/Vendor/Fonts/iAWriterQuattroS-Regular.ttf similarity index 100% rename from packages/app/Vendor/Fonts/iAWriterQuattroS-Regular.ttf rename to apps/app/Vendor/Fonts/iAWriterQuattroS-Regular.ttf diff --git a/packages/app/Views/Authenticate.swift b/apps/app/Views/Authenticate.swift similarity index 100% rename from packages/app/Views/Authenticate.swift rename to apps/app/Views/Authenticate.swift diff --git a/packages/app/Views/BrowseView.swift b/apps/app/Views/BrowseView.swift similarity index 100% rename from packages/app/Views/BrowseView.swift rename to apps/app/Views/BrowseView.swift diff --git a/packages/app/Views/CrateApp.swift b/apps/app/Views/CrateApp.swift similarity index 100% rename from packages/app/Views/CrateApp.swift rename to apps/app/Views/CrateApp.swift diff --git a/packages/app/Views/Files/FilesColumn.swift b/apps/app/Views/Files/FilesColumn.swift similarity index 100% rename from packages/app/Views/Files/FilesColumn.swift rename to apps/app/Views/Files/FilesColumn.swift diff --git a/packages/app/Views/Files/FilesGrid.swift b/apps/app/Views/Files/FilesGrid.swift similarity index 100% rename from packages/app/Views/Files/FilesGrid.swift rename to apps/app/Views/Files/FilesGrid.swift diff --git a/packages/app/Views/Files/FilesList.swift b/apps/app/Views/Files/FilesList.swift similarity index 100% rename from packages/app/Views/Files/FilesList.swift rename to apps/app/Views/Files/FilesList.swift diff --git a/packages/app/Views/Files/FilesView.swift b/apps/app/Views/Files/FilesView.swift similarity index 100% rename from packages/app/Views/Files/FilesView.swift rename to apps/app/Views/Files/FilesView.swift diff --git a/packages/app/Views/Files/NodeContextMenu.swift b/apps/app/Views/Files/NodeContextMenu.swift similarity index 100% rename from packages/app/Views/Files/NodeContextMenu.swift rename to apps/app/Views/Files/NodeContextMenu.swift diff --git a/packages/app/Views/Files/NodeIcon.swift b/apps/app/Views/Files/NodeIcon.swift similarity index 100% rename from packages/app/Views/Files/NodeIcon.swift rename to apps/app/Views/Files/NodeIcon.swift diff --git a/packages/app/Views/Settings/AccountSettingsView.swift b/apps/app/Views/Settings/AccountSettingsView.swift similarity index 100% rename from packages/app/Views/Settings/AccountSettingsView.swift rename to apps/app/Views/Settings/AccountSettingsView.swift diff --git a/packages/app/Views/Settings/NetworkSettingsView.swift b/apps/app/Views/Settings/NetworkSettingsView.swift similarity index 100% rename from packages/app/Views/Settings/NetworkSettingsView.swift rename to apps/app/Views/Settings/NetworkSettingsView.swift diff --git a/packages/app/Views/Settings/SectionHeader.swift b/apps/app/Views/Settings/SectionHeader.swift similarity index 100% rename from packages/app/Views/Settings/SectionHeader.swift rename to apps/app/Views/Settings/SectionHeader.swift diff --git a/packages/app/Views/Settings/StorageSettingsView.swift b/apps/app/Views/Settings/StorageSettingsView.swift similarity index 100% rename from packages/app/Views/Settings/StorageSettingsView.swift rename to apps/app/Views/Settings/StorageSettingsView.swift diff --git a/packages/app/Views/Settings/SyncSettingsView.swift b/apps/app/Views/Settings/SyncSettingsView.swift similarity index 100% rename from packages/app/Views/Settings/SyncSettingsView.swift rename to apps/app/Views/Settings/SyncSettingsView.swift diff --git a/packages/app/Views/Sidebar.swift b/apps/app/Views/Sidebar.swift similarity index 100% rename from packages/app/Views/Sidebar.swift rename to apps/app/Views/Sidebar.swift diff --git a/packages/app/Views/Status/FilesIndicator.swift b/apps/app/Views/Status/FilesIndicator.swift similarity index 100% rename from packages/app/Views/Status/FilesIndicator.swift rename to apps/app/Views/Status/FilesIndicator.swift diff --git a/packages/app/Views/Status/IPFSIndicator.swift b/apps/app/Views/Status/IPFSIndicator.swift similarity index 100% rename from packages/app/Views/Status/IPFSIndicator.swift rename to apps/app/Views/Status/IPFSIndicator.swift diff --git a/packages/app/Views/Status/StatusView.swift b/apps/app/Views/Status/StatusView.swift similarity index 100% rename from packages/app/Views/Status/StatusView.swift rename to apps/app/Views/Status/StatusView.swift diff --git a/packages/app/Views/iOS/ContentView.swift b/apps/app/Views/iOS/ContentView.swift similarity index 100% rename from packages/app/Views/iOS/ContentView.swift rename to apps/app/Views/iOS/ContentView.swift diff --git a/packages/app/Views/iOS/HomeView.swift b/apps/app/Views/iOS/HomeView.swift similarity index 100% rename from packages/app/Views/iOS/HomeView.swift rename to apps/app/Views/iOS/HomeView.swift diff --git a/packages/app/Views/iOS/QuickLookView.swift b/apps/app/Views/iOS/QuickLookView.swift similarity index 100% rename from packages/app/Views/iOS/QuickLookView.swift rename to apps/app/Views/iOS/QuickLookView.swift diff --git a/packages/app/Views/iOS/SettingsView.swift b/apps/app/Views/iOS/SettingsView.swift similarity index 100% rename from packages/app/Views/iOS/SettingsView.swift rename to apps/app/Views/iOS/SettingsView.swift diff --git a/packages/app/Views/iOS/TabBar.swift b/apps/app/Views/iOS/TabBar.swift similarity index 100% rename from packages/app/Views/iOS/TabBar.swift rename to apps/app/Views/iOS/TabBar.swift diff --git a/packages/app/Views/macOS/ContentView.swift b/apps/app/Views/macOS/ContentView.swift similarity index 100% rename from packages/app/Views/macOS/ContentView.swift rename to apps/app/Views/macOS/ContentView.swift diff --git a/packages/app/Views/macOS/NavigationStack.swift b/apps/app/Views/macOS/NavigationStack.swift similarity index 100% rename from packages/app/Views/macOS/NavigationStack.swift rename to apps/app/Views/macOS/NavigationStack.swift diff --git a/packages/app/Views/macOS/SettingsView.swift b/apps/app/Views/macOS/SettingsView.swift similarity index 100% rename from packages/app/Views/macOS/SettingsView.swift rename to apps/app/Views/macOS/SettingsView.swift diff --git a/packages/app/Views/macOS/SignInWithAppleButton.swift b/apps/app/Views/macOS/SignInWithAppleButton.swift similarity index 100% rename from packages/app/Views/macOS/SignInWithAppleButton.swift rename to apps/app/Views/macOS/SignInWithAppleButton.swift diff --git a/packages/app/project.json b/apps/app/project.json similarity index 100% rename from packages/app/project.json rename to apps/app/project.json diff --git a/packages/ipfs-node/CHANGELOG.md b/apps/ipfs-node/CHANGELOG.md similarity index 100% rename from packages/ipfs-node/CHANGELOG.md rename to apps/ipfs-node/CHANGELOG.md diff --git a/packages/ipfs-node/Dockerfile b/apps/ipfs-node/Dockerfile similarity index 100% rename from packages/ipfs-node/Dockerfile rename to apps/ipfs-node/Dockerfile diff --git a/packages/ipfs-node/README.md b/apps/ipfs-node/README.md similarity index 98% rename from packages/ipfs-node/README.md rename to apps/ipfs-node/README.md index 1219cb4..170ef89 100644 --- a/packages/ipfs-node/README.md +++ b/apps/ipfs-node/README.md @@ -5,4 +5,4 @@ This folder contains a Dockerfile which builds a modified go-ipfs microservice, ``` export PINATA_KEY=xxxxxxxxx docker run -e PINATA_KEY=$PINATA_KEY -p 5001:5001 --rm ghcr.io/crate-network/ipfs -``` \ No newline at end of file +``` diff --git a/packages/ipfs-node/docker-compose.yml b/apps/ipfs-node/docker-compose.yml similarity index 84% rename from packages/ipfs-node/docker-compose.yml rename to apps/ipfs-node/docker-compose.yml index 0f75241..0d59623 100644 --- a/packages/ipfs-node/docker-compose.yml +++ b/apps/ipfs-node/docker-compose.yml @@ -5,4 +5,4 @@ services: - 4001:4001 - 5001:5001 - 8080:8080 - - 5353:5353 \ No newline at end of file + - 5353:5353 diff --git a/packages/ipfs-node/ipfs-config.sh b/apps/ipfs-node/ipfs-config.sh similarity index 100% rename from packages/ipfs-node/ipfs-config.sh rename to apps/ipfs-node/ipfs-config.sh diff --git a/apps/ipfs-node/package.json b/apps/ipfs-node/package.json new file mode 100644 index 0000000..94391a7 --- /dev/null +++ b/apps/ipfs-node/package.json @@ -0,0 +1,5 @@ +{ + "name": "@crate/ipfs", + "author": "Christian van der Loo", + "version": "0.0.2" +} diff --git a/packages/ipfs-node/project.json b/apps/ipfs-node/project.json similarity index 74% rename from packages/ipfs-node/project.json rename to apps/ipfs-node/project.json index 911851d..f91b6b6 100644 --- a/packages/ipfs-node/project.json +++ b/apps/ipfs-node/project.json @@ -1,6 +1,6 @@ { "name": "@crate/ipfs", - "sourceRoot": "packages/ipfs-node/", + "sourceRoot": "apps/ipfs-node/", "projectType": "application", "targets": { "docker": { @@ -24,6 +24,15 @@ } } }, + "dev": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "command": "docker compose up --build", + "color": true, + "cwd": "packages/ipfs-node", + "readyWhen": "Attaching to" + } + }, "version": { "executor": "@jscutlery/semver:version", "options": { diff --git a/packages/server/.dockerignore b/apps/server/.dockerignore similarity index 100% rename from packages/server/.dockerignore rename to apps/server/.dockerignore diff --git a/packages/server/.eslintrc.json b/apps/server/.eslintrc.json similarity index 64% rename from packages/server/.eslintrc.json rename to apps/server/.eslintrc.json index 5fb0138..b68c8f1 100644 --- a/packages/server/.eslintrc.json +++ b/apps/server/.eslintrc.json @@ -7,21 +7,14 @@ "es2021": true, "node": true }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended" - ], "files": ["*.ts", "*.js"], - "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaFeatures": { "jsx": true }, "ecmaVersion": "latest", "sourceType": "module" - }, - "plugins": ["@typescript-eslint"], - "rules": {} + } } ] } diff --git a/packages/server/.gitignore b/apps/server/.gitignore similarity index 100% rename from packages/server/.gitignore rename to apps/server/.gitignore diff --git a/packages/server/CHANGELOG.md b/apps/server/CHANGELOG.md similarity index 100% rename from packages/server/CHANGELOG.md rename to apps/server/CHANGELOG.md diff --git a/packages/server/Dockerfile b/apps/server/Dockerfile similarity index 100% rename from packages/server/Dockerfile rename to apps/server/Dockerfile diff --git a/packages/server/README.md b/apps/server/README.md similarity index 100% rename from packages/server/README.md rename to apps/server/README.md diff --git a/apps/server/jest.config.ts b/apps/server/jest.config.ts new file mode 100644 index 0000000..dbf70db --- /dev/null +++ b/apps/server/jest.config.ts @@ -0,0 +1,15 @@ +/* eslint-disable */ +export default { + displayName: "@crate/server", + preset: "../../jest.preset.js", + globals: { + "ts-jest": { + tsconfig: "/tsconfig.spec.json", + }, + }, + transform: { + "^.+\\.[tj]s$": "ts-jest", + }, + moduleFileExtensions: ["ts", "js", "html"], + coverageDirectory: "../../coverage/apps/server", +} diff --git a/packages/server/nodemon.json b/apps/server/nodemon.json similarity index 100% rename from packages/server/nodemon.json rename to apps/server/nodemon.json diff --git a/packages/server/package.json b/apps/server/package.json similarity index 78% rename from packages/server/package.json rename to apps/server/package.json index 1ed9fc6..d3992aa 100644 --- a/packages/server/package.json +++ b/apps/server/package.json @@ -6,14 +6,8 @@ "lint-staged": { "*.{js,ts}": "eslint --cache --fix" }, - "scripts": { - "start": "node dist/index.js", - "dev": "nodemon src/init.ts --dev", - "build": "esbuild src/init.ts --bundle --platform=node --outfile=dist/index.js", - "postinstall": "patch-package", - "lint": "eslint . --max-warnings=0" - }, "devDependencies": { + "@types/express": "^4.17.13", "@types/express-fileupload": "^1.2.2", "@typescript-eslint/eslint-plugin": "^5.30.5", "@typescript-eslint/parser": "^5.30.5", @@ -23,10 +17,13 @@ "nodemon": "^2.0.18" }, "dependencies": { + "@crate/common": "*", "@filecoin-shipyard/lotus-client-provider-nodejs": "^1.1.1", "@filecoin-shipyard/lotus-client-rpc": "^1.2.0", "@filecoin-shipyard/lotus-client-schema": "^4.2.0", "@ipld/dag-pb": "^2.1.17", + "@types/morgan": "^1.9.3", + "body-parser": "^1.20.0", "dotenv": "^16.0.1", "express": "^4.18.1", "express-fileupload": "^1.4.0", diff --git a/packages/server/project.json b/apps/server/project.json similarity index 54% rename from packages/server/project.json rename to apps/server/project.json index 8bce3a3..a0745ce 100644 --- a/packages/server/project.json +++ b/apps/server/project.json @@ -1,8 +1,18 @@ { "name": "@crate/server", - "sourceRoot": "packages/server/", + "sourceRoot": "apps/server/src", "projectType": "application", "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/apps/server", + "main": "apps/server/src/index.ts", + "tsConfig": "apps/server/tsconfig.lib.json", + "assets": ["apps/server/*.md"] + } + }, "docker": { "executor": "@nx-tools/nx-docker:build", "options": { @@ -25,6 +35,21 @@ } } }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["apps/server/**/*.ts"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/apps/server"], + "options": { + "jestConfig": "apps/server/jest.config.ts", + "passWithNoTests": true + } + }, "version": { "executor": "@jscutlery/semver:version", "options": { diff --git a/apps/server/src/app.ts b/apps/server/src/app.ts new file mode 100644 index 0000000..cc3f093 --- /dev/null +++ b/apps/server/src/app.ts @@ -0,0 +1,61 @@ +import express from "express" +import { auth } from "./firebase" +import files from "./routes/files-route" +import fileUpload from "express-fileupload" +import pinning from "./routes/pinning-route" +import logger from "./logger" +import morgan from "morgan" + +// const args = process.argv.slice(2); +const app = express() + +const API_VERSION = "v1" +const API_ROUTE = `/api/${API_VERSION}` + +app.use(morgan("tiny")) +app.use(async (req, res, next) => { + const authHeader = req.headers.authorization + + if (!authHeader) { + res.sendStatus(403) + return + } + + const [type, token] = authHeader.split(" ") + + if (!token || type !== "Bearer") { + res.status(403).send("Invalid request.") + return + } + + // if (process.env.NODE_ENV === "production") { + auth + .verifyIdToken(token) + .then((decodedToken) => { + req.token = decodedToken + next() + }) + .catch((err) => { + res.status(403).send("Token unauthorized.") + logger.error(err) + }) + // } else { + // req.token = { uid: "devAccount" } as DecodedIdToken; + // next(); + // } +}) + +app.use( + fileUpload({ + useTempFiles: true, + tempFileDir: "/tmp/", + }) +) + +app.use(`${API_ROUTE}/file`, files) +app.use(`${API_ROUTE}/pins`, pinning) + +const port = process.env.PORT || 3030 +app.listen(port, () => { + logger.info(`Listening on port ${port}`) +}) diff --git a/packages/server/src/clients/filecoin.ts b/apps/server/src/clients/filecoin.ts similarity index 56% rename from packages/server/src/clients/filecoin.ts rename to apps/server/src/clients/filecoin.ts index da0cfa1..58299c7 100644 --- a/packages/server/src/clients/filecoin.ts +++ b/apps/server/src/clients/filecoin.ts @@ -1,16 +1,16 @@ -import { mainnet } from "@filecoin-shipyard/lotus-client-schema"; -import { NodejsProvider } from "@filecoin-shipyard/lotus-client-provider-nodejs"; -import { LotusRPC } from "@filecoin-shipyard/lotus-client-rpc"; +import { mainnet } from "@filecoin-shipyard/lotus-client-schema" +import { NodejsProvider } from "@filecoin-shipyard/lotus-client-provider-nodejs" +import { LotusRPC } from "@filecoin-shipyard/lotus-client-rpc" -const user = process.env.INFURA_PROJECT_ID; -const pass = process.env.INFURA_PROJECT_SECRET; +const user = process.env.INFURA_PROJECT_ID +const pass = process.env.INFURA_PROJECT_SECRET -const endpointURL = "https://filecoin.infura.io"; +const endpointURL = "https://filecoin.infura.io" const provider = new NodejsProvider(endpointURL, { authorizationHeader: `Basic ${Buffer.from(`${user}:${pass}`).toString( "base64" )}`, -}); -const client = new LotusRPC(provider, { schema: mainnet.fullNode }); +}) +const client = new LotusRPC(provider, { schema: mainnet.fullNode }) -export default client; +export default client diff --git a/apps/server/src/clients/ipfs.ts b/apps/server/src/clients/ipfs.ts new file mode 100644 index 0000000..12de0e3 --- /dev/null +++ b/apps/server/src/clients/ipfs.ts @@ -0,0 +1,80 @@ +import { FileModel } from "@crate/types" +import fs from "fs" +import { + CID, + FileError, + FileErrorType, + Node, + splitPath, + validPath, +} from "@crate/common" +import fileUpload from "express-fileupload" +import { create } from "ipfs-http-client" + +const clientURL = + process.env["IPFS_CLIENT_URL"] || "http://127.0.0.1:5001/api/v0" +const client = create({ url: clientURL }) + +const fetchFModel = async (cid: CID): Promise => { + return await Node.toFile(Node.fromRawBlock(await client.block.get(cid))) +} + +const walk = async (path: string): Promise => { + const walkDir = async (dirCID: string, path: string[]): Promise => { + if (path.length === 0) return [CID.parse(dirCID)] + const fModel = await fetchFModel(CID.parse(dirCID)) + if (fModel.type !== "directory") + throw new FileError(FileErrorType.FILE_INVALID) + if (!fModel.links.some((link) => link.name === path[0])) + throw new FileError(FileErrorType.NO_DATA) + const nextCID = fModel.links.find((el) => el.name === path[0]).cid + return [CID.parse(nextCID)].concat(await walkDir(nextCID, path.slice(1))) + } + const segments = splitPath(path) + const rootCID = segments[0] + const resolvedCIDs: CID[] = await walkDir(rootCID, segments.slice(1)) + return resolvedCIDs +} + +async function resolve(path: string): Promise { + if (!validPath(path)) throw new Error("Invalid path.") + const arr = await walk(path) + return arr[arr.length - 1] +} + +async function get(path: string): Promise { + const pathCid = await resolve(path) + return await fetchFModel(pathCid) +} + +async function add(files: fileUpload.UploadedFile[]): Promise { + // parse files, forward to IPFS to get the CID + const models = await Promise.all( + files.map(async (file): Promise => { + const addResult = await client.add(fs.createReadStream(file.tempFilePath)) + await client.pin.add(addResult.cid) + console.log(addResult.cid.toString()) + // const pin = await client.pin.remote.add(addResult.cid, { + // name: file.name, + // service: "crate", + // }); + return { + cid: addResult.cid.toString(), + name: file.name, + type: "file", + size: file.size, + date: new Date().toISOString(), + } + }) + ) + return models +} + +// async function mkdir(path: string): Promise {} + +// async function addToDir(path: string, fileCID: CID): Promise {} + +// async function rm(path: string): Promise {} + +// export default { client, get, add, mkdir, addToDir, rm } +export default { client, get, add } diff --git a/apps/server/src/firebase.ts b/apps/server/src/firebase.ts new file mode 100644 index 0000000..aa7b353 --- /dev/null +++ b/apps/server/src/firebase.ts @@ -0,0 +1,11 @@ +import { applicationDefault, initializeApp } from "firebase-admin/app" +import { getFirestore } from "firebase-admin/firestore" +import { getAuth } from "firebase-admin/auth" + +const firebaseApp = initializeApp({ + credential: applicationDefault(), +}) +const firestore = getFirestore(firebaseApp) +const auth = getAuth() + +export { firebaseApp, firestore, auth } diff --git a/apps/server/src/init.ts b/apps/server/src/init.ts new file mode 100644 index 0000000..f0fcb89 --- /dev/null +++ b/apps/server/src/init.ts @@ -0,0 +1,7 @@ +import dotenv from "dotenv" + +if (process.env.NODE_ENV !== "production") { + dotenv.config() +} + +require("./app") diff --git a/packages/server/src/logger.ts b/apps/server/src/logger.ts similarity index 87% rename from packages/server/src/logger.ts rename to apps/server/src/logger.ts index 11aa3d3..4a1f065 100644 --- a/packages/server/src/logger.ts +++ b/apps/server/src/logger.ts @@ -1,4 +1,4 @@ -import winston from "winston"; +import winston from "winston" const logger = winston.createLogger({ level: "info", @@ -8,14 +8,14 @@ const logger = winston.createLogger({ new winston.transports.File({ filename: "error.log", level: "error" }), new winston.transports.File({ filename: "combined.log" }), ], -}); +}) if (process.env.NODE_ENV !== "production") { logger.add( new winston.transports.Console({ format: winston.format.simple(), }) - ); + ) } -export default logger; +export default logger diff --git a/apps/server/src/routes/files-route.ts b/apps/server/src/routes/files-route.ts new file mode 100644 index 0000000..7af7014 --- /dev/null +++ b/apps/server/src/routes/files-route.ts @@ -0,0 +1,41 @@ +import { RequestHandler, Router } from "express" +import ipfs from "../clients/ipfs" +import logger from "../logger" + +const router = Router() + +const asyncHandler = (fn: RequestHandler) => (req, res, next) => { + return Promise.resolve(fn(req, res, next)).catch(next) +} + +const get: RequestHandler = async (req, res) => { + const { path, cid } = { + path: "/", + cid: null, + ...req.query, + } + logger.info(path) + logger.info(cid) + + res.send() +} + +const post: RequestHandler = async (req, res) => { + if (!req.files.files || Object.keys(req.files).length === 0) { + return res.status(400).send({ + error: { reason: "BAD_REQUEST", details: "No files were uploaded." }, + }) + } + + const { files } = req.files + const fileArr = Array.isArray(files) ? files : [files] + const models = await ipfs.add(fileArr) + + logger.info(JSON.stringify(models)) + res.send(models) +} + +router.get("/", asyncHandler(get)) +router.post("/", asyncHandler(post)) + +export default router diff --git a/apps/server/src/routes/pinning-route.ts b/apps/server/src/routes/pinning-route.ts new file mode 100644 index 0000000..b850f78 --- /dev/null +++ b/apps/server/src/routes/pinning-route.ts @@ -0,0 +1,38 @@ +import { Router } from "express" +import { uuid } from "uuidv4" + +const router = Router() + +router.get("/", (req, res) => { + const fcRes = "List of pin objects." + res.send(fcRes) +}) + +router.post("/", (req, res) => { + res.send({ + requestid: uuid(), + status: "queued", + created: new Date().toISOString(), + pin: {}, + }) +}) + +router.get(/\/(.+)$/, (req, res) => { + const reqId = req.params[0] + const fcRes = `Get pin object with ID ${reqId}.` + res.send(fcRes) +}) + +router.post(/\/(.+)$/, (req, res) => { + const reqId = req.params[0] + const fcRes = `Replace pin object with ID ${reqId}.` + res.send(fcRes) +}) + +router.delete(/\/(.+)$/, (req, res) => { + const reqId = req.params[0] + const fcRes = `Remove pin object with ID ${reqId}.` + res.send(fcRes) +}) + +export default router diff --git a/apps/server/src/types/express/index.d.ts b/apps/server/src/types/express/index.d.ts new file mode 100644 index 0000000..8f1207e --- /dev/null +++ b/apps/server/src/types/express/index.d.ts @@ -0,0 +1,10 @@ +import express from "express" +import { DecodedIdToken } from "firebase-admin/auth" + +declare global { + namespace Express { + interface Request { + token?: DecodedIdToken + } + } +} diff --git a/packages/server/src/user.ts b/apps/server/src/user.ts similarity index 100% rename from packages/server/src/user.ts rename to apps/server/src/user.ts diff --git a/apps/server/tsconfig.json b/apps/server/tsconfig.json new file mode 100644 index 0000000..f5b8565 --- /dev/null +++ b/apps/server/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/apps/server/tsconfig.lib.json b/apps/server/tsconfig.lib.json new file mode 100644 index 0000000..4ef354b --- /dev/null +++ b/apps/server/tsconfig.lib.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ESNext", + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [], + "esModuleInterop": true + }, + "include": ["**/*.ts"], + "exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"] +} diff --git a/apps/server/tsconfig.spec.json b/apps/server/tsconfig.spec.json new file mode 100644 index 0000000..546f128 --- /dev/null +++ b/apps/server/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/packages/server/yarn.lock b/apps/server/yarn.lock similarity index 100% rename from packages/server/yarn.lock rename to apps/server/yarn.lock diff --git a/packages/web/.dockerignore b/apps/web/.dockerignore similarity index 100% rename from packages/web/.dockerignore rename to apps/web/.dockerignore diff --git a/packages/web/.env.local.example b/apps/web/.env.local.example similarity index 100% rename from packages/web/.env.local.example rename to apps/web/.env.local.example diff --git a/packages/web/.eslintrc.json b/apps/web/.eslintrc.json similarity index 92% rename from packages/web/.eslintrc.json rename to apps/web/.eslintrc.json index 5b5bfee..1c286f9 100644 --- a/packages/web/.eslintrc.json +++ b/apps/web/.eslintrc.json @@ -1,6 +1,6 @@ { "extends": ["../../.eslintrc.json"], - "ignorePatterns": ["!**/*", "node_modules", "dist"], + "ignorePatterns": ["!**/*", "node_modules", "dist", "*.js"], "overrides": [ { "env": { diff --git a/packages/web/.gitignore b/apps/web/.gitignore similarity index 100% rename from packages/web/.gitignore rename to apps/web/.gitignore diff --git a/packages/web/CHANGELOG.md b/apps/web/CHANGELOG.md similarity index 100% rename from packages/web/CHANGELOG.md rename to apps/web/CHANGELOG.md diff --git a/packages/web/Dockerfile b/apps/web/Dockerfile similarity index 100% rename from packages/web/Dockerfile rename to apps/web/Dockerfile diff --git a/packages/web/index.html b/apps/web/index.html similarity index 100% rename from packages/web/index.html rename to apps/web/index.html diff --git a/apps/web/jest.config.ts b/apps/web/jest.config.ts new file mode 100644 index 0000000..a7e8548 --- /dev/null +++ b/apps/web/jest.config.ts @@ -0,0 +1,15 @@ +/* eslint-disable */ +export default { + displayName: "@crate/web", + preset: "../../jest.preset.js", + globals: { + "ts-jest": { + tsconfig: "/tsconfig.spec.json", + }, + }, + transform: { + "^.+\\.[tj]sx?$": "ts-jest", + }, + moduleFileExtensions: ["ts", "tsx", "js", "jsx"], + coverageDirectory: "../../coverage/apps/web", +} diff --git a/packages/web/nginx/default.conf b/apps/web/nginx/default.conf similarity index 100% rename from packages/web/nginx/default.conf rename to apps/web/nginx/default.conf diff --git a/packages/web/package.json b/apps/web/package.json similarity index 83% rename from packages/web/package.json rename to apps/web/package.json index 8916ecf..b9186d4 100644 --- a/packages/web/package.json +++ b/apps/web/package.json @@ -1,26 +1,18 @@ { - "name": "@/web", + "name": "@crate/web", "version": "0.5.1", "private": true, "author": "Christian van der Loo", - "scripts": { - "dev": "vite", - "build": "vite build", - "preview": "vite preview", - "deploy": "gh-pages -d dist", - "lint": "eslint . --max-warnings=0" - }, "dependencies": { - "@babel/plugin-transform-react-jsx-source": "^7.16.7", - "@crate/api-lib": "*", "@crate/common": "*", + "@crate/types": "*", + "@babel/plugin-transform-react-jsx-source": "^7.16.7", "@fortawesome/fontawesome-svg-core": "^6.1.1", "@fortawesome/free-solid-svg-icons": "^6.1.1", "@fortawesome/react-fontawesome": "^0.1.18", "@icons-pack/react-simple-icons": "^4.6.1", "@nrwl/js": "^14.3.5", "@nrwl/react": "^14.3.5", - "@tailwindcss/forms": "^0.5.2", "@trumbitta/nx-plugin-openapi": "^1.10.1", "@trumbitta/nx-plugin-unused-deps": "^1.10.1", "deep-equal": "^2.0.5", @@ -36,6 +28,7 @@ }, "devDependencies": { "@preact/preset-vite": "^2.1.7", + "@tailwindcss/forms": "^0.5.2", "@typescript-eslint/eslint-plugin": "^5.30.5", "@typescript-eslint/parser": "^5.30.5", "autoprefixer": "^10.4.2", @@ -44,10 +37,10 @@ "eslint-plugin-jest": "^26.5.3", "eslint-plugin-react": "^7.30.1", "gh-pages": "^3.2.3", - "postcss": "^8.4.7", + "postcss": "^8.4.14", "preact": "^10.6.6", "prettier": "^2.7.1", - "tailwindcss": "^3.0.23", + "tailwindcss": "^3.1.6", "typescript": "^4.5.4", "vite": "^2.8.0", "vite-tsconfig-paths": "^3.4.1" diff --git a/apps/web/postcss.config.cjs b/apps/web/postcss.config.cjs new file mode 100644 index 0000000..d1d6a67 --- /dev/null +++ b/apps/web/postcss.config.cjs @@ -0,0 +1,10 @@ +const { join } = require("path") + +module.exports = { + plugins: { + tailwindcss: { + config: join(__dirname, "tailwind.config.js"), + }, + autoprefixer: {}, + }, +} diff --git a/apps/web/project.json b/apps/web/project.json new file mode 100644 index 0000000..ba00b72 --- /dev/null +++ b/apps/web/project.json @@ -0,0 +1,80 @@ +{ + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "name": "@crate/web", + "sourceRoot": "apps/web/src", + "projectType": "application", + "targets": { + "docker": { + "executor": "@nx-tools/nx-docker:build", + "options": { + "push": true, + "platforms": ["linux/amd64", "linux/arm64"], + "metadata": { + "images": ["ghcr.io/crate-network/web"], + "context": "apps/web", + "tags": [ + "latest", + "type=schedule", + "type=ref,event=branch", + "type=ref,event=tag", + "type=ref,event=pr", + "type=semver,pattern={{version}}", + "type=semver,pattern={{major}}.{{minor}}", + "type=semver,pattern={{major}}", + "type=sha" + ] + } + } + }, + "version": { + "executor": "@jscutlery/semver:version", + "options": { + "preset": "conventional" + } + }, + "build": { + "executor": "@nxext/vite:build", + "outputs": ["{options.outputPath}"], + "defaultConfiguration": "production", + "options": { + "outputPath": "dist/apps/web", + "baseHref": "/", + "configFile": "apps/web/vite.config.ts" + } + }, + "serve": { + "executor": "@nxext/vite:dev", + "options": { + "outputPath": "dist/apps/web", + "baseHref": "/", + "configFile": "apps/web/vite.config.ts" + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "apps/web/src/environments/environment.ts", + "with": "apps/web/src/environments/environment.prod.ts" + } + ] + } + } + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["apps/web/**/*.{ts,js,tsx,jsx}"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/apps/web"], + "options": { + "jestConfig": "apps/web/jest.config.ts", + "passWithNoTests": true + } + } + }, + "tags": [] +} diff --git a/packages/web/public/CNAME b/apps/web/public/CNAME similarity index 100% rename from packages/web/public/CNAME rename to apps/web/public/CNAME diff --git a/packages/web/public/favicon.svg b/apps/web/public/favicon.svg similarity index 100% rename from packages/web/public/favicon.svg rename to apps/web/public/favicon.svg diff --git a/packages/web/src/api/FileAPI.ts b/apps/web/src/api/FileAPI.ts similarity index 86% rename from packages/web/src/api/FileAPI.ts rename to apps/web/src/api/FileAPI.ts index 70617e7..b2d4cfd 100644 --- a/packages/web/src/api/FileAPI.ts +++ b/apps/web/src/api/FileAPI.ts @@ -1,5 +1,5 @@ -import { FileModel } from "@crate/api-lib" -import { FileError, FileErrorType } from "@crate/common" +import { FileModel } from "@crate/types" +import { FileError, FileErrorType, Node } from "@crate/common" import { useErrorStore } from "store/ErrorStore" import { useUserStore } from "store/UserStore" @@ -36,13 +36,10 @@ export default { }, async update(fileModel: FileModel, path: string) { - return await this.fetch( - `${this.apiPath}/file?path=${encodeURIComponent(path)}`, - { - method: "POST", - body: JSON.stringify(fileModel), - } - ) + return await this.fetch(`${this.apiPath}/block`, { + method: "POST", + body: Node.toRawBlock(Node.fromFile(fileModel)), + }) }, // async pin(cid: CID) { diff --git a/packages/web/src/assets/dark-crate-glyph.svg b/apps/web/src/assets/dark-crate-glyph.svg similarity index 100% rename from packages/web/src/assets/dark-crate-glyph.svg rename to apps/web/src/assets/dark-crate-glyph.svg diff --git a/packages/web/src/assets/dark-crate.svg b/apps/web/src/assets/dark-crate.svg similarity index 100% rename from packages/web/src/assets/dark-crate.svg rename to apps/web/src/assets/dark-crate.svg diff --git a/packages/web/src/assets/iAWriterQuattroS-Bold.ttf b/apps/web/src/assets/iAWriterQuattroS-Bold.ttf similarity index 100% rename from packages/web/src/assets/iAWriterQuattroS-Bold.ttf rename to apps/web/src/assets/iAWriterQuattroS-Bold.ttf diff --git a/packages/web/src/assets/iAWriterQuattroS-BoldItalic.ttf b/apps/web/src/assets/iAWriterQuattroS-BoldItalic.ttf similarity index 100% rename from packages/web/src/assets/iAWriterQuattroS-BoldItalic.ttf rename to apps/web/src/assets/iAWriterQuattroS-BoldItalic.ttf diff --git a/packages/web/src/assets/iAWriterQuattroS-Italic.ttf b/apps/web/src/assets/iAWriterQuattroS-Italic.ttf similarity index 100% rename from packages/web/src/assets/iAWriterQuattroS-Italic.ttf rename to apps/web/src/assets/iAWriterQuattroS-Italic.ttf diff --git a/packages/web/src/assets/iAWriterQuattroS-Regular.ttf b/apps/web/src/assets/iAWriterQuattroS-Regular.ttf similarity index 100% rename from packages/web/src/assets/iAWriterQuattroS-Regular.ttf rename to apps/web/src/assets/iAWriterQuattroS-Regular.ttf diff --git a/packages/web/src/assets/light-crate-glyph.svg b/apps/web/src/assets/light-crate-glyph.svg similarity index 100% rename from packages/web/src/assets/light-crate-glyph.svg rename to apps/web/src/assets/light-crate-glyph.svg diff --git a/packages/web/src/assets/light-crate.svg b/apps/web/src/assets/light-crate.svg similarity index 100% rename from packages/web/src/assets/light-crate.svg rename to apps/web/src/assets/light-crate.svg diff --git a/packages/web/src/assets/signin-apple-logo.svg b/apps/web/src/assets/signin-apple-logo.svg similarity index 100% rename from packages/web/src/assets/signin-apple-logo.svg rename to apps/web/src/assets/signin-apple-logo.svg diff --git a/packages/web/src/components/Button.tsx b/apps/web/src/components/Button.tsx similarity index 100% rename from packages/web/src/components/Button.tsx rename to apps/web/src/components/Button.tsx diff --git a/packages/web/src/components/FormBox.tsx b/apps/web/src/components/FormBox.tsx similarity index 100% rename from packages/web/src/components/FormBox.tsx rename to apps/web/src/components/FormBox.tsx diff --git a/packages/web/src/components/FormInput.tsx b/apps/web/src/components/FormInput.tsx similarity index 100% rename from packages/web/src/components/FormInput.tsx rename to apps/web/src/components/FormInput.tsx diff --git a/packages/web/src/components/Navigation.tsx b/apps/web/src/components/Navigation.tsx similarity index 100% rename from packages/web/src/components/Navigation.tsx rename to apps/web/src/components/Navigation.tsx diff --git a/packages/web/src/components/Popover.tsx b/apps/web/src/components/Popover.tsx similarity index 100% rename from packages/web/src/components/Popover.tsx rename to apps/web/src/components/Popover.tsx diff --git a/packages/web/src/components/files/Dropdown.tsx b/apps/web/src/components/files/Dropdown.tsx similarity index 100% rename from packages/web/src/components/files/Dropdown.tsx rename to apps/web/src/components/files/Dropdown.tsx diff --git a/packages/web/src/components/files/FileInspector.tsx b/apps/web/src/components/files/FileInspector.tsx similarity index 100% rename from packages/web/src/components/files/FileInspector.tsx rename to apps/web/src/components/files/FileInspector.tsx diff --git a/packages/web/src/components/files/FileInspectorFileBody.tsx b/apps/web/src/components/files/FileInspectorFileBody.tsx similarity index 97% rename from packages/web/src/components/files/FileInspectorFileBody.tsx rename to apps/web/src/components/files/FileInspectorFileBody.tsx index 2bc53c1..ac6c735 100644 --- a/packages/web/src/components/files/FileInspectorFileBody.tsx +++ b/apps/web/src/components/files/FileInspectorFileBody.tsx @@ -1,6 +1,6 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import { faCopy } from "@fortawesome/free-solid-svg-icons" -import { FileModel } from "@crate/api-lib" +import { FileModel } from "@crate/types" export function FileInspectorFileBody({ file }: { file: FileModel }) { const { name, cid } = file diff --git a/packages/web/src/components/files/GridView.tsx b/apps/web/src/components/files/GridView.tsx similarity index 100% rename from packages/web/src/components/files/GridView.tsx rename to apps/web/src/components/files/GridView.tsx diff --git a/packages/web/src/components/files/ListView.tsx b/apps/web/src/components/files/ListView.tsx similarity index 98% rename from packages/web/src/components/files/ListView.tsx rename to apps/web/src/components/files/ListView.tsx index 209691c..bdd9f77 100644 --- a/packages/web/src/components/files/ListView.tsx +++ b/apps/web/src/components/files/ListView.tsx @@ -5,7 +5,7 @@ import RightClickMenu from "./RightClickMenu" import { useFileStore } from "store/FileStore" import shallow from "zustand/shallow" import { useStore as useFVStore } from "store/FileViewStore" -import { FileModel } from "@crate/api-lib" +import { FileModel } from "@crate/types" export function FileRow({ file }: { file: FileModel }) { const [selection, select, deselect] = useFVStore( diff --git a/packages/web/src/components/files/PopoverMenu.tsx b/apps/web/src/components/files/PopoverMenu.tsx similarity index 100% rename from packages/web/src/components/files/PopoverMenu.tsx rename to apps/web/src/components/files/PopoverMenu.tsx diff --git a/packages/web/src/components/files/RightClickMenu.tsx b/apps/web/src/components/files/RightClickMenu.tsx similarity index 100% rename from packages/web/src/components/files/RightClickMenu.tsx rename to apps/web/src/components/files/RightClickMenu.tsx diff --git a/packages/web/src/components/files/Toolbar.tsx b/apps/web/src/components/files/Toolbar.tsx similarity index 99% rename from packages/web/src/components/files/Toolbar.tsx rename to apps/web/src/components/files/Toolbar.tsx index 5a436c9..ef67cfa 100644 --- a/packages/web/src/components/files/Toolbar.tsx +++ b/apps/web/src/components/files/Toolbar.tsx @@ -9,7 +9,7 @@ import sanitizeFilename from "sanitize-filename" import { useFileStore } from "store/FileStore" import FileAPI from "api/FileAPI" import { createFile } from "@crate/common" -import { FileModel } from "@crate/api-lib" +import { FileModel } from "@crate/types" import { useStore as useFVStore } from "store/FileViewStore" import shallow from "zustand/shallow" diff --git a/packages/web/src/components/settings/Account.tsx b/apps/web/src/components/settings/Account.tsx similarity index 98% rename from packages/web/src/components/settings/Account.tsx rename to apps/web/src/components/settings/Account.tsx index 6bbe8ed..5fad024 100644 --- a/packages/web/src/components/settings/Account.tsx +++ b/apps/web/src/components/settings/Account.tsx @@ -1,7 +1,7 @@ import FormInput from "components/FormInput" import { useCallback } from "preact/hooks" import { doc, DocumentReference, setDoc } from "firebase/firestore" -import { UserModel } from "@crate/common" +import { UserModel } from "@crate/types" import { db } from "vendor/firebase" import { useUserStore } from "store/UserStore" import shallow from "zustand/shallow" diff --git a/packages/web/src/components/settings/Security.tsx b/apps/web/src/components/settings/Security.tsx similarity index 100% rename from packages/web/src/components/settings/Security.tsx rename to apps/web/src/components/settings/Security.tsx diff --git a/packages/web/src/crypto.ts b/apps/web/src/crypto.ts similarity index 100% rename from packages/web/src/crypto.ts rename to apps/web/src/crypto.ts diff --git a/packages/web/src/hooks/useClickOutside.tsx b/apps/web/src/hooks/useClickOutside.tsx similarity index 100% rename from packages/web/src/hooks/useClickOutside.tsx rename to apps/web/src/hooks/useClickOutside.tsx diff --git a/packages/web/src/hooks/useStoredState.ts b/apps/web/src/hooks/useStoredState.ts similarity index 100% rename from packages/web/src/hooks/useStoredState.ts rename to apps/web/src/hooks/useStoredState.ts diff --git a/packages/web/src/index.css b/apps/web/src/index.css similarity index 100% rename from packages/web/src/index.css rename to apps/web/src/index.css diff --git a/packages/web/src/main.tsx b/apps/web/src/main.tsx similarity index 90% rename from packages/web/src/main.tsx rename to apps/web/src/main.tsx index 21f5389..1eb04c4 100644 --- a/packages/web/src/main.tsx +++ b/apps/web/src/main.tsx @@ -6,13 +6,13 @@ import "./index.css" import Splash from "./pages/Splash" import Authenticate, { AuthenticateType } from "./pages/Authenticate" import Navigation from "./components/Navigation" -import EmailSignIn from "pages/EmailSignIn" -import Community from "pages/Community" +import EmailSignIn from "./pages/EmailSignIn" +import Community from "./pages/Community" import Files from "./pages/Files" -import NotFound from "pages/NotFound" -import Settings from "pages/Settings" -import { useErrorStore } from "store/ErrorStore" -import { useUserStore } from "store/UserStore" +import NotFound from "./pages/NotFound" +import Settings from "./pages/Settings" +import { useErrorStore } from "./store/ErrorStore" +import { useUserStore } from "./store/UserStore" const Page = (props) => { const { title, component, header, protect } = props diff --git a/packages/web/src/models/Anchor.ts b/apps/web/src/models/Anchor.ts similarity index 100% rename from packages/web/src/models/Anchor.ts rename to apps/web/src/models/Anchor.ts diff --git a/packages/web/src/models/Community.ts b/apps/web/src/models/Community.ts similarity index 100% rename from packages/web/src/models/Community.ts rename to apps/web/src/models/Community.ts diff --git a/packages/web/src/models/NamedFileModel.ts b/apps/web/src/models/NamedFileModel.ts similarity index 65% rename from packages/web/src/models/NamedFileModel.ts rename to apps/web/src/models/NamedFileModel.ts index d1dbddd..58f5993 100644 --- a/packages/web/src/models/NamedFileModel.ts +++ b/apps/web/src/models/NamedFileModel.ts @@ -1,4 +1,4 @@ -import { FileModel } from "@crate/api-lib" +import { FileModel } from "@crate/types" type NamedFileModel = FileModel & { name: string } export default NamedFileModel diff --git a/packages/web/src/pages/Authenticate.tsx b/apps/web/src/pages/Authenticate.tsx similarity index 94% rename from packages/web/src/pages/Authenticate.tsx rename to apps/web/src/pages/Authenticate.tsx index c6b19ed..f2611a3 100644 --- a/packages/web/src/pages/Authenticate.tsx +++ b/apps/web/src/pages/Authenticate.tsx @@ -1,12 +1,12 @@ -import Button from "components/Button" -import FormBox from "components/FormBox" -import FormInput from "components/FormInput" -import AppleLogo from "assets/signin-apple-logo.svg" +import Button from "../components/Button" +import FormBox from "../components/FormBox" +import FormInput from "../components/FormInput" +import AppleLogo from "../assets/signin-apple-logo.svg" import { sendSignInLinkToEmail, signInWithRedirect } from "firebase/auth" import { Link, route } from "preact-router" import { useState } from "preact/hooks" -import { actionCodeSettings, auth, providers } from "vendor/firebase" -import { useUserStore } from "store/UserStore" +import { actionCodeSettings, auth, providers } from "../vendor/firebase" +import { useUserStore } from "../store/UserStore" export enum AuthenticateType { REGISTER = "Register", diff --git a/packages/web/src/pages/Community.tsx b/apps/web/src/pages/Community.tsx similarity index 100% rename from packages/web/src/pages/Community.tsx rename to apps/web/src/pages/Community.tsx diff --git a/packages/web/src/pages/EmailSignIn.tsx b/apps/web/src/pages/EmailSignIn.tsx similarity index 94% rename from packages/web/src/pages/EmailSignIn.tsx rename to apps/web/src/pages/EmailSignIn.tsx index ec43e2d..bfb9e25 100644 --- a/packages/web/src/pages/EmailSignIn.tsx +++ b/apps/web/src/pages/EmailSignIn.tsx @@ -1,8 +1,7 @@ import { isSignInWithEmailLink, signInWithEmailLink } from "firebase/auth" import { route } from "preact-router" import { useEffect } from "preact/hooks" -import {} from "store/ErrorStore" -import { auth } from "vendor/firebase" +import { auth } from "../vendor/firebase" export default function EmailLanding() { useEffect(() => { diff --git a/packages/web/src/pages/Files.tsx b/apps/web/src/pages/Files.tsx similarity index 100% rename from packages/web/src/pages/Files.tsx rename to apps/web/src/pages/Files.tsx diff --git a/packages/web/src/pages/NotFound.tsx b/apps/web/src/pages/NotFound.tsx similarity index 91% rename from packages/web/src/pages/NotFound.tsx rename to apps/web/src/pages/NotFound.tsx index 19db4f9..f262882 100644 --- a/packages/web/src/pages/NotFound.tsx +++ b/apps/web/src/pages/NotFound.tsx @@ -1,4 +1,4 @@ -import Button from "components/Button" +import Button from "../components/Button" import { route } from "preact-router" export default function NotFound() { diff --git a/packages/web/src/pages/Settings.tsx b/apps/web/src/pages/Settings.tsx similarity index 100% rename from packages/web/src/pages/Settings.tsx rename to apps/web/src/pages/Settings.tsx diff --git a/packages/web/src/pages/Splash.tsx b/apps/web/src/pages/Splash.tsx similarity index 100% rename from packages/web/src/pages/Splash.tsx rename to apps/web/src/pages/Splash.tsx diff --git a/packages/web/src/store/ErrorStore.ts b/apps/web/src/store/ErrorStore.ts similarity index 100% rename from packages/web/src/store/ErrorStore.ts rename to apps/web/src/store/ErrorStore.ts diff --git a/packages/web/src/store/FileStore.ts b/apps/web/src/store/FileStore.ts similarity index 95% rename from packages/web/src/store/FileStore.ts rename to apps/web/src/store/FileStore.ts index 2cd33ba..367477c 100644 --- a/packages/web/src/store/FileStore.ts +++ b/apps/web/src/store/FileStore.ts @@ -13,7 +13,7 @@ import { splitPath, } from "@crate/common" import create, { StateCreator } from "zustand" -import { FileModel } from "@crate/api-lib" +import { FileModel } from "@crate/types" import { subscribeWithSelector } from "zustand/middleware" import { immer } from "zustand/middleware/immer" import FileAPI from "api/FileAPI" @@ -79,10 +79,8 @@ const fileStore: StateCreator< return [nextCID].concat(await walkDir(nextCID, path.slice(1))) } const segments = splitPath(path) - const rootCID = segments[1] - const resolvedCIDs: CID[] = [rootCID].concat( - await walkDir(rootCID, segments.slice(2)) - ) + const rootCID = segments[0] + const resolvedCIDs: CID[] = await walkDir(rootCID, segments.slice(1)) return resolvedCIDs } @@ -133,13 +131,11 @@ const fileStore: StateCreator< console.log(cid, nextCID) } newModel.cid = nextCID - console.log(`created ${nextCID}`) set(({ files }) => { files[newModel.cid] = newModel }) } - - const newPath = `/ipfs/${nextCID}/${splitPath(path).slice(2).join("/")}` + const newPath = `/ipfs/${nextCID}/${splitPath(path).slice(1).join("/")}` return newPath } diff --git a/packages/web/src/store/FileViewStore.ts b/apps/web/src/store/FileViewStore.ts similarity index 100% rename from packages/web/src/store/FileViewStore.ts rename to apps/web/src/store/FileViewStore.ts diff --git a/packages/web/src/store/UserStore.ts b/apps/web/src/store/UserStore.ts similarity index 97% rename from packages/web/src/store/UserStore.ts rename to apps/web/src/store/UserStore.ts index 740f2b2..a641f07 100644 --- a/packages/web/src/store/UserStore.ts +++ b/apps/web/src/store/UserStore.ts @@ -1,4 +1,5 @@ -import { CID, UserModel } from "@crate/common" +import { UserModel } from "@crate/types" +import { CID } from "@crate/common" import { onAuthStateChanged, signOut, User } from "firebase/auth" import { doc, diff --git a/packages/web/src/vendor/firebase.ts b/apps/web/src/vendor/firebase.ts similarity index 100% rename from packages/web/src/vendor/firebase.ts rename to apps/web/src/vendor/firebase.ts diff --git a/packages/web/src/vite-env.d.ts b/apps/web/src/vite-env.d.ts similarity index 100% rename from packages/web/src/vite-env.d.ts rename to apps/web/src/vite-env.d.ts diff --git a/packages/web/tailwind.config.js b/apps/web/tailwind.config.js similarity index 69% rename from packages/web/tailwind.config.js rename to apps/web/tailwind.config.js index a23ae82..1a7e6f3 100644 --- a/packages/web/tailwind.config.js +++ b/apps/web/tailwind.config.js @@ -1,5 +1,5 @@ module.exports = { - content: ["./index.html", "./src/**/*.{html,js,jsx,ts,tsx}"], + content: ["apps/web/index.html", "apps/web/src/**/*.{html,js,jsx,ts,tsx}"], theme: { extend: { fontFamily: { diff --git a/packages/web/tsconfig.json b/apps/web/tsconfig.json similarity index 89% rename from packages/web/tsconfig.json rename to apps/web/tsconfig.json index f74f0a0..2d2d8d9 100644 --- a/packages/web/tsconfig.json +++ b/apps/web/tsconfig.json @@ -18,6 +18,7 @@ "jsx": "react-jsx", "jsxImportSource": "preact" }, - "include": ["src", "../shared/types/FileModel.ts"], + "exclude": ["*.js"], + "include": ["src", "postcss.config.cjs"], "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/packages/web/tsconfig.node.json b/apps/web/tsconfig.node.json similarity index 100% rename from packages/web/tsconfig.node.json rename to apps/web/tsconfig.node.json diff --git a/packages/web/vite.config.ts b/apps/web/vite.config.ts similarity index 100% rename from packages/web/vite.config.ts rename to apps/web/vite.config.ts diff --git a/packages/web/yarn.lock b/apps/web/yarn.lock similarity index 100% rename from packages/web/yarn.lock rename to apps/web/yarn.lock diff --git a/deployment-server.yaml b/deployment-server.yaml deleted file mode 100644 index 9adb74b..0000000 --- a/deployment-server.yaml +++ /dev/null @@ -1,96 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - deployment.kubernetes.io/revision: "3" - kubectl.kubernetes.io/last-applied-configuration: | - {"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"labels":{"app":"server"},"name":"server","namespace":"default"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"server"}},"template":{"metadata":{"labels":{"app":"server"}},"spec":{"containers":[{"env":[{"name":"GOOGLE_APPLICATION_CREDENTIALS","value":"/etc/firebase/firebase.json"},{"name":"PORT","value":"80"},{"name":"INFURA_PROJECT_ID","valueFrom":{"secretKeyRef":{"key":"infuraId","name":"server-credentials"}}},{"name":"INFURA_PROJECT_SECRET","valueFrom":{"secretKeyRef":{"key":"infuraSecret","name":"server-credentials"}}}],"image":"ghcr.io/crate-network/server:latest","name":"server","ports":[{"containerPort":80}],"resources":{},"volumeMounts":[{"mountPath":"/etc/firebase","name":"auth-cred-volume","readOnly":true}]}],"imagePullSecrets":[{"name":"ghcr"}],"volumes":[{"name":"auth-cred-volume","secret":{"items":[{"key":"googleApplicationCredentials","path":"firebase.json"}],"secretName":"server-credentials"}}]}}}} - creationTimestamp: "2022-05-01T03:33:41Z" - generation: 3 - labels: - app: server - name: server - namespace: default - resourceVersion: "10250407" - uid: 16568a10-3e57-46fc-8c10-c8cfe1b87370 -spec: - progressDeadlineSeconds: 600 - replicas: 1 - revisionHistoryLimit: 10 - selector: - matchLabels: - app: server - strategy: - rollingUpdate: - maxSurge: 25% - maxUnavailable: 25% - type: RollingUpdate - template: - metadata: - creationTimestamp: null - labels: - app: server - spec: - containers: - - env: - - name: GOOGLE_APPLICATION_CREDENTIALS - value: /etc/firebase/firebase.json - - name: PORT - value: "80" - - name: INFURA_PROJECT_ID - valueFrom: - secretKeyRef: - key: infuraId - name: server-credentials - - name: INFURA_PROJECT_SECRET - valueFrom: - secretKeyRef: - key: infuraSecret - name: server-credentials - image: ghcr.io/crate-network/server:latest - imagePullPolicy: Always - name: server - ports: - - containerPort: 80 - protocol: TCP - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - volumeMounts: - - mountPath: /etc/firebase - name: auth-cred-volume - readOnly: true - dnsPolicy: ClusterFirst - imagePullSecrets: - - name: ghcr - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 - volumes: - - name: auth-cred-volume - secret: - defaultMode: 420 - items: - - key: googleApplicationCredentials - path: firebase.json - secretName: server-credentials -status: - availableReplicas: 1 - conditions: - - lastTransitionTime: "2022-05-01T03:33:41Z" - lastUpdateTime: "2022-05-01T03:39:34Z" - message: ReplicaSet "server-959979cc5" has successfully progressed. - reason: NewReplicaSetAvailable - status: "True" - type: Progressing - - lastTransitionTime: "2022-06-29T22:44:56Z" - lastUpdateTime: "2022-06-29T22:44:56Z" - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: Available - observedGeneration: 3 - readyReplicas: 1 - replicas: 1 - updatedReplicas: 1 diff --git a/packages/api-docs/.babelrc b/docs/api-docs/.babelrc similarity index 100% rename from packages/api-docs/.babelrc rename to docs/api-docs/.babelrc diff --git a/packages/api-docs/Dockerfile b/docs/api-docs/Dockerfile similarity index 100% rename from packages/api-docs/Dockerfile rename to docs/api-docs/Dockerfile diff --git a/packages/api-docs/README.md b/docs/api-docs/README.md similarity index 100% rename from packages/api-docs/README.md rename to docs/api-docs/README.md diff --git a/packages/api-docs/package.json b/docs/api-docs/package.json similarity index 100% rename from packages/api-docs/package.json rename to docs/api-docs/package.json diff --git a/packages/api-docs/project.json b/docs/api-docs/project.json similarity index 100% rename from packages/api-docs/project.json rename to docs/api-docs/project.json diff --git a/packages/api-docs/src/.openapi-generator-ignore b/docs/api-docs/src/.openapi-generator-ignore similarity index 100% rename from packages/api-docs/src/.openapi-generator-ignore rename to docs/api-docs/src/.openapi-generator-ignore diff --git a/packages/api-docs/src/.openapi-generator/FILES b/docs/api-docs/src/.openapi-generator/FILES similarity index 100% rename from packages/api-docs/src/.openapi-generator/FILES rename to docs/api-docs/src/.openapi-generator/FILES diff --git a/packages/api-docs/src/.openapi-generator/VERSION b/docs/api-docs/src/.openapi-generator/VERSION similarity index 100% rename from packages/api-docs/src/.openapi-generator/VERSION rename to docs/api-docs/src/.openapi-generator/VERSION diff --git a/docs/api-docs/src/index.html b/docs/api-docs/src/index.html new file mode 100644 index 0000000..71b0460 --- /dev/null +++ b/docs/api-docs/src/index.html @@ -0,0 +1,1275 @@ + + + + Crate Network API + + + +

Crate Network API

+
+

About this spec

+

+ The Crate API exposes several endpoints which allows the Crate macOS, + iOS, iPadOS and web clients to interact with Crate's IPFS cluster + without the clients needing to run IPFS clients of their own. Crate + Network implements the IPFS Pinning API specification at the + /pins endpoint, as described by the spec found + on GitHub. The pinning API accepts a Bearer authorization token retrieved from + your Crate account. This identifies your user and adds the pinned + content to your files on Crate. This version of the API is modified to + include metadata, all of which is optional so that Crate continues to + conform to the IPFS spec. +

+

+ The Filecoin replication service is handled via the pinning API. Instead + of using untrusted centralized cloud storage as the backend, Crate + safely replicates content onto other decentralized networks. When a + request comes to the pinning service to retrieve the content, Crate will + prioritize cached content, otherwise falling back to the Filecoin + network to retrieve your files. +

+
+
+ More information: + https://openapi-generator.tech +
+
+ Contact Info: team@openapitools.org +
+
Version: 1.0.0
+
BasePath:/api/v1
+
All rights reserved
+
http://apache.org/licenses/LICENSE-2.0.html
+

Access

+
    +
  1. HTTP Basic Authentication
  2. +
+ +

Methods

+ [ Jump to Models ] + +

Table of Contents

+
+

Files

+ +

Pins

+ + +

Files

+
+ +
+ Up +
get /file
+
+
(fileGet)
+
+ Get FileDescriptor object a file/directory specified by either a CID or + the path from the root of the user's filesystem. If neither are + specified, we return the FileDescriptor for the root directory. +
+ +

Query parameters

+
+
path (optional)
+ +
+ Query Parameter — default: null +
+
cid (optional)
+ +
+ Query Parameter — default: null +
+
+ + +

Return type

+ + + + +

Example data

+
+ Content-Type: application/json +
+
{
+  "date" : "date",
+  "mode" : 1.4658129805029452,
+  "size" : 0.8008281904610115,
+  "cumulativeSize" : 6.027456183070403,
+  "links" : [ {
+    "size" : 145,
+    "name" : "file.txt",
+    "cid" : "Qm..."
+  }, {
+    "size" : 145,
+    "name" : "file.txt",
+    "cid" : "Qm..."
+  } ],
+  "type" : "directory",
+  "cid" : "Qm...",
+  "signedEncryptionKey" : "signedEncryptionKey"
+}
+ +

Produces

+ This API call produces the following media types according to the + Accept request header; the media type will be + conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successful response (FileDescriptor object) + FileDescriptor +
+ +
+
+ +
+ Up +
post /file
+
+
(filePost)
+
+ Upload one or many files/directories to a path specified in the query + parameters. If ignored, this will save the files to the root directory. +
+ +

Consumes

+ This API call consumes the following media types via the + Content-Type request header: +
    +
  • multipart/form-data
  • +
+ +

Query parameters

+
+
path (optional)
+ +
+ Query Parameter — default: null +
+
+ + +

Form parameters

+
+
files (optional)
+ +
+ Form Parameter — default: null + format: binary +
+
+ + +

Return type

+ + + + +

Example data

+
+ Content-Type: application/json +
+
{
+  "date" : "date",
+  "mode" : 1.4658129805029452,
+  "size" : 0.8008281904610115,
+  "cumulativeSize" : 6.027456183070403,
+  "links" : [ {
+    "size" : 145,
+    "name" : "file.txt",
+    "cid" : "Qm..."
+  }, {
+    "size" : 145,
+    "name" : "file.txt",
+    "cid" : "Qm..."
+  } ],
+  "type" : "directory",
+  "cid" : "Qm...",
+  "signedEncryptionKey" : "signedEncryptionKey"
+}
+ +

Produces

+ This API call produces the following media types according to the + Accept request header; the media type will be + conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successful response (FileDescriptor object) + FileDescriptor +
+ +
+

Pins

+
+ +
+ Up +
get /pins
+
+
+ List pin objects (pinsGet) +
+
+ List all the pin objects, matching optional filters; when no filter is + provided, only successful pins are returned. +
+ +

Query parameters

+
+
cid (optional)
+ +
+ Query Parameter — Return pin + objects responsible for pinning the specified CID(s); be aware that + using longer hash functions introduces further constraints on the + number of CIDs that will fit under the limit of 2000 characters per + URL in browser contexts default: null +
+
name (optional)
+ +
+ Query Parameter — Return pin + objects with specified name (by default a case-sensitive, exact match) + default: null +
+
match (optional)
+ +
+ Query Parameter — Customize the + text matching strategy applied when the name filter is present; exact + (the default) is a case-sensitive exact match, partial matches + anywhere in the name, iexact and ipartial are case-insensitive + versions of the exact and partial strategies default: null +
+
status (optional)
+ +
+ Query Parameter — Return pin + objects for pins with the specified status default: null +
+
before (optional)
+ +
+ Query Parameter — Return results + created (queued) before provided timestamp default: null format: + date-time +
+
after (optional)
+ +
+ Query Parameter — Return results + created (queued) after provided timestamp default: null format: + date-time +
+
limit (optional)
+ +
+ Query Parameter — Max records to + return default: 10 format: int32 +
+
meta (optional)
+ +
+ Query Parameter — Return pin + objects that match specified metadata keys passed as a string + representation of a JSON object; when implementing a client library, + make sure the parameter is URL-encoded to ensure safe transport + default: null +
+
+ + +

Return type

+ + + + +

Example data

+
+ Content-Type: application/json +
+
{
+  "count" : 1,
+  "results" : [ {
+    "pin" : {
+      "meta" : {
+        "app_id" : "99986338-1113-4706-8302-4420da6158aa"
+      },
+      "name" : "PreciousData.pdf",
+      "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
+      "cid" : "Qm..."
+    },
+    "requestid" : "UniqueIdOfPinRequest",
+    "created" : "2020-07-27T17:32:28Z",
+    "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
+    "info" : {
+      "status_details" : "Queue position: 7 of 9"
+    }
+  }, {
+    "pin" : {
+      "meta" : {
+        "app_id" : "99986338-1113-4706-8302-4420da6158aa"
+      },
+      "name" : "PreciousData.pdf",
+      "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
+      "cid" : "Qm..."
+    },
+    "requestid" : "UniqueIdOfPinRequest",
+    "created" : "2020-07-27T17:32:28Z",
+    "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
+    "info" : {
+      "status_details" : "Queue position: 7 of 9"
+    }
+  }, {
+    "pin" : {
+      "meta" : {
+        "app_id" : "99986338-1113-4706-8302-4420da6158aa"
+      },
+      "name" : "PreciousData.pdf",
+      "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
+      "cid" : "Qm..."
+    },
+    "requestid" : "UniqueIdOfPinRequest",
+    "created" : "2020-07-27T17:32:28Z",
+    "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
+    "info" : {
+      "status_details" : "Queue position: 7 of 9"
+    }
+  }, {
+    "pin" : {
+      "meta" : {
+        "app_id" : "99986338-1113-4706-8302-4420da6158aa"
+      },
+      "name" : "PreciousData.pdf",
+      "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
+      "cid" : "Qm..."
+    },
+    "requestid" : "UniqueIdOfPinRequest",
+    "created" : "2020-07-27T17:32:28Z",
+    "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
+    "info" : {
+      "status_details" : "Queue position: 7 of 9"
+    }
+  }, {
+    "pin" : {
+      "meta" : {
+        "app_id" : "99986338-1113-4706-8302-4420da6158aa"
+      },
+      "name" : "PreciousData.pdf",
+      "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
+      "cid" : "Qm..."
+    },
+    "requestid" : "UniqueIdOfPinRequest",
+    "created" : "2020-07-27T17:32:28Z",
+    "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
+    "info" : {
+      "status_details" : "Queue position: 7 of 9"
+    }
+  } ]
+}
+ +

Produces

+ This API call produces the following media types according to the + Accept request header; the media type will be + conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successful response (PinResults object) + PinResults +

400

+ Error response (Bad request) + Failure +

401

+ Error response (Unauthorized; access token is missing or invalid) + Failure +

404

+ Error response (The specified resource was not found) + Failure +

409

+ Error response (Insufficient funds) + Failure +

4XX

+ Error response (Custom service error) + Failure +

5XX

+ Error response (Unexpected internal server error) + Failure +
+ +
+
+ +
+ Up +
post /pins
+
+
+ Add pin object (pinsPost) +
+
+ Add a new pin object for the current access token +
+ +

Consumes

+ This API call consumes the following media types via the + Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+
Pin Pin (required)
+ +
+ Body Parameter — +
+
+ + +

Return type

+
+ PinStatus +
+ + + +

Example data

+
+ Content-Type: application/json +
+
{
+  "pin" : {
+    "meta" : {
+      "app_id" : "99986338-1113-4706-8302-4420da6158aa"
+    },
+    "name" : "PreciousData.pdf",
+    "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
+    "cid" : "Qm..."
+  },
+  "requestid" : "UniqueIdOfPinRequest",
+  "created" : "2020-07-27T17:32:28Z",
+  "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
+  "info" : {
+    "status_details" : "Queue position: 7 of 9"
+  }
+}
+ +

Produces

+ This API call produces the following media types according to the + Accept request header; the media type will be + conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

202

+ Successful response (PinStatus object) + PinStatus +

400

+ Error response (Bad request) + Failure +

401

+ Error response (Unauthorized; access token is missing or invalid) + Failure +

404

+ Error response (The specified resource was not found) + Failure +

409

+ Error response (Insufficient funds) + Failure +

4XX

+ Error response (Custom service error) + Failure +

5XX

+ Error response (Unexpected internal server error) + Failure +
+ +
+
+ +
+ Up +
delete /pins/{requestid}
+
+
+ Remove pin object (pinsRequestidDelete) +
+
Remove a pin object
+ +

Path parameters

+
+
requestid (required)
+ +
+ Path Parameter — default: null +
+
+ + + + +

Produces

+ This API call produces the following media types according to the + Accept request header; the media type will be + conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

202

+ Successful response (no body, pin removed) + +

400

+ Error response (Bad request) + Failure +

401

+ Error response (Unauthorized; access token is missing or invalid) + Failure +

404

+ Error response (The specified resource was not found) + Failure +

409

+ Error response (Insufficient funds) + Failure +

4XX

+ Error response (Custom service error) + Failure +

5XX

+ Error response (Unexpected internal server error) + Failure +
+ +
+
+ +
+ Up +
get /pins/{requestid}
+
+
+ Get pin object (pinsRequestidGet) +
+
Get a pin object and its status
+ +

Path parameters

+
+
requestid (required)
+ +
+ Path Parameter — default: null +
+
+ + +

Return type

+
+ PinStatus +
+ + + +

Example data

+
+ Content-Type: application/json +
+
{
+  "pin" : {
+    "meta" : {
+      "app_id" : "99986338-1113-4706-8302-4420da6158aa"
+    },
+    "name" : "PreciousData.pdf",
+    "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
+    "cid" : "Qm..."
+  },
+  "requestid" : "UniqueIdOfPinRequest",
+  "created" : "2020-07-27T17:32:28Z",
+  "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
+  "info" : {
+    "status_details" : "Queue position: 7 of 9"
+  }
+}
+ +

Produces

+ This API call produces the following media types according to the + Accept request header; the media type will be + conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successful response (PinStatus object) + PinStatus +

400

+ Error response (Bad request) + Failure +

401

+ Error response (Unauthorized; access token is missing or invalid) + Failure +

404

+ Error response (The specified resource was not found) + Failure +

409

+ Error response (Insufficient funds) + Failure +

4XX

+ Error response (Custom service error) + Failure +

5XX

+ Error response (Unexpected internal server error) + Failure +
+ +
+
+ +
+ Up +
post /pins/{requestid}
+
+
+ Replace pin object (pinsRequestidPost) +
+
+ Replace an existing pin object (shortcut for executing remove and add + operations in one step to avoid unnecessary garbage collection of blocks + present in both recursive pins) +
+ +

Path parameters

+
+
requestid (required)
+ +
+ Path Parameter — default: null +
+
+ + +

Consumes

+ This API call consumes the following media types via the + Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+
Pin Pin (required)
+ +
+ Body Parameter — +
+
+ + +

Return type

+
+ PinStatus +
+ + + +

Example data

+
+ Content-Type: application/json +
+
{
+  "pin" : {
+    "meta" : {
+      "app_id" : "99986338-1113-4706-8302-4420da6158aa"
+    },
+    "name" : "PreciousData.pdf",
+    "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
+    "cid" : "Qm..."
+  },
+  "requestid" : "UniqueIdOfPinRequest",
+  "created" : "2020-07-27T17:32:28Z",
+  "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
+  "info" : {
+    "status_details" : "Queue position: 7 of 9"
+  }
+}
+ +

Produces

+ This API call produces the following media types according to the + Accept request header; the media type will be + conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

202

+ Successful response (PinStatus object) + PinStatus +

400

+ Error response (Bad request) + Failure +

401

+ Error response (Unauthorized; access token is missing or invalid) + Failure +

404

+ Error response (The specified resource was not found) + Failure +

409

+ Error response (Insufficient funds) + Failure +

4XX

+ Error response (Custom service error) + Failure +

5XX

+ Error response (Unexpected internal server error) + Failure +
+ +
+ +

Models

+ [ Jump to Methods ] + +

Table of Contents

+
    +
  1. + Failure - +
  2. +
  3. + Failure_error - +
  4. +
  5. + FileDescriptor - +
  6. +
  7. + FileDescriptor_links_inner - + +
  8. +
  9. + Pin - +
  10. +
  11. + PinResults - +
  12. +
  13. + PinStatus - +
  14. +
  15. + Status - +
  16. +
  17. + TextMatchingStrategy - +
  18. +
+ +
+

+ Failure - + Up +

+
Response for a failed request
+
+
error
+ +
+ +
+
+

+ Failure_error - + Up +

+
+
+
reason
+
+ String Mandatory + string identifying the type of error +
+
details (optional)
+
+ String Optional, + longer description of the error; may include UUID of transaction for + support, links to documentation etc +
+
+ +
+
+

+ FileDescriptor - + Up +

+
+ A file object as represented on @crate/web +
+
+
cid
+
+ String Content + Identifier (CID) +
+
type
+
+ String Whether + this is a file or directory +
+
Enum:
+
directory
+
file
+
signedEncryptionKey (optional)
+
+ String + Encryption key for the file in string format, parsed from binary + representation in UTF-8. This key has been encrypted by the user's + data key. +
+
size
+
+ BigDecimal The + size of the file. +
+
date
+
+ String The date + that this file was last modified in ISO-8601. +
+
links (optional)
+
+ array[FileDescriptor_links_inner] + The CIDs linked to from this directory. +
+
cumulativeSize (optional)
+
+ BigDecimal The + size of the directory and all contained files. +
+
mode (optional)
+
+ BigDecimal + Permissions for file. +
+
+ +
+
+

+ FileDescriptor_links_inner - + + Up +

+
+ Structure for linked items in a directory. Name can vary from directory + to directory. +
+
+
cid
+
+ String Content + Identifier (CID) +
+
name
+
+ String Name of + linked file. +
+
size
+
+ BigDecimal Size + of linked file. +
+
+ +
+
+

+ Pin - + Up +

+
Pin object
+
+
cid
+
+ String Content + Identifier (CID) +
+
name (optional)
+
+ String Optional + name for pinned data; can be used for lookups later +
+
origins (optional)
+
+ set[String] + Optional list of multiaddrs known to provide the data; see Provider + Hints in the docs +
+
meta (optional)
+
+ map[String, String] + Optional metadata for pin object +
+
+ +
+
+

+ PinResults - + Up +

+
+ Response used for listing pin objects matching request +
+
+
count
+
+ Integer The + total number of pin objects that exist for passed query filters + format: int32 +
+
results
+
+ set[PinStatus] + An array of PinStatus results +
+
+ +
+
+

+ PinStatus - + Up +

+
Pin object with status
+
+
requestid
+
+ String Globally + unique identifier of the pin request; can be used to check the status + of ongoing pinning, or pin removal +
+
status
+
+ Status +
+
created
+
+ Date Immutable + timestamp indicating when a pin request entered a pinning service; can + be used for filtering results and pagination format: date-time +
+
pin
+
+ Pin +
+
delegates
+
+ set[String] List + of multiaddrs designated by pinning service that will receive the pin + data; see Provider Hints in the docs +
+
info (optional)
+
+ map[String, String] + Optional info for PinStatus response +
+
+ +
+
+

+ Status - + Up +

+
+ Status a pin object can have at a pinning service +
+
+ +
+
+

+ TextMatchingStrategy - + Up +

+
Alternative text matching strategy
+
+ +
+ + diff --git a/packages/api-spec/project.json b/docs/api-spec/project.json similarity index 100% rename from packages/api-spec/project.json rename to docs/api-spec/project.json diff --git a/packages/api-spec/src/crate-spec.openapi.yml b/docs/api-spec/src/crate-spec.openapi.yml similarity index 88% rename from packages/api-spec/src/crate-spec.openapi.yml rename to docs/api-spec/src/crate-spec.openapi.yml index d1acc72..5fcd4f3 100644 --- a/packages/api-spec/src/crate-spec.openapi.yml +++ b/docs/api-spec/src/crate-spec.openapi.yml @@ -30,19 +30,20 @@ servers: paths: /file: get: - summary: Fetches FileModel for a path relative to the user root. + summary: | + Retrieve file metadata from Crate. parameters: - name: path in: query required: false schema: description: File path - example: /dir1/dir2/file.txt + example: /ipfs/Qm.../dir1/dir2/file.txt type: string description: | Get FileModel object a file/directory specified by either a CID or the path from the root of the user's filesystem. If neither are - specified, we return the FileModel for the root directory. + specified, we return the FileModel for the user's directory. tags: - files responses: @@ -53,15 +54,9 @@ paths: schema: $ref: "#/components/schemas/FileModel" post: - parameters: - - name: path - in: query - required: false - schema: - $ref: "#/components/schemas/CID" + summary: Add a file to Crate. description: | - Upload one or many files/directories to a path specified in the query - parameters. If ignored, this will save the files to the root directory. + Upload one or many files to Crate and get back FileModel objects. tags: - files requestBody: @@ -85,6 +80,100 @@ paths: minItems: 1 items: $ref: "#/components/schemas/FileModel" + delete: + summary: Delete a file from Crate. + parameters: + - name: path + in: query + required: true + schema: + type: string + description: File path + example: /ipfs/Qm.../dir1/dir2/file.txt + description: | + Removes a file from the specified path, and returns a path to the + parent directory from an updated root CID. + tags: + - files + responses: + "200": + description: Successful response (path) + content: + application/json: + schema: + type: string + description: File path + example: /ipfs/Qm.../dir1/dir2 + /dir: + post: + summary: Create an empty directory. + parameters: + - name: path + in: query + required: true + schema: + description: File path + example: /ipfs/Qm.../dir1 + type: string + - name: name + in: query + required: true + schema: + description: Directory name + type: string + example: dir2 + description: | + Copies the existing structure from the root hash, adds a new named + folder, and returns the path to it from the new root CID. + tags: + - files + responses: + "200": + description: Successful response (path) + content: + application/json: + schema: + type: string + description: File path + example: /ipfs/Qm.../dir1/dir2 + /dir/add: + post: + summary: Add a file to a directory. + tags: + - files + parameters: + - name: path + in: query + required: true + schema: + description: Directory path + example: /ipfs/Qm.../dir1/dir2 + type: string + - name: name + in: query + required: true + schema: + description: File name + type: string + example: file.txt + - name: cid + in: query + required: true + schema: + description: CID for file + type: string + example: Qm... + description: | + Adds an existing file with hash and name specified to a directory. + responses: + "200": + description: Successful response (path) + content: + application/json: + schema: + type: string + description: File path + example: /ipfs/Qm.../dir1/dir2/file.txt /pins: get: diff --git a/packages/common/.eslintrc.json b/libs/shared/common/.eslintrc.json similarity index 93% rename from packages/common/.eslintrc.json rename to libs/shared/common/.eslintrc.json index b6ef3c9..8666624 100644 --- a/packages/common/.eslintrc.json +++ b/libs/shared/common/.eslintrc.json @@ -1,5 +1,5 @@ { - "extends": ["../../.eslintrc.json"], + "extends": ["../../../.eslintrc.json"], "ignorePatterns": ["!**/*", "node_modules", "dist"], "overrides": [ { diff --git a/packages/common/.gitignore b/libs/shared/common/.gitignore similarity index 100% rename from packages/common/.gitignore rename to libs/shared/common/.gitignore diff --git a/packages/common/CHANGELOG.md b/libs/shared/common/CHANGELOG.md similarity index 70% rename from packages/common/CHANGELOG.md rename to libs/shared/common/CHANGELOG.md index 41f8fc5..21b0c92 100644 --- a/packages/common/CHANGELOG.md +++ b/libs/shared/common/CHANGELOG.md @@ -4,24 +4,21 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/s ## [0.3.0](https://github.com/Crate-Network/crate/compare/@crate/common-0.2.0...@crate/common-0.3.0) (2022-06-20) - ### Features -* added renameFile, restructured common ([bf0e9e8](https://github.com/Crate-Network/crate/commit/bf0e9e8219f5f8377f5adb40c167483b6827caa1)) +- added renameFile, restructured common ([bf0e9e8](https://github.com/Crate-Network/crate/commit/bf0e9e8219f5f8377f5adb40c167483b6827caa1)) ## [0.2.0](https://github.com/Crate-Network/crate/compare/@crate/common-0.1.0...@crate/common-0.2.0) (2022-06-19) - ### Features -* bootstrapped ipfs on server ([5dd8b2b](https://github.com/Crate-Network/crate/commit/5dd8b2b3c86a56590bd6c066bae91122bd849a16)) -* updated User to include rootCID ([315fd2e](https://github.com/Crate-Network/crate/commit/315fd2e4116c14d8edaa3602fc04d055d434b80a)) -* use CID object instead of string ([59b934b](https://github.com/Crate-Network/crate/commit/59b934be6b3f6d3f124f9724fc8e7c9bc89121dd)) +- bootstrapped ipfs on server ([5dd8b2b](https://github.com/Crate-Network/crate/commit/5dd8b2b3c86a56590bd6c066bae91122bd849a16)) +- updated User to include rootCID ([315fd2e](https://github.com/Crate-Network/crate/commit/315fd2e4116c14d8edaa3602fc04d055d434b80a)) +- use CID object instead of string ([59b934b](https://github.com/Crate-Network/crate/commit/59b934be6b3f6d3f124f9724fc8e7c9bc89121dd)) ## [0.1.0](https://github.com/Crate-Network/crate/compare/@crate/common-0.0.1...@crate/common-0.1.0) (2022-06-19) - ### Features -* duplicate file ([b860750](https://github.com/Crate-Network/crate/commit/b860750325d67d4f84789a946feafde7de8ddba6)) -* updated FileModel to reflect folder info ([2ace0a1](https://github.com/Crate-Network/crate/commit/2ace0a1a2eecf4584e11fd9cc536775990402b54)) +- duplicate file ([b860750](https://github.com/Crate-Network/crate/commit/b860750325d67d4f84789a946feafde7de8ddba6)) +- updated FileModel to reflect folder info ([2ace0a1](https://github.com/Crate-Network/crate/commit/2ace0a1a2eecf4584e11fd9cc536775990402b54)) diff --git a/libs/shared/common/jest.config.ts b/libs/shared/common/jest.config.ts new file mode 100644 index 0000000..462f783 --- /dev/null +++ b/libs/shared/common/jest.config.ts @@ -0,0 +1,15 @@ +/* eslint-disable */ +export default { + displayName: "common", + preset: "../../../jest.preset.js", + globals: { + "ts-jest": { + tsconfig: "/tsconfig.spec.json", + }, + }, + transform: { + "^.+\\.[tj]s$": "ts-jest", + }, + moduleFileExtensions: ["ts", "js", "html"], + coverageDirectory: "../../coverage/libs/common", +} diff --git a/libs/shared/common/package.json b/libs/shared/common/package.json new file mode 100644 index 0000000..41e298b --- /dev/null +++ b/libs/shared/common/package.json @@ -0,0 +1,15 @@ +{ + "name": "@crate/common", + "version": "0.3.0", + "author": "Christian van der Loo", + "type": "commonjs", + "private": true, + "license": "MIT", + "dependencies": { + "@crate/types": "*", + "@ipld/dag-pb": "^2.1.17", + "ipfs-http-client": "^57.0.3", + "ipfs-unixfs": "^6.0.9", + "multiformats": "^9.7.0" + } +} diff --git a/libs/shared/common/project.json b/libs/shared/common/project.json new file mode 100644 index 0000000..6b69300 --- /dev/null +++ b/libs/shared/common/project.json @@ -0,0 +1,40 @@ +{ + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "name": "@crate/common", + "sourceRoot": "libs/shared/common/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/libs/common", + "main": "libs/shared/common/src/index.ts", + "tsConfig": "libs/shared/common/tsconfig.lib.json", + "assets": ["libs/shared/common/*.md"] + } + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["libs/shared/common/**/*.ts"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/libs/shared/common"], + "options": { + "jestConfig": "libs/shared/common/jest.config.ts", + "passWithNoTests": true + } + }, + "version": { + "executor": "@jscutlery/semver:version", + "options": { + "preset": "conventional" + } + } + }, + "tags": [] +} diff --git a/packages/common/src/error/FileError.ts b/libs/shared/common/src/error/FileError.ts similarity index 88% rename from packages/common/src/error/FileError.ts rename to libs/shared/common/src/error/FileError.ts index 716468d..ad1b68d 100644 --- a/packages/common/src/error/FileError.ts +++ b/libs/shared/common/src/error/FileError.ts @@ -1,5 +1,3 @@ -import { FileModel } from "@crate/api-lib" - export enum FileErrorType { INVALID = "Invalid function usage.", EXISTS = "File with name already exists", @@ -10,7 +8,6 @@ export enum FileErrorType { } export class FileError extends Error { - readonly file: FileModel constructor(m: FileErrorType) { super(m) Object.setPrototypeOf(this, new.target.prototype) // restore prototype chain diff --git a/packages/common/src/error/index.ts b/libs/shared/common/src/error/index.ts similarity index 100% rename from packages/common/src/error/index.ts rename to libs/shared/common/src/error/index.ts diff --git a/packages/common/src/index.ts b/libs/shared/common/src/index.ts similarity index 65% rename from packages/common/src/index.ts rename to libs/shared/common/src/index.ts index bb7b5d9..9084ed4 100644 --- a/packages/common/src/index.ts +++ b/libs/shared/common/src/index.ts @@ -1,3 +1,2 @@ -export * from "./model" export * from "./lib" export * from "./error" diff --git a/packages/common/src/lib/files.ts b/libs/shared/common/src/lib/files.ts similarity index 83% rename from packages/common/src/lib/files.ts rename to libs/shared/common/src/lib/files.ts index 593b8d6..076eb99 100644 --- a/packages/common/src/lib/files.ts +++ b/libs/shared/common/src/lib/files.ts @@ -1,6 +1,6 @@ import { CID, Node } from "./ipfs" import { Buffer } from "buffer" -import { FileModel, FileModelTypeEnum as FileType } from "@crate/api-lib" +import { FileModel, FileType } from "@crate/types" export async function createFile( type: FileType, @@ -21,7 +21,7 @@ export function renameFile(file: FileModel, newName: string): FileModel { } export function duplicateFile(file: FileModel): FileModel { - const [name, ...rest] = file.name.split(".") + const [name, ...rest] = file.name ? file.name.split(".") : [file.cid] return { ...file, name: name + " copy." + rest.join("."), @@ -31,7 +31,10 @@ export function duplicateFile(file: FileModel): FileModel { // splits a path into segments export function splitPath(path: string) { - return path.split("/").filter((e) => e !== "" && e !== null) + return path + .split("/") + .filter((e) => e !== "" && e !== null) + .slice(1) } // verify path format diff --git a/packages/common/src/lib/index.ts b/libs/shared/common/src/lib/index.ts similarity index 100% rename from packages/common/src/lib/index.ts rename to libs/shared/common/src/lib/index.ts diff --git a/packages/common/src/lib/ipfs.ts b/libs/shared/common/src/lib/ipfs.ts similarity index 88% rename from packages/common/src/lib/ipfs.ts rename to libs/shared/common/src/lib/ipfs.ts index d6882ae..5e7363a 100644 --- a/packages/common/src/lib/ipfs.ts +++ b/libs/shared/common/src/lib/ipfs.ts @@ -1,5 +1,5 @@ import { FileError, FileErrorType } from "../error" -import { FileModel, FileModelTypeEnum as FileType } from "@crate/api-lib" +import { FileModel, FileType } from "@crate/types" import { UnixFS as _UnixFS } from "ipfs-unixfs" import { CID as _CID } from "multiformats/cid" import { sha256 } from "multiformats/hashes/sha2" @@ -32,7 +32,6 @@ export class Node { static fromFile(file: LimitedFileModel, content?: Uint8Array): PBNode { if (file.type === "file" && (content === undefined || content === null)) { - console.error("Pass file contents as second parameter for files.") throw new FileError(FileErrorType.FILE_INVALID) } return createNode( @@ -64,16 +63,20 @@ export class Node { type: "directory", links: node.Links.map((link) => ({ cid: link.Hash.toString(), - name: link.Name, - size: link.Tsize, + name: link.Name || cid.toString(), + size: link.Tsize || 0, })), - cumulativeSize: node.Links.reduce((a, b) => a + b.Tsize, 0), + cumulativeSize: node.Links.reduce((a, b) => a + (b.Tsize || 0), 0), } : { type: "file", }), } } + + static toRawBlock(node: PBNode): Uint8Array { + return encode(node) + } } export class UnixFS extends _UnixFS { diff --git a/packages/common/src/tests/ipfs.test.ts b/libs/shared/common/src/tests/ipfs.test.ts similarity index 100% rename from packages/common/src/tests/ipfs.test.ts rename to libs/shared/common/src/tests/ipfs.test.ts diff --git a/libs/shared/common/tsconfig.json b/libs/shared/common/tsconfig.json new file mode 100644 index 0000000..8122543 --- /dev/null +++ b/libs/shared/common/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/shared/common/tsconfig.lib.json b/libs/shared/common/tsconfig.lib.json new file mode 100644 index 0000000..e85ef50 --- /dev/null +++ b/libs/shared/common/tsconfig.lib.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts"], + "exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"] +} diff --git a/libs/shared/common/tsconfig.spec.json b/libs/shared/common/tsconfig.spec.json new file mode 100644 index 0000000..546f128 --- /dev/null +++ b/libs/shared/common/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/libs/shared/types/.eslintrc.json b/libs/shared/types/.eslintrc.json new file mode 100644 index 0000000..3456be9 --- /dev/null +++ b/libs/shared/types/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/libs/shared/types/README.md b/libs/shared/types/README.md new file mode 100644 index 0000000..d7bfd55 --- /dev/null +++ b/libs/shared/types/README.md @@ -0,0 +1,11 @@ +# types + +This library was generated with [Nx](https://nx.dev). + +## Building + +Run `nx build types` to build the library. + +## Running unit tests + +Run `nx test types` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/shared/types/jest.config.ts b/libs/shared/types/jest.config.ts new file mode 100644 index 0000000..4bf31d3 --- /dev/null +++ b/libs/shared/types/jest.config.ts @@ -0,0 +1,15 @@ +/* eslint-disable */ +export default { + displayName: "types", + preset: "../../../jest.preset.js", + globals: { + "ts-jest": { + tsconfig: "/tsconfig.spec.json", + }, + }, + transform: { + "^.+\\.[tj]s$": "ts-jest", + }, + moduleFileExtensions: ["ts", "js", "html"], + coverageDirectory: "../../coverage/libs/types", +} diff --git a/libs/shared/types/package.json b/libs/shared/types/package.json new file mode 100644 index 0000000..cebb96f --- /dev/null +++ b/libs/shared/types/package.json @@ -0,0 +1,7 @@ +{ + "name": "@crate/types", + "version": "0.0.1", + "author": "Christian van der Loo", + "type": "commonjs", + "private": true +} diff --git a/libs/shared/types/project.json b/libs/shared/types/project.json new file mode 100644 index 0000000..7206322 --- /dev/null +++ b/libs/shared/types/project.json @@ -0,0 +1,40 @@ +{ + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "name": "@crate/types", + "sourceRoot": "libs/shared/types/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nrwl/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/libs/types", + "main": "libs/shared/types/src/index.ts", + "tsConfig": "libs/shared/types/tsconfig.lib.json", + "assets": ["libs/shared/types/*.md"] + } + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["libs/shared/types/**/*.ts"] + } + }, + "test": { + "executor": "@nrwl/jest:jest", + "outputs": ["coverage/libs/shared/types"], + "options": { + "jestConfig": "libs/shared/types/jest.config.ts", + "passWithNoTests": true + } + }, + "version": { + "executor": "@jscutlery/semver:version", + "options": { + "preset": "conventional" + } + } + }, + "tags": [] +} diff --git a/libs/shared/types/src/files.ts b/libs/shared/types/src/files.ts new file mode 100644 index 0000000..b0502ac --- /dev/null +++ b/libs/shared/types/src/files.ts @@ -0,0 +1,88 @@ +/** + * A file object as represented on @crate/web + * @export + * @interface FileModel + */ +export interface FileModel { + /** + * Content Identifier (CID) + * @type {string} + * @memberof FileModel + */ + cid: string + /** + * File/folder name + * @type {string} + * @memberof FileModel + */ + name?: string + /** + * Whether this is a file or directory + * @type {FileType} + * @memberof FileModel + */ + type: FileType + /** + * Encryption key for the file in string format, parsed from binary representation in UTF-8. This key has been encrypted by the user\'s data key. If this exists, it means the file is for private consumption. + * @type {string} + * @memberof FileModel + */ + signedEncryptionKey?: string + /** + * The size of the file. + * @type {number} + * @memberof FileModel + */ + size: number + /** + * The date that this file was last modified in ISO-8601. + * @type {string} + * @memberof FileModel + */ + date: string + /** + * The CIDs linked to from this directory. + * @type {Array} + * @memberof FileModel + */ + links?: Array + /** + * The size of the directory and all contained files. + * @type {number} + * @memberof FileModel + */ + cumulativeSize?: number +} + +/** + * Simple type which encapsulates possible file types. + * @export + * @interface FileType + */ +export type FileType = "directory" | "file" + +/** + * Structure for linked items in a directory. Name can vary from directory to directory. + * @export + * @interface FolderLink + */ +export interface FolderLink { + /** + * Content Identifier (CID) + * @type {string} + * @memberof FolderLink + */ + cid: string + /** + * Name of linked file. + * @type {string} + * @memberof FolderLink + */ + name: string + /** + * Size of linked file. + * @type {number} + * @memberof FolderLink + */ + size: number +} diff --git a/libs/shared/types/src/index.ts b/libs/shared/types/src/index.ts new file mode 100644 index 0000000..57df6f1 --- /dev/null +++ b/libs/shared/types/src/index.ts @@ -0,0 +1,3 @@ +export * from "./user" +export * from "./files" +export * from "./pins" diff --git a/libs/shared/types/src/pins.ts b/libs/shared/types/src/pins.ts new file mode 100644 index 0000000..ba4d84d --- /dev/null +++ b/libs/shared/types/src/pins.ts @@ -0,0 +1,107 @@ +/** + * Pin object + * @export + * @interface Pin + */ +export interface Pin { + /** + * Content Identifier (CID) + * @type {string} + * @memberof Pin + */ + cid: string + /** + * Optional name for pinned data; can be used for lookups later + * @type {string} + * @memberof Pin + */ + name?: string + /** + * Optional list of multiaddrs known to provide the data; see Provider Hints in the docs + * @type {string[]} + * @memberof Pin + */ + origins?: string[] + /** + * Optional metadata for pin object + * @type {Record} + * @memberof Pin + */ + meta?: Record +} + +/** + * Response used for listing pin objects matching request + * @export + * @interface PinResults + */ +export interface PinResults { + /** + * The total number of pin objects that exist for passed query filters + * @type {number} + * @memberof PinResults + */ + count: number + /** + * An array of PinStatus results + * @type {PinStatus[]} + * @memberof PinResults + */ + results: PinStatus[] +} + +/** + * Pin object with status + * @export + * @interface PinStatus + */ +export interface PinStatus { + /** + * Globally unique identifier of the pin request; can be used to check the status of ongoing pinning, or pin removal + * @type {string} + * @memberof PinStatus + */ + requestid: string + /** + * + * @type {Status} + * @memberof PinStatus + */ + status: Status + /** + * Immutable timestamp indicating when a pin request entered a pinning service; can be used for filtering results and pagination + * @type {string} + * @memberof PinStatus + */ + created: string + /** + * + * @type {Pin} + * @memberof PinStatus + */ + pin: Pin + /** + * List of multiaddrs designated by pinning service that will receive the pin data; see Provider Hints in the docs + * @type {string[]} + * @memberof PinStatus + */ + delegates: string[] + /** + * Optional info for PinStatus response + * @type {Record} + * @memberof PinStatus + */ + info?: Record +} + +/** + * Status a pin object can have at a pinning service + * @export + * @enum {string} + */ +export const enum Status { + Queued = "queued", + Pinning = "pinning", + Pinned = "pinned", + Failed = "failed", +} diff --git a/libs/shared/types/src/user.ts b/libs/shared/types/src/user.ts new file mode 100644 index 0000000..ad08077 --- /dev/null +++ b/libs/shared/types/src/user.ts @@ -0,0 +1,86 @@ +/** + * User information object + * @export + * @interface UserInfo + */ +export type UserInfo = { + /** + * First name of the user + * @type {string} + * @memberof UserInfo + */ + firstName: string + /** + * Last name of the user + * @type {string} + * @memberof UserInfo + */ + lastName: string + /** + * User's organization + * @type {string} + * @memberof UserInfo + */ + organization: string +} + +/** + * User security object + * @export + * @interface UserSecurity + */ +export type UserSecurity = { + /** + * Whether the user has 2-factor authentication + * @type {boolean} + * @memberof UserSecurity + */ + uses2FA: boolean + /** + * Describes a mapping from device UUID to a device's public key. + * @type {Record} + * @memberof UserSecurity + */ + devices: Record + /** + * Describes a mapping from device UUID to the user's data key, signed by the + * particular device. + * @type {Record} + * @memberof UserSecurity + */ + signedDataKey: Record + /** + * The user's data key, encrypted by a recovery password. + * @type {string | null} + * @memberof UserSecurity + */ + recoveryKey: string | null + /** + * The user's unencrypted data key, stored if the user has not set up + * 2-factor authentication. + * @type {string | null} + * @memberof UserSecurity + */ + dataKey: string | null +} + +/** + * Tracking data for the user's files + * @export + * @interface UserFiles + */ +export type UserFiles = { + /** + * The root CID of the user's directory tree. + * @type {string | null} + * @memberof UserFiles + */ + rootCID: string | null +} + +/** + * The overall user model to store in Firestore + * @export + * @interface UserModel + */ +export type UserModel = UserInfo & UserSecurity & UserFiles diff --git a/libs/shared/types/tsconfig.json b/libs/shared/types/tsconfig.json new file mode 100644 index 0000000..8122543 --- /dev/null +++ b/libs/shared/types/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/shared/types/tsconfig.lib.json b/libs/shared/types/tsconfig.lib.json new file mode 100644 index 0000000..e85ef50 --- /dev/null +++ b/libs/shared/types/tsconfig.lib.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": [] + }, + "include": ["**/*.ts"], + "exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"] +} diff --git a/libs/shared/types/tsconfig.spec.json b/libs/shared/types/tsconfig.spec.json new file mode 100644 index 0000000..546f128 --- /dev/null +++ b/libs/shared/types/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] +} diff --git a/nx.json b/nx.json index bba7958..c14ef0c 100644 --- a/nx.json +++ b/nx.json @@ -27,5 +27,19 @@ }, "affected": { "defaultBase": "main" + }, + "defaultProject": "web", + "cli": { + "defaultCollection": "@nxext/vite" + }, + "generators": { + "@nxext/vite": { + "application": { + "linter": "eslint" + }, + "library": { + "linter": "eslint" + } + } } } diff --git a/package.json b/package.json index c8022f2..b94c587 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "@commitlint/config-conventional": "^17.0.0", "@jscutlery/semver": "^2.25.2", "@nrwl/eslint-plugin-nx": "14.3.6", + "@nrwl/express": "^14.4.2", "@nrwl/jest": "14.3.6", "@nrwl/js": "^14.3.5", "@nrwl/linter": "^14.3.6", @@ -17,22 +18,28 @@ "@nxext/vite": "^14.0.0", "@openapitools/openapi-generator-cli": "2.5.1", "@trumbitta/nx-plugin-openapi": "^1.11.0", + "@types/express": "4.17.13", "@types/jest": "28.1.3", "@types/node": "18.0.0", "@typescript-eslint/eslint-plugin": "~5.29.0", "@typescript-eslint/parser": "~5.29.0", "eslint": "~8.18.0", "eslint-config-prettier": "8.5.0", + "eslint-plugin-import": "2.25.2", "eslint-plugin-prettier": "^4.2.1", "husky": "^8.0.0", "jest": "28.1.1", + "jest-environment-jsdom": "^28.1.2", "lint-staged": "^13.0.3", "nx": "14.3.6", "ts-jest": "28.0.5", - "ts-node": "~10.8.0" + "ts-node": "~10.8.0", + "vite": "^2.9.9", + "vite-plugin-eslint": "1.3.0" }, "workspaces": [ - "packages/*" + "apps/*", + "libs/shared/*" ], "lint-staged": { "**/*.{tsx,ts,jsx,js}": [ @@ -43,19 +50,20 @@ }, "scripts": { "build": "nx run-many --target=build --all", - "build:web": "nx build web", + "build:web": "nx build @crate/web", "build:since": "nx affected --target=build", "test:all": "nx run-many --target=test --all", - "test:web": "nx test web", + "test:web": "nx test @crate/web", "test:since": "nx affected --target=test", "dev": "nx run-many --target=dev --all", - "dev:web": "nx dev web", + "dev:web": "nx dev @crate/web", "docker": "nx run-many --target=docker --all", - "docs": "nx run-many --target=generate-sources --all && nx run @crate/api-lib:build", + "docs": "nx run-many --target=generate-sources --all && nx run @crate/types:build", "prepare": "husky install", "postinstall": "patch-package" }, "dependencies": { + "express": "4.17.2", "ipfs-utils": "9.0.7", "node-fetch": "2", "patch-package": "^6.4.7", diff --git a/packages/api-docs/src/index.html b/packages/api-docs/src/index.html deleted file mode 100644 index d0e7386..0000000 --- a/packages/api-docs/src/index.html +++ /dev/null @@ -1,933 +0,0 @@ - - - - Crate Network API - - - -

Crate Network API

-

About this spec

-

The Crate API exposes several endpoints which allows the Crate macOS, iOS, -iPadOS and web clients to interact with Crate's IPFS cluster without the -clients needing to run IPFS clients of their own. Crate Network implements -the IPFS Pinning API specification at the /pins endpoint, as described by -the spec found -on GitHub. -The pinning API accepts a Bearer authorization token retrieved from your -Crate account. This identifies your user and adds the pinned content to -your files on Crate. This version of the API is modified to include -metadata, all of which is optional so that Crate continues to conform to -the IPFS spec.

-

The Filecoin replication service is handled via the pinning API. Instead of -using untrusted centralized cloud storage as the backend, Crate safely -replicates content onto other decentralized networks. When a request comes -to the pinning service to retrieve the content, Crate will prioritize -cached content, otherwise falling back to the Filecoin network to retrieve -your files.

-
- -
Contact Info: team@openapitools.org
-
Version: 1.0.0
-
BasePath:/api/v1
-
All rights reserved
-
http://apache.org/licenses/LICENSE-2.0.html
-

Access

-
    -
  1. HTTP Basic Authentication
  2. -
- -

Methods

- [ Jump to Models ] - -

Table of Contents

-
-

Files

- -

Pins

- - -

Files

-
-
- Up -
get /file
-
(fileGet)
-
Get FileDescriptor object a file/directory specified by either a CID or -the path from the root of the user's filesystem. If neither are -specified, we return the FileDescriptor for the root directory.
- - - - - -

Query parameters

-
-
path (optional)
- -
Query Parameter — default: null
cid (optional)
- -
Query Parameter — default: null
-
- - -

Return type

- - - - -

Example data

-
Content-Type: application/json
-
{
-  "date" : "date",
-  "mode" : 1.4658129805029452,
-  "size" : 0.8008281904610115,
-  "cumulativeSize" : 6.027456183070403,
-  "links" : [ {
-    "size" : 145,
-    "name" : "file.txt",
-    "cid" : "Qm..."
-  }, {
-    "size" : 145,
-    "name" : "file.txt",
-    "cid" : "Qm..."
-  } ],
-  "type" : "directory",
-  "cid" : "Qm...",
-  "signedEncryptionKey" : "signedEncryptionKey"
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. -
    -
  • application/json
  • -
- -

Responses

-

200

- Successful response (FileDescriptor object) - FileDescriptor -
-
-
-
- Up -
post /file
-
(filePost)
-
Upload one or many files/directories to a path specified in the query -parameters. If ignored, this will save the files to the root directory.
- - -

Consumes

- This API call consumes the following media types via the Content-Type request header: -
    -
  • multipart/form-data
  • -
- - - -

Query parameters

-
-
path (optional)
- -
Query Parameter — default: null
-
- -

Form parameters

-
-
files (optional)
- -
Form Parameter — default: null format: binary
-
- -

Return type

- - - - -

Example data

-
Content-Type: application/json
-
{
-  "date" : "date",
-  "mode" : 1.4658129805029452,
-  "size" : 0.8008281904610115,
-  "cumulativeSize" : 6.027456183070403,
-  "links" : [ {
-    "size" : 145,
-    "name" : "file.txt",
-    "cid" : "Qm..."
-  }, {
-    "size" : 145,
-    "name" : "file.txt",
-    "cid" : "Qm..."
-  } ],
-  "type" : "directory",
-  "cid" : "Qm...",
-  "signedEncryptionKey" : "signedEncryptionKey"
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. -
    -
  • application/json
  • -
- -

Responses

-

200

- Successful response (FileDescriptor object) - FileDescriptor -
-
-

Pins

-
-
- Up -
get /pins
-
List pin objects (pinsGet)
-
List all the pin objects, matching optional filters; when no filter is provided, only successful pins are returned.
- - - - - -

Query parameters

-
-
cid (optional)
- -
Query Parameter — Return pin objects responsible for pinning the specified CID(s); be aware that using longer hash functions introduces further constraints on the number of CIDs that will fit under the limit of 2000 characters per URL in browser contexts default: null
name (optional)
- -
Query Parameter — Return pin objects with specified name (by default a case-sensitive, exact match) default: null
match (optional)
- -
Query Parameter — Customize the text matching strategy applied when the name filter is present; exact (the default) is a case-sensitive exact match, partial matches anywhere in the name, iexact and ipartial are case-insensitive versions of the exact and partial strategies default: null
status (optional)
- -
Query Parameter — Return pin objects for pins with the specified status default: null
before (optional)
- -
Query Parameter — Return results created (queued) before provided timestamp default: null format: date-time
after (optional)
- -
Query Parameter — Return results created (queued) after provided timestamp default: null format: date-time
limit (optional)
- -
Query Parameter — Max records to return default: 10 format: int32
meta (optional)
- -
Query Parameter — Return pin objects that match specified metadata keys passed as a string representation of a JSON object; when implementing a client library, make sure the parameter is URL-encoded to ensure safe transport default: null
-
- - -

Return type

-
- PinResults - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "count" : 1,
-  "results" : [ {
-    "pin" : {
-      "meta" : {
-        "app_id" : "99986338-1113-4706-8302-4420da6158aa"
-      },
-      "name" : "PreciousData.pdf",
-      "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
-      "cid" : "Qm..."
-    },
-    "requestid" : "UniqueIdOfPinRequest",
-    "created" : "2020-07-27T17:32:28Z",
-    "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
-    "info" : {
-      "status_details" : "Queue position: 7 of 9"
-    }
-  }, {
-    "pin" : {
-      "meta" : {
-        "app_id" : "99986338-1113-4706-8302-4420da6158aa"
-      },
-      "name" : "PreciousData.pdf",
-      "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
-      "cid" : "Qm..."
-    },
-    "requestid" : "UniqueIdOfPinRequest",
-    "created" : "2020-07-27T17:32:28Z",
-    "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
-    "info" : {
-      "status_details" : "Queue position: 7 of 9"
-    }
-  }, {
-    "pin" : {
-      "meta" : {
-        "app_id" : "99986338-1113-4706-8302-4420da6158aa"
-      },
-      "name" : "PreciousData.pdf",
-      "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
-      "cid" : "Qm..."
-    },
-    "requestid" : "UniqueIdOfPinRequest",
-    "created" : "2020-07-27T17:32:28Z",
-    "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
-    "info" : {
-      "status_details" : "Queue position: 7 of 9"
-    }
-  }, {
-    "pin" : {
-      "meta" : {
-        "app_id" : "99986338-1113-4706-8302-4420da6158aa"
-      },
-      "name" : "PreciousData.pdf",
-      "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
-      "cid" : "Qm..."
-    },
-    "requestid" : "UniqueIdOfPinRequest",
-    "created" : "2020-07-27T17:32:28Z",
-    "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
-    "info" : {
-      "status_details" : "Queue position: 7 of 9"
-    }
-  }, {
-    "pin" : {
-      "meta" : {
-        "app_id" : "99986338-1113-4706-8302-4420da6158aa"
-      },
-      "name" : "PreciousData.pdf",
-      "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
-      "cid" : "Qm..."
-    },
-    "requestid" : "UniqueIdOfPinRequest",
-    "created" : "2020-07-27T17:32:28Z",
-    "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
-    "info" : {
-      "status_details" : "Queue position: 7 of 9"
-    }
-  } ]
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. -
    -
  • application/json
  • -
- -

Responses

-

200

- Successful response (PinResults object) - PinResults -

400

- Error response (Bad request) - Failure -

401

- Error response (Unauthorized; access token is missing or invalid) - Failure -

404

- Error response (The specified resource was not found) - Failure -

409

- Error response (Insufficient funds) - Failure -

4XX

- Error response (Custom service error) - Failure -

5XX

- Error response (Unexpected internal server error) - Failure -
-
-
-
- Up -
post /pins
-
Add pin object (pinsPost)
-
Add a new pin object for the current access token
- - -

Consumes

- This API call consumes the following media types via the Content-Type request header: -
    -
  • application/json
  • -
- -

Request body

-
-
Pin Pin (required)
- -
Body Parameter —
- -
- - - - -

Return type

-
- PinStatus - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "pin" : {
-    "meta" : {
-      "app_id" : "99986338-1113-4706-8302-4420da6158aa"
-    },
-    "name" : "PreciousData.pdf",
-    "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
-    "cid" : "Qm..."
-  },
-  "requestid" : "UniqueIdOfPinRequest",
-  "created" : "2020-07-27T17:32:28Z",
-  "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
-  "info" : {
-    "status_details" : "Queue position: 7 of 9"
-  }
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. -
    -
  • application/json
  • -
- -

Responses

-

202

- Successful response (PinStatus object) - PinStatus -

400

- Error response (Bad request) - Failure -

401

- Error response (Unauthorized; access token is missing or invalid) - Failure -

404

- Error response (The specified resource was not found) - Failure -

409

- Error response (Insufficient funds) - Failure -

4XX

- Error response (Custom service error) - Failure -

5XX

- Error response (Unexpected internal server error) - Failure -
-
-
-
- Up -
delete /pins/{requestid}
-
Remove pin object (pinsRequestidDelete)
-
Remove a pin object
- -

Path parameters

-
-
requestid (required)
- -
Path Parameter — default: null
-
- - - - - - - - - - -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. -
    -
  • application/json
  • -
- -

Responses

-

202

- Successful response (no body, pin removed) - -

400

- Error response (Bad request) - Failure -

401

- Error response (Unauthorized; access token is missing or invalid) - Failure -

404

- Error response (The specified resource was not found) - Failure -

409

- Error response (Insufficient funds) - Failure -

4XX

- Error response (Custom service error) - Failure -

5XX

- Error response (Unexpected internal server error) - Failure -
-
-
-
- Up -
get /pins/{requestid}
-
Get pin object (pinsRequestidGet)
-
Get a pin object and its status
- -

Path parameters

-
-
requestid (required)
- -
Path Parameter — default: null
-
- - - - - - -

Return type

-
- PinStatus - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "pin" : {
-    "meta" : {
-      "app_id" : "99986338-1113-4706-8302-4420da6158aa"
-    },
-    "name" : "PreciousData.pdf",
-    "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
-    "cid" : "Qm..."
-  },
-  "requestid" : "UniqueIdOfPinRequest",
-  "created" : "2020-07-27T17:32:28Z",
-  "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
-  "info" : {
-    "status_details" : "Queue position: 7 of 9"
-  }
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. -
    -
  • application/json
  • -
- -

Responses

-

200

- Successful response (PinStatus object) - PinStatus -

400

- Error response (Bad request) - Failure -

401

- Error response (Unauthorized; access token is missing or invalid) - Failure -

404

- Error response (The specified resource was not found) - Failure -

409

- Error response (Insufficient funds) - Failure -

4XX

- Error response (Custom service error) - Failure -

5XX

- Error response (Unexpected internal server error) - Failure -
-
-
-
- Up -
post /pins/{requestid}
-
Replace pin object (pinsRequestidPost)
-
Replace an existing pin object (shortcut for executing remove and add operations in one step to avoid unnecessary garbage collection of blocks present in both recursive pins)
- -

Path parameters

-
-
requestid (required)
- -
Path Parameter — default: null
-
- -

Consumes

- This API call consumes the following media types via the Content-Type request header: -
    -
  • application/json
  • -
- -

Request body

-
-
Pin Pin (required)
- -
Body Parameter —
- -
- - - - -

Return type

-
- PinStatus - -
- - - -

Example data

-
Content-Type: application/json
-
{
-  "pin" : {
-    "meta" : {
-      "app_id" : "99986338-1113-4706-8302-4420da6158aa"
-    },
-    "name" : "PreciousData.pdf",
-    "origins" : [ "/ip4/203.0.113.142/tcp/4001/p2p/QmSourcePeerId", "/ip4/203.0.113.114/udp/4001/quic/p2p/QmSourcePeerId" ],
-    "cid" : "Qm..."
-  },
-  "requestid" : "UniqueIdOfPinRequest",
-  "created" : "2020-07-27T17:32:28Z",
-  "delegates" : [ "/ip4/203.0.113.1/tcp/4001/p2p/QmServicePeerId" ],
-  "info" : {
-    "status_details" : "Queue position: 7 of 9"
-  }
-}
- -

Produces

- This API call produces the following media types according to the Accept request header; - the media type will be conveyed by the Content-Type response header. -
    -
  • application/json
  • -
- -

Responses

-

202

- Successful response (PinStatus object) - PinStatus -

400

- Error response (Bad request) - Failure -

401

- Error response (Unauthorized; access token is missing or invalid) - Failure -

404

- Error response (The specified resource was not found) - Failure -

409

- Error response (Insufficient funds) - Failure -

4XX

- Error response (Custom service error) - Failure -

5XX

- Error response (Unexpected internal server error) - Failure -
-
- -

Models

- [ Jump to Methods ] - -

Table of Contents

-
    -
  1. Failure -
  2. -
  3. Failure_error -
  4. -
  5. FileDescriptor -
  6. -
  7. FileDescriptor_links_inner -
  8. -
  9. Pin -
  10. -
  11. PinResults -
  12. -
  13. PinStatus -
  14. -
  15. Status -
  16. -
  17. TextMatchingStrategy -
  18. -
- -
-

Failure - Up

-
Response for a failed request
-
-
error
-
-
-
-

Failure_error - Up

-
-
-
reason
String Mandatory string identifying the type of error
-
details (optional)
String Optional, longer description of the error; may include UUID of transaction for support, links to documentation etc
-
-
-
-

FileDescriptor - Up

-
A file object as represented on @crate/web
-
-
cid
String Content Identifier (CID)
-
type
String Whether this is a file or directory
-
Enum:
-
directory
file
-
signedEncryptionKey (optional)
String Encryption key for the file in string format, parsed from binary -representation in UTF-8. This key has been encrypted by the user's -data key.
-
size
BigDecimal The size of the file.
-
date
String The date that this file was last modified in ISO-8601.
-
links (optional)
array[FileDescriptor_links_inner] The CIDs linked to from this directory.
-
cumulativeSize (optional)
BigDecimal The size of the directory and all contained files.
-
mode (optional)
BigDecimal Permissions for file.
-
-
-
-

FileDescriptor_links_inner - Up

-
Structure for linked items in a directory. Name can vary from -directory to directory.
-
-
cid
String Content Identifier (CID)
-
name
String Name of linked file.
-
size
BigDecimal Size of linked file.
-
-
-
-

Pin - Up

-
Pin object
-
-
cid
String Content Identifier (CID)
-
name (optional)
String Optional name for pinned data; can be used for lookups later
-
origins (optional)
set[String] Optional list of multiaddrs known to provide the data; see Provider Hints in the docs
-
meta (optional)
map[String, String] Optional metadata for pin object
-
-
-
-

PinResults - Up

-
Response used for listing pin objects matching request
-
-
count
Integer The total number of pin objects that exist for passed query filters format: int32
-
results
set[PinStatus] An array of PinStatus results
-
-
-
-

PinStatus - Up

-
Pin object with status
-
-
requestid
String Globally unique identifier of the pin request; can be used to check the status of ongoing pinning, or pin removal
-
status
-
created
Date Immutable timestamp indicating when a pin request entered a pinning service; can be used for filtering results and pagination format: date-time
-
pin
-
delegates
set[String] List of multiaddrs designated by pinning service that will receive the -pin data; see Provider Hints in the docs
-
info (optional)
map[String, String] Optional info for PinStatus response
-
-
-
-

Status - Up

-
Status a pin object can have at a pinning service
-
-
-
-
-

TextMatchingStrategy - Up

-
Alternative text matching strategy
-
-
-
- - diff --git a/packages/api-lib/.babelrc b/packages/api-lib/.babelrc deleted file mode 100644 index 2901b29..0000000 --- a/packages/api-lib/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]] -} \ No newline at end of file diff --git a/packages/api-lib/.gitignore b/packages/api-lib/.gitignore deleted file mode 100644 index 53c37a1..0000000 --- a/packages/api-lib/.gitignore +++ /dev/null @@ -1 +0,0 @@ -dist \ No newline at end of file diff --git a/packages/api-lib/README.md b/packages/api-lib/README.md deleted file mode 100644 index b41c74e..0000000 --- a/packages/api-lib/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE - -Inside an autogenerated lib. - -## Next step - -To actually use this lib, you must now run the `generate-sources` builder. - -The `generate-sources` builder has been pre-configured with the options you supplied when creating this lib with the `api-lib` schematic. -You can go check those options, and modify them if you need to, in `workspace.json`. - -When you are good, generate the sources running: - -```sh -nx run api-lib:generate-sources -``` - -You should run - either manually or via CI - this `generate-sources` builder every time the API spec file changes. - -## Multiple libs - -You can have multiple libs like this one, and configure them to use different OpenAPITools generators, or generate sources from different API spec files. - -### Example - -```sh -# Create a lib preconfigured to generate a TypeScript SDK based on Axios -nx generate @trumbitta/nx-plugin-openapi:api-lib api-axios --generator typescript-axios - -# Create a lib preconfigured to generate HTML docs -nx generate @trumbitta/nx-plugin-openapi:api-lib api-lib --generator html - -# Generate or update the TypeScript SDK based on Axios -nx run api-axios:generate-sources - -# Generate or update the HTML API docs -nx run api-lib:generate-sources -``` diff --git a/packages/api-lib/package.json b/packages/api-lib/package.json deleted file mode 100644 index 016d929..0000000 --- a/packages/api-lib/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@crate/api-lib", - "author": "Christian van der Loo", - "version": "0.0.1", - "private": true, - "main": "dist/index.js", - "types": "dist/index.d.ts", - "scripts": { - "build": "tsc" - }, - "dependencies": { - "@types/node": "^18.0.0", - "typescript": "^4.7.4" - } -} diff --git a/packages/api-lib/project.json b/packages/api-lib/project.json deleted file mode 100644 index 3ae7b6d..0000000 --- a/packages/api-lib/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "name": "@crate/api-lib", - "sourceRoot": "./packages/api-lib/src", - "projectType": "library", - "targets": { - "generate-sources": { - "executor": "@trumbitta/nx-plugin-openapi:generate-api-lib-sources", - "options": { - "useDockerBuild": true, - "generator": "typescript-axios", - "sourceSpecPathOrUrl": "packages/api-spec/src/crate-spec.openapi.yml", - "additionalProperties": "", - "globalProperties": "" - } - } - }, - "implicitDependencies": ["@crate/api-spec"], - "tags": [] -} diff --git a/packages/api-lib/src/.gitignore b/packages/api-lib/src/.gitignore deleted file mode 100644 index 149b576..0000000 --- a/packages/api-lib/src/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -wwwroot/*.js -node_modules -typings -dist diff --git a/packages/api-lib/src/.npmignore b/packages/api-lib/src/.npmignore deleted file mode 100644 index 999d88d..0000000 --- a/packages/api-lib/src/.npmignore +++ /dev/null @@ -1 +0,0 @@ -# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/packages/api-lib/src/.openapi-generator-ignore b/packages/api-lib/src/.openapi-generator-ignore deleted file mode 100644 index 7484ee5..0000000 --- a/packages/api-lib/src/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/packages/api-lib/src/.openapi-generator/FILES b/packages/api-lib/src/.openapi-generator/FILES deleted file mode 100644 index 16b445e..0000000 --- a/packages/api-lib/src/.openapi-generator/FILES +++ /dev/null @@ -1,9 +0,0 @@ -.gitignore -.npmignore -.openapi-generator-ignore -api.ts -base.ts -common.ts -configuration.ts -git_push.sh -index.ts diff --git a/packages/api-lib/src/.openapi-generator/VERSION b/packages/api-lib/src/.openapi-generator/VERSION deleted file mode 100644 index 89648de..0000000 --- a/packages/api-lib/src/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.0.1-SNAPSHOT \ No newline at end of file diff --git a/packages/api-lib/src/api.ts b/packages/api-lib/src/api.ts deleted file mode 100644 index a3e5ba2..0000000 --- a/packages/api-lib/src/api.ts +++ /dev/null @@ -1,926 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Crate Network API - * ## About this spec The Crate API exposes several endpoints which allows the Crate macOS, iOS, iPadOS and web clients to interact with Crate\'s IPFS cluster without the clients needing to run IPFS clients of their own. Crate Network implements the IPFS Pinning API specification at the `/pins` endpoint, as described by the spec found [on GitHub](https://github.com/ipfs/pinning-services-api-spec/blob/3196b0b466752a3626b716969703cbd48cb9bcf7/ipfs-pinning-service.yaml). The pinning API accepts a Bearer authorization token retrieved from your Crate account. This identifies your user and adds the pinned content to your files on Crate. This version of the API is modified to include metadata, all of which is optional so that Crate continues to conform to the IPFS spec. The Filecoin replication service is handled via the pinning API. Instead of using untrusted centralized cloud storage as the backend, Crate safely replicates content onto other decentralized networks. When a request comes to the pinning service to retrieve the content, Crate will prioritize cached content, otherwise falling back to the Filecoin network to retrieve your files. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import { Configuration } from './configuration'; -import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; -// Some imports not used depending on template conditions -// @ts-ignore -import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; - -/** - * Response for a failed request - * @export - * @interface Failure - */ -export interface Failure { - /** - * - * @type {FailureError} - * @memberof Failure - */ - 'error': FailureError; -} -/** - * - * @export - * @interface FailureError - */ -export interface FailureError { - /** - * Mandatory string identifying the type of error - * @type {string} - * @memberof FailureError - */ - 'reason': string; - /** - * Optional, longer description of the error; may include UUID of transaction for support, links to documentation etc - * @type {string} - * @memberof FailureError - */ - 'details'?: string; -} -/** - * A file object as represented on @crate/web - * @export - * @interface FileModel - */ -export interface FileModel { - /** - * Content Identifier (CID) - * @type {string} - * @memberof FileModel - */ - 'cid': string; - /** - * File/folder name - * @type {string} - * @memberof FileModel - */ - 'name'?: string; - /** - * Whether this is a file or directory - * @type {string} - * @memberof FileModel - */ - 'type': FileModelTypeEnum; - /** - * Encryption key for the file in string format, parsed from binary representation in UTF-8. This key has been encrypted by the user\'s data key. If this exists, it means the file is for private consumption. - * @type {string} - * @memberof FileModel - */ - 'signedEncryptionKey'?: string; - /** - * The size of the file. - * @type {number} - * @memberof FileModel - */ - 'size': number; - /** - * The date that this file was last modified in ISO-8601. - * @type {string} - * @memberof FileModel - */ - 'date': string; - /** - * The CIDs linked to from this directory. - * @type {Array} - * @memberof FileModel - */ - 'links'?: Array; - /** - * The size of the directory and all contained files. - * @type {number} - * @memberof FileModel - */ - 'cumulativeSize'?: number; -} - -export const FileModelTypeEnum = { - Directory: 'directory', - File: 'file' -} as const; - -export type FileModelTypeEnum = typeof FileModelTypeEnum[keyof typeof FileModelTypeEnum]; - -/** - * Structure for linked items in a directory. Name can vary from directory to directory. - * @export - * @interface FileModelLinksInner - */ -export interface FileModelLinksInner { - /** - * Content Identifier (CID) - * @type {string} - * @memberof FileModelLinksInner - */ - 'cid': string; - /** - * Name of linked file. - * @type {string} - * @memberof FileModelLinksInner - */ - 'name': string; - /** - * Size of linked file. - * @type {number} - * @memberof FileModelLinksInner - */ - 'size': number; -} -/** - * Pin object - * @export - * @interface Pin - */ -export interface Pin { - /** - * Content Identifier (CID) - * @type {string} - * @memberof Pin - */ - 'cid': string; - /** - * Optional name for pinned data; can be used for lookups later - * @type {string} - * @memberof Pin - */ - 'name'?: string; - /** - * Optional list of multiaddrs known to provide the data; see Provider Hints in the docs - * @type {Set} - * @memberof Pin - */ - 'origins'?: Set; - /** - * Optional metadata for pin object - * @type {{ [key: string]: string; }} - * @memberof Pin - */ - 'meta'?: { [key: string]: string; }; -} -/** - * Response used for listing pin objects matching request - * @export - * @interface PinResults - */ -export interface PinResults { - /** - * The total number of pin objects that exist for passed query filters - * @type {number} - * @memberof PinResults - */ - 'count': number; - /** - * An array of PinStatus results - * @type {Set} - * @memberof PinResults - */ - 'results': Set; -} -/** - * Pin object with status - * @export - * @interface PinStatus - */ -export interface PinStatus { - /** - * Globally unique identifier of the pin request; can be used to check the status of ongoing pinning, or pin removal - * @type {string} - * @memberof PinStatus - */ - 'requestid': string; - /** - * - * @type {Status} - * @memberof PinStatus - */ - 'status': Status; - /** - * Immutable timestamp indicating when a pin request entered a pinning service; can be used for filtering results and pagination - * @type {string} - * @memberof PinStatus - */ - 'created': string; - /** - * - * @type {Pin} - * @memberof PinStatus - */ - 'pin': Pin; - /** - * List of multiaddrs designated by pinning service that will receive the pin data; see Provider Hints in the docs - * @type {Set} - * @memberof PinStatus - */ - 'delegates': Set; - /** - * Optional info for PinStatus response - * @type {{ [key: string]: string; }} - * @memberof PinStatus - */ - 'info'?: { [key: string]: string; }; -} -/** - * Status a pin object can have at a pinning service - * @export - * @enum {string} - */ - -export const Status = { - Queued: 'queued', - Pinning: 'pinning', - Pinned: 'pinned', - Failed: 'failed' -} as const; - -export type Status = typeof Status[keyof typeof Status]; - - -/** - * Alternative text matching strategy - * @export - * @enum {string} - */ - -export const TextMatchingStrategy = { - Exact: 'exact', - Iexact: 'iexact', - Partial: 'partial', - Ipartial: 'ipartial' -} as const; - -export type TextMatchingStrategy = typeof TextMatchingStrategy[keyof typeof TextMatchingStrategy]; - - - -/** - * FilesApi - axios parameter creator - * @export - */ -export const FilesApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Get FileModel object a file/directory specified by either a CID or the path from the root of the user\'s filesystem. If neither are specified, we return the FileModel for the root directory. - * @summary Fetches FileModel for a path relative to the user root. - * @param {string} [path] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - fileGet: async (path?: string, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/file`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication accessToken required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if (path !== undefined) { - localVarQueryParameter['path'] = path; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Upload one or many files/directories to a path specified in the query parameters. If ignored, this will save the files to the root directory. - * @param {string} [path] - * @param {Array} [files] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - filePost: async (path?: string, files?: Array, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/file`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); - - // authentication accessToken required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if (path !== undefined) { - localVarQueryParameter['path'] = path; - } - - if (files) { - files.forEach((element) => { - localVarFormParams.append('files', element as any); - }) - } - - - - localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = localVarFormParams; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * FilesApi - functional programming interface - * @export - */ -export const FilesApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = FilesApiAxiosParamCreator(configuration) - return { - /** - * Get FileModel object a file/directory specified by either a CID or the path from the root of the user\'s filesystem. If neither are specified, we return the FileModel for the root directory. - * @summary Fetches FileModel for a path relative to the user root. - * @param {string} [path] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async fileGet(path?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.fileGet(path, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Upload one or many files/directories to a path specified in the query parameters. If ignored, this will save the files to the root directory. - * @param {string} [path] - * @param {Array} [files] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async filePost(path?: string, files?: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.filePost(path, files, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - } -}; - -/** - * FilesApi - factory interface - * @export - */ -export const FilesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = FilesApiFp(configuration) - return { - /** - * Get FileModel object a file/directory specified by either a CID or the path from the root of the user\'s filesystem. If neither are specified, we return the FileModel for the root directory. - * @summary Fetches FileModel for a path relative to the user root. - * @param {string} [path] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - fileGet(path?: string, options?: any): AxiosPromise { - return localVarFp.fileGet(path, options).then((request) => request(axios, basePath)); - }, - /** - * Upload one or many files/directories to a path specified in the query parameters. If ignored, this will save the files to the root directory. - * @param {string} [path] - * @param {Array} [files] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - filePost(path?: string, files?: Array, options?: any): AxiosPromise> { - return localVarFp.filePost(path, files, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * FilesApi - object-oriented interface - * @export - * @class FilesApi - * @extends {BaseAPI} - */ -export class FilesApi extends BaseAPI { - /** - * Get FileModel object a file/directory specified by either a CID or the path from the root of the user\'s filesystem. If neither are specified, we return the FileModel for the root directory. - * @summary Fetches FileModel for a path relative to the user root. - * @param {string} [path] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof FilesApi - */ - public fileGet(path?: string, options?: AxiosRequestConfig) { - return FilesApiFp(this.configuration).fileGet(path, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Upload one or many files/directories to a path specified in the query parameters. If ignored, this will save the files to the root directory. - * @param {string} [path] - * @param {Array} [files] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof FilesApi - */ - public filePost(path?: string, files?: Array, options?: AxiosRequestConfig) { - return FilesApiFp(this.configuration).filePost(path, files, options).then((request) => request(this.axios, this.basePath)); - } -} - - -/** - * PinsApi - axios parameter creator - * @export - */ -export const PinsApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * List all the pin objects, matching optional filters; when no filter is provided, only successful pins are returned. - * @summary List pin objects - * @param {Set} [cid] Return pin objects responsible for pinning the specified CID(s); be aware that using longer hash functions introduces further constraints on the number of CIDs that will fit under the limit of 2000 characters per URL in browser contexts - * @param {string} [name] Return pin objects with specified name (by default a case-sensitive, exact match) - * @param {TextMatchingStrategy} [match] Customize the text matching strategy applied when the name filter is present; exact (the default) is a case-sensitive exact match, partial matches anywhere in the name, iexact and ipartial are case-insensitive versions of the exact and partial strategies - * @param {Set} [status] Return pin objects for pins with the specified status - * @param {string} [before] Return results created (queued) before provided timestamp - * @param {string} [after] Return results created (queued) after provided timestamp - * @param {number} [limit] Max records to return - * @param {any} [meta] Return pin objects that match specified metadata keys passed as a string representation of a JSON object; when implementing a client library, make sure the parameter is URL-encoded to ensure safe transport - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - pinsGet: async (cid?: Set, name?: string, match?: TextMatchingStrategy, status?: Set, before?: string, after?: string, limit?: number, meta?: any, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/pins`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication accessToken required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if (cid) { - localVarQueryParameter['cid'] = Array.from(cid).join(COLLECTION_FORMATS.csv); - } - - if (name !== undefined) { - localVarQueryParameter['name'] = name; - } - - if (match !== undefined) { - localVarQueryParameter['match'] = match; - } - - if (status) { - localVarQueryParameter['status'] = Array.from(status).join(COLLECTION_FORMATS.csv); - } - - if (before !== undefined) { - localVarQueryParameter['before'] = (before as any instanceof Date) ? - (before as any).toISOString() : - before; - } - - if (after !== undefined) { - localVarQueryParameter['after'] = (after as any instanceof Date) ? - (after as any).toISOString() : - after; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (meta !== undefined) { - localVarQueryParameter['meta'] = meta; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Add a new pin object for the current access token - * @summary Add pin object - * @param {Pin} pin - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - pinsPost: async (pin: Pin, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'pin' is not null or undefined - assertParamExists('pinsPost', 'pin', pin) - const localVarPath = `/pins`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication accessToken required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(pin, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Remove a pin object - * @summary Remove pin object - * @param {string} requestid - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - pinsRequestidDelete: async (requestid: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'requestid' is not null or undefined - assertParamExists('pinsRequestidDelete', 'requestid', requestid) - const localVarPath = `/pins/{requestid}` - .replace(`{${"requestid"}}`, encodeURIComponent(String(requestid))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication accessToken required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Get a pin object and its status - * @summary Get pin object - * @param {string} requestid - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - pinsRequestidGet: async (requestid: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'requestid' is not null or undefined - assertParamExists('pinsRequestidGet', 'requestid', requestid) - const localVarPath = `/pins/{requestid}` - .replace(`{${"requestid"}}`, encodeURIComponent(String(requestid))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication accessToken required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Replace an existing pin object (shortcut for executing remove and add operations in one step to avoid unnecessary garbage collection of blocks present in both recursive pins) - * @summary Replace pin object - * @param {string} requestid - * @param {Pin} pin - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - pinsRequestidPost: async (requestid: string, pin: Pin, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'requestid' is not null or undefined - assertParamExists('pinsRequestidPost', 'requestid', requestid) - // verify required parameter 'pin' is not null or undefined - assertParamExists('pinsRequestidPost', 'pin', pin) - const localVarPath = `/pins/{requestid}` - .replace(`{${"requestid"}}`, encodeURIComponent(String(requestid))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication accessToken required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(pin, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * PinsApi - functional programming interface - * @export - */ -export const PinsApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = PinsApiAxiosParamCreator(configuration) - return { - /** - * List all the pin objects, matching optional filters; when no filter is provided, only successful pins are returned. - * @summary List pin objects - * @param {Set} [cid] Return pin objects responsible for pinning the specified CID(s); be aware that using longer hash functions introduces further constraints on the number of CIDs that will fit under the limit of 2000 characters per URL in browser contexts - * @param {string} [name] Return pin objects with specified name (by default a case-sensitive, exact match) - * @param {TextMatchingStrategy} [match] Customize the text matching strategy applied when the name filter is present; exact (the default) is a case-sensitive exact match, partial matches anywhere in the name, iexact and ipartial are case-insensitive versions of the exact and partial strategies - * @param {Set} [status] Return pin objects for pins with the specified status - * @param {string} [before] Return results created (queued) before provided timestamp - * @param {string} [after] Return results created (queued) after provided timestamp - * @param {number} [limit] Max records to return - * @param {any} [meta] Return pin objects that match specified metadata keys passed as a string representation of a JSON object; when implementing a client library, make sure the parameter is URL-encoded to ensure safe transport - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pinsGet(cid?: Set, name?: string, match?: TextMatchingStrategy, status?: Set, before?: string, after?: string, limit?: number, meta?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pinsGet(cid, name, match, status, before, after, limit, meta, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Add a new pin object for the current access token - * @summary Add pin object - * @param {Pin} pin - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pinsPost(pin: Pin, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pinsPost(pin, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Remove a pin object - * @summary Remove pin object - * @param {string} requestid - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pinsRequestidDelete(requestid: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pinsRequestidDelete(requestid, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Get a pin object and its status - * @summary Get pin object - * @param {string} requestid - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pinsRequestidGet(requestid: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pinsRequestidGet(requestid, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * Replace an existing pin object (shortcut for executing remove and add operations in one step to avoid unnecessary garbage collection of blocks present in both recursive pins) - * @summary Replace pin object - * @param {string} requestid - * @param {Pin} pin - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async pinsRequestidPost(requestid: string, pin: Pin, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.pinsRequestidPost(requestid, pin, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - } -}; - -/** - * PinsApi - factory interface - * @export - */ -export const PinsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = PinsApiFp(configuration) - return { - /** - * List all the pin objects, matching optional filters; when no filter is provided, only successful pins are returned. - * @summary List pin objects - * @param {Set} [cid] Return pin objects responsible for pinning the specified CID(s); be aware that using longer hash functions introduces further constraints on the number of CIDs that will fit under the limit of 2000 characters per URL in browser contexts - * @param {string} [name] Return pin objects with specified name (by default a case-sensitive, exact match) - * @param {TextMatchingStrategy} [match] Customize the text matching strategy applied when the name filter is present; exact (the default) is a case-sensitive exact match, partial matches anywhere in the name, iexact and ipartial are case-insensitive versions of the exact and partial strategies - * @param {Set} [status] Return pin objects for pins with the specified status - * @param {string} [before] Return results created (queued) before provided timestamp - * @param {string} [after] Return results created (queued) after provided timestamp - * @param {number} [limit] Max records to return - * @param {any} [meta] Return pin objects that match specified metadata keys passed as a string representation of a JSON object; when implementing a client library, make sure the parameter is URL-encoded to ensure safe transport - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - pinsGet(cid?: Set, name?: string, match?: TextMatchingStrategy, status?: Set, before?: string, after?: string, limit?: number, meta?: any, options?: any): AxiosPromise { - return localVarFp.pinsGet(cid, name, match, status, before, after, limit, meta, options).then((request) => request(axios, basePath)); - }, - /** - * Add a new pin object for the current access token - * @summary Add pin object - * @param {Pin} pin - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - pinsPost(pin: Pin, options?: any): AxiosPromise { - return localVarFp.pinsPost(pin, options).then((request) => request(axios, basePath)); - }, - /** - * Remove a pin object - * @summary Remove pin object - * @param {string} requestid - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - pinsRequestidDelete(requestid: string, options?: any): AxiosPromise { - return localVarFp.pinsRequestidDelete(requestid, options).then((request) => request(axios, basePath)); - }, - /** - * Get a pin object and its status - * @summary Get pin object - * @param {string} requestid - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - pinsRequestidGet(requestid: string, options?: any): AxiosPromise { - return localVarFp.pinsRequestidGet(requestid, options).then((request) => request(axios, basePath)); - }, - /** - * Replace an existing pin object (shortcut for executing remove and add operations in one step to avoid unnecessary garbage collection of blocks present in both recursive pins) - * @summary Replace pin object - * @param {string} requestid - * @param {Pin} pin - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - pinsRequestidPost(requestid: string, pin: Pin, options?: any): AxiosPromise { - return localVarFp.pinsRequestidPost(requestid, pin, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * PinsApi - object-oriented interface - * @export - * @class PinsApi - * @extends {BaseAPI} - */ -export class PinsApi extends BaseAPI { - /** - * List all the pin objects, matching optional filters; when no filter is provided, only successful pins are returned. - * @summary List pin objects - * @param {Set} [cid] Return pin objects responsible for pinning the specified CID(s); be aware that using longer hash functions introduces further constraints on the number of CIDs that will fit under the limit of 2000 characters per URL in browser contexts - * @param {string} [name] Return pin objects with specified name (by default a case-sensitive, exact match) - * @param {TextMatchingStrategy} [match] Customize the text matching strategy applied when the name filter is present; exact (the default) is a case-sensitive exact match, partial matches anywhere in the name, iexact and ipartial are case-insensitive versions of the exact and partial strategies - * @param {Set} [status] Return pin objects for pins with the specified status - * @param {string} [before] Return results created (queued) before provided timestamp - * @param {string} [after] Return results created (queued) after provided timestamp - * @param {number} [limit] Max records to return - * @param {any} [meta] Return pin objects that match specified metadata keys passed as a string representation of a JSON object; when implementing a client library, make sure the parameter is URL-encoded to ensure safe transport - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PinsApi - */ - public pinsGet(cid?: Set, name?: string, match?: TextMatchingStrategy, status?: Set, before?: string, after?: string, limit?: number, meta?: any, options?: AxiosRequestConfig) { - return PinsApiFp(this.configuration).pinsGet(cid, name, match, status, before, after, limit, meta, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Add a new pin object for the current access token - * @summary Add pin object - * @param {Pin} pin - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PinsApi - */ - public pinsPost(pin: Pin, options?: AxiosRequestConfig) { - return PinsApiFp(this.configuration).pinsPost(pin, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Remove a pin object - * @summary Remove pin object - * @param {string} requestid - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PinsApi - */ - public pinsRequestidDelete(requestid: string, options?: AxiosRequestConfig) { - return PinsApiFp(this.configuration).pinsRequestidDelete(requestid, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Get a pin object and its status - * @summary Get pin object - * @param {string} requestid - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PinsApi - */ - public pinsRequestidGet(requestid: string, options?: AxiosRequestConfig) { - return PinsApiFp(this.configuration).pinsRequestidGet(requestid, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Replace an existing pin object (shortcut for executing remove and add operations in one step to avoid unnecessary garbage collection of blocks present in both recursive pins) - * @summary Replace pin object - * @param {string} requestid - * @param {Pin} pin - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof PinsApi - */ - public pinsRequestidPost(requestid: string, pin: Pin, options?: AxiosRequestConfig) { - return PinsApiFp(this.configuration).pinsRequestidPost(requestid, pin, options).then((request) => request(this.axios, this.basePath)); - } -} - - diff --git a/packages/api-lib/src/base.ts b/packages/api-lib/src/base.ts deleted file mode 100644 index bce7ffd..0000000 --- a/packages/api-lib/src/base.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Crate Network API - * ## About this spec The Crate API exposes several endpoints which allows the Crate macOS, iOS, iPadOS and web clients to interact with Crate\'s IPFS cluster without the clients needing to run IPFS clients of their own. Crate Network implements the IPFS Pinning API specification at the `/pins` endpoint, as described by the spec found [on GitHub](https://github.com/ipfs/pinning-services-api-spec/blob/3196b0b466752a3626b716969703cbd48cb9bcf7/ipfs-pinning-service.yaml). The pinning API accepts a Bearer authorization token retrieved from your Crate account. This identifies your user and adds the pinned content to your files on Crate. This version of the API is modified to include metadata, all of which is optional so that Crate continues to conform to the IPFS spec. The Filecoin replication service is handled via the pinning API. Instead of using untrusted centralized cloud storage as the backend, Crate safely replicates content onto other decentralized networks. When a request comes to the pinning service to retrieve the content, Crate will prioritize cached content, otherwise falling back to the Filecoin network to retrieve your files. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import { Configuration } from "./configuration"; -// Some imports not used depending on template conditions -// @ts-ignore -import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; - -export const BASE_PATH = "https://crate.network/api/v1".replace(/\/+$/, ""); - -/** - * - * @export - */ -export const COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: "\t", - pipes: "|", -}; - -/** - * - * @export - * @interface RequestArgs - */ -export interface RequestArgs { - url: string; - options: AxiosRequestConfig; -} - -/** - * - * @export - * @class BaseAPI - */ -export class BaseAPI { - protected configuration: Configuration | undefined; - - constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { - if (configuration) { - this.configuration = configuration; - this.basePath = configuration.basePath || this.basePath; - } - } -}; - -/** - * - * @export - * @class RequiredError - * @extends {Error} - */ -export class RequiredError extends Error { - name: "RequiredError" = "RequiredError"; - constructor(public field: string, msg?: string) { - super(msg); - } -} diff --git a/packages/api-lib/src/common.ts b/packages/api-lib/src/common.ts deleted file mode 100644 index af95478..0000000 --- a/packages/api-lib/src/common.ts +++ /dev/null @@ -1,138 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Crate Network API - * ## About this spec The Crate API exposes several endpoints which allows the Crate macOS, iOS, iPadOS and web clients to interact with Crate\'s IPFS cluster without the clients needing to run IPFS clients of their own. Crate Network implements the IPFS Pinning API specification at the `/pins` endpoint, as described by the spec found [on GitHub](https://github.com/ipfs/pinning-services-api-spec/blob/3196b0b466752a3626b716969703cbd48cb9bcf7/ipfs-pinning-service.yaml). The pinning API accepts a Bearer authorization token retrieved from your Crate account. This identifies your user and adds the pinned content to your files on Crate. This version of the API is modified to include metadata, all of which is optional so that Crate continues to conform to the IPFS spec. The Filecoin replication service is handled via the pinning API. Instead of using untrusted centralized cloud storage as the backend, Crate safely replicates content onto other decentralized networks. When a request comes to the pinning service to retrieve the content, Crate will prioritize cached content, otherwise falling back to the Filecoin network to retrieve your files. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -import { Configuration } from "./configuration"; -import { RequiredError, RequestArgs } from "./base"; -import { AxiosInstance, AxiosResponse } from 'axios'; - -/** - * - * @export - */ -export const DUMMY_BASE_URL = 'https://example.com' - -/** - * - * @throws {RequiredError} - * @export - */ -export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { - if (paramValue === null || paramValue === undefined) { - throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); - } -} - -/** - * - * @export - */ -export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = typeof configuration.apiKey === 'function' - ? await configuration.apiKey(keyParamName) - : await configuration.apiKey; - object[keyParamName] = localVarApiKeyValue; - } -} - -/** - * - * @export - */ -export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { - if (configuration && (configuration.username || configuration.password)) { - object["auth"] = { username: configuration.username, password: configuration.password }; - } -} - -/** - * - * @export - */ -export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - object["Authorization"] = "Bearer " + accessToken; - } -} - -/** - * - * @export - */ -export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = typeof configuration.accessToken === 'function' - ? await configuration.accessToken(name, scopes) - : await configuration.accessToken; - object["Authorization"] = "Bearer " + localVarAccessTokenValue; - } -} - -/** - * - * @export - */ -export const setSearchParams = function (url: URL, ...objects: any[]) { - const searchParams = new URLSearchParams(url.search); - for (const object of objects) { - for (const key in object) { - if (Array.isArray(object[key])) { - searchParams.delete(key); - for (const item of object[key]) { - searchParams.append(key, item); - } - } else { - searchParams.set(key, object[key]); - } - } - } - url.search = searchParams.toString(); -} - -/** - * - * @export - */ -export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { - const nonString = typeof value !== 'string'; - const needsSerialization = nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(requestOptions.headers['Content-Type']) - : nonString; - return needsSerialization - ? JSON.stringify(value !== undefined ? value : {}) - : (value || ""); -} - -/** - * - * @export - */ -export const toPathString = function (url: URL) { - return url.pathname + url.search + url.hash -} - -/** - * - * @export - */ -export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { - return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; - return axios.request(axiosRequestArgs); - }; -} diff --git a/packages/api-lib/src/configuration.ts b/packages/api-lib/src/configuration.ts deleted file mode 100644 index b6bf62c..0000000 --- a/packages/api-lib/src/configuration.ts +++ /dev/null @@ -1,101 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Crate Network API - * ## About this spec The Crate API exposes several endpoints which allows the Crate macOS, iOS, iPadOS and web clients to interact with Crate\'s IPFS cluster without the clients needing to run IPFS clients of their own. Crate Network implements the IPFS Pinning API specification at the `/pins` endpoint, as described by the spec found [on GitHub](https://github.com/ipfs/pinning-services-api-spec/blob/3196b0b466752a3626b716969703cbd48cb9bcf7/ipfs-pinning-service.yaml). The pinning API accepts a Bearer authorization token retrieved from your Crate account. This identifies your user and adds the pinned content to your files on Crate. This version of the API is modified to include metadata, all of which is optional so that Crate continues to conform to the IPFS spec. The Filecoin replication service is handled via the pinning API. Instead of using untrusted centralized cloud storage as the backend, Crate safely replicates content onto other decentralized networks. When a request comes to the pinning service to retrieve the content, Crate will prioritize cached content, otherwise falling back to the Filecoin network to retrieve your files. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export interface ConfigurationParameters { - apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); - username?: string; - password?: string; - accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); - basePath?: string; - baseOptions?: any; - formDataCtor?: new () => any; -} - -export class Configuration { - /** - * parameter for apiKey security - * @param name security name - * @memberof Configuration - */ - apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - username?: string; - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - password?: string; - /** - * parameter for oauth2 security - * @param name security name - * @param scopes oauth2 scope - * @memberof Configuration - */ - accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); - /** - * override base path - * - * @type {string} - * @memberof Configuration - */ - basePath?: string; - /** - * base options for axios calls - * - * @type {any} - * @memberof Configuration - */ - baseOptions?: any; - /** - * The FormData constructor that will be used to create multipart form data - * requests. You can inject this here so that execution environments that - * do not support the FormData class can still run the generated client. - * - * @type {new () => FormData} - */ - formDataCtor?: new () => any; - - constructor(param: ConfigurationParameters = {}) { - this.apiKey = param.apiKey; - this.username = param.username; - this.password = param.password; - this.accessToken = param.accessToken; - this.basePath = param.basePath; - this.baseOptions = param.baseOptions; - this.formDataCtor = param.formDataCtor; - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } -} diff --git a/packages/api-lib/src/git_push.sh b/packages/api-lib/src/git_push.sh deleted file mode 100644 index f53a75d..0000000 --- a/packages/api-lib/src/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/packages/api-lib/src/index.ts b/packages/api-lib/src/index.ts deleted file mode 100644 index 5f17f11..0000000 --- a/packages/api-lib/src/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Crate Network API - * ## About this spec The Crate API exposes several endpoints which allows the Crate macOS, iOS, iPadOS and web clients to interact with Crate\'s IPFS cluster without the clients needing to run IPFS clients of their own. Crate Network implements the IPFS Pinning API specification at the `/pins` endpoint, as described by the spec found [on GitHub](https://github.com/ipfs/pinning-services-api-spec/blob/3196b0b466752a3626b716969703cbd48cb9bcf7/ipfs-pinning-service.yaml). The pinning API accepts a Bearer authorization token retrieved from your Crate account. This identifies your user and adds the pinned content to your files on Crate. This version of the API is modified to include metadata, all of which is optional so that Crate continues to conform to the IPFS spec. The Filecoin replication service is handled via the pinning API. Instead of using untrusted centralized cloud storage as the backend, Crate safely replicates content onto other decentralized networks. When a request comes to the pinning service to retrieve the content, Crate will prioritize cached content, otherwise falling back to the Filecoin network to retrieve your files. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export * from "./api"; -export * from "./configuration"; - diff --git a/packages/api-lib/tsconfig.json b/packages/api-lib/tsconfig.json deleted file mode 100644 index 4d9143f..0000000 --- a/packages/api-lib/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "rootDir": "./src", - "outDir": "./dist", - "lib": ["es2018", "dom"], - }, - "exclude": [ - "node_modules", - "*/**/*.d.ts", - "*/**/*.test.ts", - "*/**/*.spec.ts" - ] -} \ No newline at end of file diff --git a/packages/common/package.json b/packages/common/package.json deleted file mode 100644 index 23b325c..0000000 --- a/packages/common/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@crate/common", - "version": "0.3.0", - "author": "Christian van der Loo", - "private": true, - "description": "Shared types and models between Crate applications.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "scripts": { - "build": "tsc", - "dev": "tsc --watch", - "test": "jest", - "lint": "eslint . --max-warnings=0" - }, - "license": "MIT", - "dependencies": { - "@crate/api-lib": "*", - "@ipld/dag-pb": "^2.1.17", - "@types/node": "^18.0.0", - "ipfs-http-client": "^57.0.3", - "ipfs-unixfs": "^6.0.9", - "multiformats": "^9.7.0", - "typescript": "^4.7.3" - }, - "devDependencies": { - "@types/jest": "^28.1.2", - "@typescript-eslint/eslint-plugin": "^5.30.5", - "@typescript-eslint/parser": "^5.30.5", - "eslint": "^8.19.0", - "jest": "^28.1.1" - } -} diff --git a/packages/common/project.json b/packages/common/project.json deleted file mode 100644 index ad99042..0000000 --- a/packages/common/project.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "@crate/common", - "sourceRoot": "packages/common/", - "projectType": "library", - "targets": { - "version": { - "executor": "@jscutlery/semver:version", - "options": { - "preset": "conventional" - } - } - } -} diff --git a/packages/common/src/model/UserModel.ts b/packages/common/src/model/UserModel.ts deleted file mode 100644 index daa3253..0000000 --- a/packages/common/src/model/UserModel.ts +++ /dev/null @@ -1,27 +0,0 @@ -type UserInfo = { - firstName: string - lastName: string - organization: string - uses2FA: boolean -} - -type UserSecurity = { - uses2FA: boolean - // unencrypted data key, stored securely in Firestore - // however, still accessible by Crate - // mapping of device UUID to the device's public key - devices: Record - // mapping of device UUID to the user's data key, signed by each device - signedDataKey: Record - // the user's data key, signed by the recovery passcode - recoveryKey: string | null - // unencrypted data key - dataKey: string | null -} - -type UserFiles = { - // CID of the user's current file root - rootCID: string | null -} - -export type UserModel = UserInfo & UserSecurity & UserFiles diff --git a/packages/common/src/model/index.ts b/packages/common/src/model/index.ts deleted file mode 100644 index 5c49160..0000000 --- a/packages/common/src/model/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./UserModel" diff --git a/packages/common/tsconfig.json b/packages/common/tsconfig.json deleted file mode 100644 index d54977b..0000000 --- a/packages/common/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "rootDir": "./src", - "outDir": "./dist" - }, - "exclude": [ - "node_modules", - "dist", - "*/**/*.test.ts", - "*/**/*.spec.ts" - ] -} \ No newline at end of file diff --git a/packages/ipfs-node/package.json b/packages/ipfs-node/package.json deleted file mode 100644 index f328f55..0000000 --- a/packages/ipfs-node/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@crate/ipfs", - "author": "Christian van der Loo", - "version": "0.0.2", - "scripts": { - "dev": "docker compose up --build -d" - } -} diff --git a/packages/server/esbuild.js b/packages/server/esbuild.js deleted file mode 100644 index 6b9814d..0000000 --- a/packages/server/esbuild.js +++ /dev/null @@ -1,7 +0,0 @@ -import { build } from "esbuild"; - -build({ - outfile: "dist/index.js", - bundle: true, - platform: "node", -}); diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts deleted file mode 100644 index 0b0c7e0..0000000 --- a/packages/server/src/app.ts +++ /dev/null @@ -1,61 +0,0 @@ -import express from "express"; -import { auth } from "./firebase"; -import files from "./routes/files-route"; -import fileUpload from "express-fileupload"; -import pinning from "./routes/pinning-route"; -import logger from "./logger"; -import morgan from "morgan"; - -// const args = process.argv.slice(2); -const app = express(); - -const API_VERSION = "v1"; -const API_ROUTE = `/api/${API_VERSION}`; - -app.use(morgan("tiny")); -app.use(async (req, res, next) => { - const authHeader = req.headers.authorization; - - if (!authHeader) { - res.sendStatus(403); - return; - } - - const [type, token] = authHeader.split(" "); - - if (!token || type !== "Bearer") { - res.status(403).send("Invalid request."); - return; - } - - // if (process.env.NODE_ENV === "production") { - auth - .verifyIdToken(token) - .then((decodedToken) => { - req.token = decodedToken; - next(); - }) - .catch((err) => { - res.status(403).send("Token unauthorized."); - logger.error(err); - }); - // } else { - // req.token = { uid: "devAccount" } as DecodedIdToken; - // next(); - // } -}); - -app.use( - fileUpload({ - useTempFiles: true, - tempFileDir: "/tmp/", - }) -); - -app.use(`${API_ROUTE}/file`, files); -app.use(`${API_ROUTE}/pins`, pinning); - -const port = process.env.PORT || 3030; -app.listen(port, () => { - logger.info(`Listening on port ${port}`); -}); diff --git a/packages/server/src/clients/ipfs.ts b/packages/server/src/clients/ipfs.ts deleted file mode 100644 index 46fa095..0000000 --- a/packages/server/src/clients/ipfs.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { create } from "ipfs-http-client"; - -const clientURL = process.env.IPFS_CLIENT_URL || "http://127.0.0.1:5001/api/v0"; -const client = create({ url: clientURL }); - -export default client; diff --git a/packages/server/src/firebase.ts b/packages/server/src/firebase.ts deleted file mode 100644 index 207d509..0000000 --- a/packages/server/src/firebase.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { applicationDefault, initializeApp } from "firebase-admin/app"; -import { getFirestore } from "firebase-admin/firestore"; -import { getAuth } from "firebase-admin/auth"; - -const firebaseApp = initializeApp({ - credential: applicationDefault(), -}); -const firestore = getFirestore(firebaseApp); -const auth = getAuth(); - -export { firebaseApp, firestore, auth }; diff --git a/packages/server/src/init.ts b/packages/server/src/init.ts deleted file mode 100644 index ec6f939..0000000 --- a/packages/server/src/init.ts +++ /dev/null @@ -1,7 +0,0 @@ -import dotenv from "dotenv"; - -if (process.env.NODE_ENV !== "production") { - dotenv.config(); -} - -require("./app"); diff --git a/packages/server/src/routes/files-route.ts b/packages/server/src/routes/files-route.ts deleted file mode 100644 index 2e0f436..0000000 --- a/packages/server/src/routes/files-route.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { RequestHandler, Router } from "express"; -import fs from "fs"; -import ipfs from "../clients/ipfs"; -import logger from "../logger"; -import { firestore } from "../firebase"; -import { FileModel } from "@crate/api-lib"; -import { Node, parsePath } from "@crate/common"; - -const router = Router(); - -const asyncHandler = (fn: RequestHandler) => (req, res, next) => { - return Promise.resolve(fn(req, res, next)).catch(next); -}; - -const getRootCID = async (uid: string) => - (await firestore.collection("users").doc(uid).get()).get("rootCID"); - -// const setRootCID = async (uid: string, newCID: string) => -// await firestore.collection("users").doc(uid).set({ rootCID: newCID }); - -// const makeError = (type: string, msg: string) => ({ -// reason: type, -// message: msg, -// }); - -router.get( - "/", - asyncHandler(async (req, res) => { - const { path, cid } = { - path: "/", - cid: null, - ...req.query, - }; - logger.info(path); - logger.info(cid); - const block = await ipfs.block.get(await getRootCID(req.token.uid)); - res.send(await Node.toFile(Node.fromRawBlock(block))); - }) -); - -router.post( - "/", - asyncHandler(async (req, res) => { - const { path } = { - path: "/", - ...req.query, - }; - }) -); - -router.put( - "/", - asyncHandler(async (req, res) => { - const { path } = { - path: "/", - ...req.query, - }; - const pArr = splitPath(path); - logger.info(pArr); - - if (!req.files.files || Object.keys(req.files).length === 0) { - return res.status(400).send({ - error: { reason: "BAD_REQUEST", details: "No files were uploaded." }, - }); - } - - // parse files, forward to IPFS to get the CID - const { files: origFiles } = req.files; - const files = Array.isArray(origFiles) ? origFiles : [origFiles]; - const models = await Promise.all( - files.map(async (file): Promise => { - const res = await ipfs.add(fs.createReadStream(file.tempFilePath)); - await ipfs.pin.add(res.cid); - console.log(res.cid.toString()); - // const pin = await ipfs.pin.remote.add(res.cid, { - // name: file.name, - // service: "crate", - // }); - return { - cid: res.cid.toString(), - name: file.name, - type: "file", - size: file.size, - date: new Date().toISOString(), - }; - }) - ).catch((e) => { - logger.info(e.message); - res.status(500).send(e); - }); - - logger.info(JSON.stringify(models)); - - res.send(models); - }) -); - -export default router; diff --git a/packages/server/src/routes/pinning-route.ts b/packages/server/src/routes/pinning-route.ts deleted file mode 100644 index f70766f..0000000 --- a/packages/server/src/routes/pinning-route.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Router } from "express"; -import { uuid } from "uuidv4"; - -const router = Router(); - -router.get("/", (req, res) => { - const fcRes = "List of pin objects."; - res.send(fcRes); -}); - -router.post("/", (req, res) => { - res.send({ - requestid: uuid(), - status: "queued", - created: new Date().toISOString(), - pin: {}, - }); -}); - -router.get(/\/(.+)$/, (req, res) => { - const reqId = req.params[0]; - const fcRes = `Get pin object with ID ${reqId}.`; - res.send(fcRes); -}); - -router.post(/\/(.+)$/, (req, res) => { - const reqId = req.params[0]; - const fcRes = `Replace pin object with ID ${reqId}.`; - res.send(fcRes); -}); - -router.delete(/\/(.+)$/, (req, res) => { - const reqId = req.params[0]; - const fcRes = `Remove pin object with ID ${reqId}.`; - res.send(fcRes); -}); - -export default router; diff --git a/packages/server/src/types/express/index.d.ts b/packages/server/src/types/express/index.d.ts deleted file mode 100644 index e4a6db6..0000000 --- a/packages/server/src/types/express/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import express from "express"; -import { DecodedIdToken } from "firebase-admin/auth"; - -declare global { - namespace Express { - interface Request { - token?: DecodedIdToken; - } - } -} diff --git a/packages/server/tsconfig.json b/packages/server/tsconfig.json deleted file mode 100644 index fb9a062..0000000 --- a/packages/server/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "baseUrl": "./", - "rootDir": "src", - "outDir": "dist", - "module": "esnext", - "esModuleInterop": true - } -} \ No newline at end of file diff --git a/packages/web/.prettierrc b/packages/web/.prettierrc deleted file mode 100644 index 6fbb592..0000000 --- a/packages/web/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tabWidth": 2, - "semi": false, - "singleQuote": false -} diff --git a/packages/web/postcss.config.js b/packages/web/postcss.config.js deleted file mode 100644 index 33ad091..0000000 --- a/packages/web/postcss.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -} diff --git a/packages/web/project.json b/packages/web/project.json deleted file mode 100644 index b846ecc..0000000 --- a/packages/web/project.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "name": "@crate/web", - "sourceRoot": "./packages/web/", - "projectType": "application", - "targets": { - "docker": { - "executor": "@nx-tools/nx-docker:build", - "options": { - "push": true, - "platforms": ["linux/amd64", "linux/arm64"], - "metadata": { - "images": ["ghcr.io/crate-network/web"], - "context": "./packages/web", - "tags": [ - "latest", - "type=schedule", - "type=ref,event=branch", - "type=ref,event=tag", - "type=ref,event=pr", - "type=semver,pattern={{version}}", - "type=semver,pattern={{major}}.{{minor}}", - "type=semver,pattern={{major}}", - "type=sha" - ] - } - } - }, - "version": { - "executor": "@jscutlery/semver:version", - "options": { - "preset": "conventional" - } - } - } -} diff --git a/tsconfig.base.json b/tsconfig.base.json index d206a2f..28280f3 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "baseUrl": "./", "target": "ESNext", "sourceMap": true, "importHelpers": true, @@ -14,8 +15,8 @@ "declaration": true, "resolveJsonModule": true, "paths": { - "@/api-docs": ["packages/api-docs/src/index.ts"], - "@/api-lib": ["packages/api-lib/src/index.ts"] + "@crate/common": ["libs/shared/common/src/index.ts"], + "@crate/types": ["libs/shared/types/src/index.ts"] } }, "exclude": ["node_modules", "*/**/*.test.ts", "*/**/*.spec.ts"] diff --git a/yarn.lock b/yarn.lock index 4cdce33..e9453f1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -44,6 +44,13 @@ resolved "https://registry.yarnpkg.com/@assemblyscript/loader/-/loader-0.9.4.tgz#a483c54c1253656bb33babd464e3154a173e1577" integrity sha512-HazVq9zwTVwGmqdwYzu7WyQ6FQVZ7SwET0KKQuKm55jD0IfUpZgN0OPIiZG3zV1iSrVYcN0bdwLRXI/VNCYsUA== +"@babel/code-frame@7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" + integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== + dependencies: + "@babel/highlight" "^7.10.4" + "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.8.3": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" @@ -423,6 +430,15 @@ "@babel/traverse" "^7.18.6" "@babel/types" "^7.18.6" +"@babel/highlight@^7.10.4", "@babel/highlight@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" + integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== + dependencies: + "@babel/helper-validator-identifier" "^7.18.6" + chalk "^2.0.0" + js-tokens "^4.0.0" + "@babel/highlight@^7.16.7": version "7.17.12" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.17.12.tgz#257de56ee5afbd20451ac0a75686b6b404257351" @@ -432,15 +448,6 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/highlight@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" - integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== - dependencies: - "@babel/helper-validator-identifier" "^7.18.6" - chalk "^2.0.0" - js-tokens "^4.0.0" - "@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.18.5": version "7.18.5" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.5.tgz#337062363436a893a2d22faa60be5bb37091c83c" @@ -1490,6 +1497,21 @@ enabled "2.0.x" kuler "^2.0.0" +"@eslint/eslintrc@^0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" + integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== + dependencies: + ajv "^6.12.4" + debug "^4.1.1" + espree "^7.3.0" + globals "^13.9.0" + ignore "^4.0.6" + import-fresh "^3.2.1" + js-yaml "^3.13.1" + minimatch "^3.0.4" + strip-json-comments "^3.1.1" + "@eslint/eslintrc@^1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.0.tgz#29f92c30bb3e771e4a2048c95fa6855392dfac4f" @@ -2002,6 +2024,15 @@ protobufjs "^6.11.3" yargs "^16.2.0" +"@humanwhocodes/config-array@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" + integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== + dependencies: + "@humanwhocodes/object-schema" "^1.2.0" + debug "^4.1.1" + minimatch "^3.0.4" + "@humanwhocodes/config-array@^0.9.2": version "0.9.5" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7" @@ -2011,7 +2042,7 @@ debug "^4.1.1" minimatch "^3.0.4" -"@humanwhocodes/object-schema@^1.2.1": +"@humanwhocodes/object-schema@^1.2.0", "@humanwhocodes/object-schema@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== @@ -2155,6 +2186,16 @@ "@types/node" "*" jest-mock "^28.1.1" +"@jest/environment@^28.1.2": + version "28.1.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.2.tgz#94a052c0c5f9f8c8e6d13ea6da78dbc5d7d9b85b" + integrity sha512-I0CR1RUMmOzd0tRpz10oUfaChBWs+/Hrvn5xYhMEF/ZqrDaaeHwS8yDBqEWCrEnkH2g+WE/6g90oBv3nKpcm8Q== + dependencies: + "@jest/fake-timers" "^28.1.2" + "@jest/types" "^28.1.1" + "@types/node" "*" + jest-mock "^28.1.1" + "@jest/expect-utils@^28.1.1": version "28.1.1" resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.1.tgz#d84c346025b9f6f3886d02c48a6177e2b0360587" @@ -2194,6 +2235,18 @@ jest-mock "^28.1.1" jest-util "^28.1.1" +"@jest/fake-timers@^28.1.2": + version "28.1.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.2.tgz#d49e8ee4e02ba85a6e844a52a5e7c59c23e3b76f" + integrity sha512-xSYEI7Y0D5FbZN2LsCUj/EKRR1zfQYmGuAUVh6xTqhx7V5JhjgMcK5Pa0iR6WIk0GXiHDe0Ke4A+yERKE9saqg== + dependencies: + "@jest/types" "^28.1.1" + "@sinonjs/fake-timers" "^9.1.2" + "@types/node" "*" + jest-message-util "^28.1.1" + jest-mock "^28.1.1" + jest-util "^28.1.1" + "@jest/globals@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.5.1.tgz#7ac06ce57ab966566c7963431cef458434601b2b" @@ -2615,6 +2668,13 @@ dependencies: nx "14.3.6" +"@nrwl/cli@14.4.2": + version "14.4.2" + resolved "https://registry.yarnpkg.com/@nrwl/cli/-/cli-14.4.2.tgz#5ec1a7a10087ef5bdd5b57bf5e3c5221fb7938e0" + integrity sha512-JNV4kP9goZD4BlTQGKdKhCRc1bhiWYp1TaDJHdk4ZfhiLt1NzXNxxgc/eX2obFZ3Hw+KdM/gM5F7KfWBbtSGSw== + dependencies: + nx "14.4.2" + "@nrwl/cypress@14.3.6": version "14.3.6" resolved "https://registry.yarnpkg.com/@nrwl/cypress/-/cypress-14.3.6.tgz#e3080f163c16fd8dec0646c1a495dd8822a3447a" @@ -2649,6 +2709,17 @@ semver "7.3.4" tslib "^2.3.0" +"@nrwl/devkit@14.4.2": + version "14.4.2" + resolved "https://registry.yarnpkg.com/@nrwl/devkit/-/devkit-14.4.2.tgz#184b627ef16a7ad71babcb74479da73a44f2f0c8" + integrity sha512-CJCczAbnZ7w6XZeOMHhb4aTQeDzU0pJOAAJvNU1EAzbj/nkP+QILn/sX+WQR6z94UT2Y9SMamnE4TjQC2F48vQ== + dependencies: + ejs "^3.1.7" + ignore "^5.0.4" + rxjs "^6.5.4" + semver "7.3.4" + tslib "^2.3.0" + "@nrwl/eslint-plugin-nx@14.3.6": version "14.3.6" resolved "https://registry.yarnpkg.com/@nrwl/eslint-plugin-nx/-/eslint-plugin-nx-14.3.6.tgz#8fbfabb76a35241a188fd5dc2dcf16b25718e6dc" @@ -2661,6 +2732,15 @@ confusing-browser-globals "^1.0.9" semver "7.3.4" +"@nrwl/express@^14.4.2": + version "14.4.2" + resolved "https://registry.yarnpkg.com/@nrwl/express/-/express-14.4.2.tgz#ad7a3ec52dd5e899ba6ee18d973551f8d20d826a" + integrity sha512-dhbjvvG8639/VchX/f1LYIU+Up8rkn05xsPZP4vbaPVa54hfndvBzdqOTeTJbKaNKI7CqFsiOUwx+mLU9vSrjg== + dependencies: + "@nrwl/devkit" "14.4.2" + "@nrwl/node" "14.4.2" + "@nrwl/workspace" "14.4.2" + "@nrwl/jest@14.3.6": version "14.3.6" resolved "https://registry.yarnpkg.com/@nrwl/jest/-/jest-14.3.6.tgz#84ab5887a46e4bcf3819f44942c9a83e9244b7b6" @@ -2679,6 +2759,24 @@ rxjs "^6.5.4" tslib "^2.3.0" +"@nrwl/jest@14.4.2": + version "14.4.2" + resolved "https://registry.yarnpkg.com/@nrwl/jest/-/jest-14.4.2.tgz#ff9ab643ec53fd80abf57746a33a782d1e0e6e5f" + integrity sha512-5BIbkChVRmJQ0ngNBdL1Fy3oSLm20zR1ec9XgBAktPDQ4ZMPz3ZWk9c5kKX2H2tOvyu98hbOqZ0HLbPXAbt/Ew== + dependencies: + "@jest/reporters" "27.5.1" + "@jest/test-result" "27.5.1" + "@nrwl/devkit" "14.4.2" + "@phenomnomnominal/tsquery" "4.1.1" + chalk "4.1.0" + identity-obj-proxy "3.0.0" + jest-config "27.5.1" + jest-resolve "27.5.1" + jest-util "27.5.1" + resolve.exports "1.1.0" + rxjs "^6.5.4" + tslib "^2.3.0" + "@nrwl/js@14.3.6", "@nrwl/js@^14.3.5": version "14.3.6" resolved "https://registry.yarnpkg.com/@nrwl/js/-/js-14.3.6.tgz#938802e7b960ca9f7b3af24184e171ed9446e05e" @@ -2698,6 +2796,25 @@ source-map-support "0.5.19" tree-kill "1.2.2" +"@nrwl/js@14.4.2": + version "14.4.2" + resolved "https://registry.yarnpkg.com/@nrwl/js/-/js-14.4.2.tgz#a5fea9b31bbfba13a82c0afd098f631864135a99" + integrity sha512-kVi+DAm1iaEZ8XQ8+dViDlK9/2ZM4Eq0fhWXtWisvuVmgoTdWQ88DDzXyINbzv4cWtpMnKHeIWJeM/WMWAX36w== + dependencies: + "@nrwl/devkit" "14.4.2" + "@nrwl/jest" "14.4.2" + "@nrwl/linter" "14.4.2" + "@nrwl/workspace" "14.4.2" + "@parcel/watcher" "2.0.4" + chalk "4.1.0" + fast-glob "3.2.7" + fs-extra "^10.1.0" + ignore "^5.0.4" + js-tokens "^4.0.0" + minimatch "3.0.5" + source-map-support "0.5.19" + tree-kill "1.2.2" + "@nrwl/linter@14.3.6", "@nrwl/linter@^14.3.6": version "14.3.6" resolved "https://registry.yarnpkg.com/@nrwl/linter/-/linter-14.3.6.tgz#2ae0e2d3d227eeca9e53e6cd73a75f97f723c1e4" @@ -2710,6 +2827,18 @@ tmp "~0.2.1" tslib "^2.3.0" +"@nrwl/linter@14.4.2": + version "14.4.2" + resolved "https://registry.yarnpkg.com/@nrwl/linter/-/linter-14.4.2.tgz#b6dbcb47f1cfd0ca6e20434bf43081641c8fcfdd" + integrity sha512-K44C+mwwbq0Q3IECNqxO9WGB9J7vSKoyaOzx0BH0HgKtfTSTyALHuM6ylzZ9y9pNK0CDbkVraKoFwDZ42GtzCQ== + dependencies: + "@nrwl/devkit" "14.4.2" + "@nrwl/jest" "14.4.2" + "@phenomnomnominal/tsquery" "4.1.1" + nx "14.4.2" + tmp "~0.2.1" + tslib "^2.3.0" + "@nrwl/node@14.3.6": version "14.3.6" resolved "https://registry.yarnpkg.com/@nrwl/node/-/node-14.3.6.tgz#3eaa368bfb671e00b24f46f19e37829194c8b143" @@ -2741,6 +2870,37 @@ webpack-merge "^5.8.0" webpack-node-externals "^3.0.0" +"@nrwl/node@14.4.2": + version "14.4.2" + resolved "https://registry.yarnpkg.com/@nrwl/node/-/node-14.4.2.tgz#7b322b3ed7310215ff38534c351e0ab7efdf776b" + integrity sha512-YMolQH3R/DTyPap3fQFWXvBaKJQG6l+msAUqzHp5OML3lPDg+zBYGW2kD1IsXpYq/ccpaot1ePS5K0JDpbZ8zQ== + dependencies: + "@nrwl/devkit" "14.4.2" + "@nrwl/jest" "14.4.2" + "@nrwl/js" "14.4.2" + "@nrwl/linter" "14.4.2" + "@nrwl/workspace" "14.4.2" + chalk "4.1.0" + copy-webpack-plugin "^9.0.1" + enhanced-resolve "^5.8.3" + fork-ts-checker-webpack-plugin "6.2.10" + fs-extra "^10.1.0" + glob "7.1.4" + license-webpack-plugin "^4.0.2" + rxjs "^6.5.4" + rxjs-for-await "0.0.2" + source-map-support "0.5.19" + terser-webpack-plugin "^5.3.0" + tree-kill "1.2.2" + ts-loader "^9.2.6" + ts-node "~10.8.0" + tsconfig-paths "^3.9.0" + tsconfig-paths-webpack-plugin "3.5.2" + tslib "^2.3.0" + webpack "^5.58.1" + webpack-merge "^5.8.0" + webpack-node-externals "^3.0.0" + "@nrwl/react@^14.3.5": version "14.3.6" resolved "https://registry.yarnpkg.com/@nrwl/react/-/react-14.3.6.tgz#6de682988aea6fae808926fdb3bc1b9239d802d3" @@ -2791,6 +2951,13 @@ dependencies: nx "14.3.6" +"@nrwl/tao@14.4.2": + version "14.4.2" + resolved "https://registry.yarnpkg.com/@nrwl/tao/-/tao-14.4.2.tgz#36b4d133740abdaf5c222b4e732d0d7020c9def5" + integrity sha512-Ygw3skKZfFhi4MBHZKQ8A67pDQxeyDdY78tFWViMN0SEn9ExL41Q8V9aSMfir8VZYGca6ZOXX5MRhbeHdcgMLQ== + dependencies: + nx "14.4.2" + "@nrwl/web@14.3.6": version "14.3.6" resolved "https://registry.yarnpkg.com/@nrwl/web/-/web-14.3.6.tgz#75f5039716bef7a8b146641724372ec2ae7d45ac" @@ -2908,6 +3075,37 @@ yargs "^17.4.0" yargs-parser "21.0.1" +"@nrwl/workspace@14.4.2": + version "14.4.2" + resolved "https://registry.yarnpkg.com/@nrwl/workspace/-/workspace-14.4.2.tgz#318553e06870008ad78bd0904358b1d3c19cd900" + integrity sha512-D3EXkeg/39V3OeKINvymeOsr5QVRLZFwYOWHfvVcJh8iKpVrev/zMFOm6rSrHmdlpoLkJVAOW2QI+1MYl92Gig== + dependencies: + "@nrwl/devkit" "14.4.2" + "@nrwl/jest" "14.4.2" + "@nrwl/linter" "14.4.2" + "@parcel/watcher" "2.0.4" + chalk "4.1.0" + chokidar "^3.5.1" + cli-cursor "3.1.0" + cli-spinners "2.6.1" + dotenv "~10.0.0" + enquirer "~2.3.6" + figures "3.2.0" + flat "^5.0.2" + fs-extra "^10.1.0" + glob "7.1.4" + ignore "^5.0.4" + minimatch "3.0.5" + npm-run-path "^4.0.1" + nx "14.4.2" + open "^8.4.0" + rxjs "^6.5.4" + semver "7.3.4" + tmp "~0.2.1" + tslib "^2.3.0" + yargs "^17.4.0" + yargs-parser "21.0.1" + "@nuxtjs/opencollective@0.3.2": version "0.3.2" resolved "https://registry.yarnpkg.com/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz#620ce1044f7ac77185e825e1936115bb38e2681c" @@ -3311,7 +3509,7 @@ dependencies: "@sinonjs/commons" "^1.7.0" -"@sinonjs/fake-timers@^9.1.1": +"@sinonjs/fake-timers@^9.1.1", "@sinonjs/fake-timers@^9.1.2": version "9.1.2" resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz#4eaab737fab77332ab132d396a3c0d364bd0ea8c" integrity sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw== @@ -3619,7 +3817,7 @@ "@types/qs" "*" "@types/range-parser" "*" -"@types/express@*", "@types/express@^4.17.13": +"@types/express@*", "@types/express@4.17.13", "@types/express@^4.17.13": version "4.17.13" resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.13.tgz#a76e2995728999bab51a33fabce1d705a3709034" integrity sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA== @@ -3677,7 +3875,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@28.1.3", "@types/jest@^28.1.2": +"@types/jest@28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-28.1.3.tgz#52f3f3e50ce59191ff5fbb1084896cc0cf30c9ce" integrity sha512-Tsbjk8Y2hkBaY/gJsataeb4q9Mubw9EOz7+4RjPkzD5KjTvHHs7cpws22InaoXxAVAhF5HfFbzJjo6oKWqSZLw== @@ -3685,6 +3883,15 @@ jest-matcher-utils "^28.0.0" pretty-format "^28.0.0" +"@types/jsdom@^16.2.4": + version "16.2.14" + resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-16.2.14.tgz#26fe9da6a8870715b154bb84cd3b2e53433d8720" + integrity sha512-6BAy1xXEmMuHeAJ4Fv4yXKwBDTGTOseExKE3OaHiNycdHdZw59KfYzrt0DkDluvwmik1HRt6QS7bImxUmpSy+w== + dependencies: + "@types/node" "*" + "@types/parse5" "*" + "@types/tough-cookie" "*" + "@types/json-schema@*", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.11" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" @@ -3722,7 +3929,14 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== -"@types/node@*", "@types/node@18.0.0", "@types/node@>=12", "@types/node@>=12.12.47", "@types/node@>=13.7.0", "@types/node@^18.0.0": +"@types/morgan@^1.9.3": + version "1.9.3" + resolved "https://registry.yarnpkg.com/@types/morgan/-/morgan-1.9.3.tgz#ae04180dff02c437312bc0cfb1e2960086b2f540" + integrity sha512-BiLcfVqGBZCyNCnCH3F4o2GmDLrpy0HeBVnNlyZG4fo88ZiE9SoiBe3C+2ezuwbjlEyT+PDZ17//TAlRxAn75Q== + dependencies: + "@types/node" "*" + +"@types/node@*", "@types/node@18.0.0", "@types/node@>=12", "@types/node@>=12.12.47", "@types/node@>=13.7.0": version "18.0.0" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.0.tgz#67c7b724e1bcdd7a8821ce0d5ee184d3b4dd525a" integrity sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA== @@ -3752,6 +3966,11 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== +"@types/parse5@*": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.3.tgz#705bb349e789efa06f43f128cef51240753424cb" + integrity sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g== + "@types/prettier@^2.1.5": version "2.6.3" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.3.tgz#68ada76827b0010d0db071f739314fa429943d0a" @@ -3806,6 +4025,11 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== +"@types/tough-cookie@*": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.2.tgz#6286b4c7228d58ab7866d19716f3696e03a09397" + integrity sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw== + "@types/uuid@8.3.4": version "8.3.4" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc" @@ -4210,7 +4434,7 @@ JSONStream@^1.0.4: jsonparse "^1.2.0" through ">=2.2.7 <3" -abab@^2.0.3, abab@^2.0.5: +abab@^2.0.3, abab@^2.0.5, abab@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== @@ -4227,7 +4451,7 @@ abort-controller@^3.0.0: dependencies: event-target-shim "^5.0.0" -accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8: +accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7, accepts@~1.3.8: version "1.3.8" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== @@ -4248,7 +4472,7 @@ acorn-import-assertions@^1.7.6: resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== -acorn-jsx@^5.3.2: +acorn-jsx@^5.3.1, acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== @@ -4272,7 +4496,7 @@ acorn-walk@^8.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -acorn@^7.0.0, acorn@^7.1.1: +acorn@^7.0.0, acorn@^7.1.1, acorn@^7.4.0: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== @@ -4331,7 +4555,7 @@ ajv@^6.10.0, ajv@^6.12.2, ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.0, ajv@^8.11.0, ajv@^8.8.0: +ajv@^8.0.0, ajv@^8.0.1, ajv@^8.11.0, ajv@^8.8.0: version "8.11.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f" integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg== @@ -4858,7 +5082,23 @@ bluebird@3.7.1: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.1.tgz#df70e302b471d7473489acf26a93d63b53f874de" integrity sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg== -body-parser@1.20.0: +body-parser@1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.1.tgz#1499abbaa9274af3ecc9f6f10396c995943e31d4" + integrity sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA== + dependencies: + bytes "3.1.1" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "1.8.1" + iconv-lite "0.4.24" + on-finished "~2.3.0" + qs "6.9.6" + raw-body "2.4.2" + type-is "~1.6.18" + +body-parser@1.20.0, body-parser@^1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.0.tgz#3de69bd89011c11573d7bfee6a64f11b6bd27cc5" integrity sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg== @@ -5014,6 +5254,11 @@ bytes@3.0.0: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" integrity sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw== +bytes@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.1.tgz#3f018291cb4cbad9accb6e6970bca9c8889e879a" + integrity sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg== + bytes@3.1.2, bytes@^3.1.0: version "3.1.2" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" @@ -5661,6 +5906,11 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== +cookie@0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" + integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== + cookie@0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" @@ -5906,6 +6156,11 @@ cssom@^0.4.4: resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10" integrity sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw== +cssom@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.5.0.tgz#d254fa92cd8b6fbd83811b9fbaed34663cc17c36" + integrity sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw== + cssom@~0.3.6: version "0.3.8" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" @@ -5950,6 +6205,15 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" +data-urls@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-3.0.2.tgz#9cf24a477ae22bcef5cd5f6f0bfbc1d2d3be9143" + integrity sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ== + dependencies: + abab "^2.0.6" + whatwg-mimetype "^3.0.0" + whatwg-url "^11.0.0" + dataloader@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-1.4.0.tgz#bca11d867f5d3f1b9ed9f737bd15970c65dff5c8" @@ -5972,7 +6236,7 @@ debug@2.6.9, debug@^2.6.9: dependencies: ms "2.0.0" -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: +debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -6006,7 +6270,7 @@ decamelize@^1.1.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== -decimal.js@^10.2.1: +decimal.js@^10.2.1, decimal.js@^10.3.1: version "10.3.1" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ== @@ -6131,6 +6395,11 @@ destroy@1.2.0: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + integrity sha512-3NdhDuEXnfun/z7x9GOElY49LoqVHoGScmOKwmxhsS8N5Y+Z8KyPPDnaSzqWgYt/ji4mqwfTS34Htrk0zPIXVg== + detect-indent@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" @@ -6243,6 +6512,13 @@ domexception@^2.0.1: dependencies: webidl-conversions "^5.0.0" +domexception@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-4.0.0.tgz#4ad1be56ccadc86fc76d033353999a8037d03673" + integrity sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw== + dependencies: + webidl-conversions "^7.0.0" + domhandler@^4.2.0, domhandler@^4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c" @@ -6419,7 +6695,7 @@ enhanced-resolve@^5.0.0, enhanced-resolve@^5.7.0, enhanced-resolve@^5.8.3, enhan graceful-fs "^4.2.4" tapable "^2.2.0" -enquirer@~2.3.6: +enquirer@^2.3.5, enquirer@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== @@ -6727,7 +7003,7 @@ eslint-import-resolver-node@^0.3.6: debug "^3.2.7" resolve "^1.20.0" -eslint-module-utils@^2.7.3: +eslint-module-utils@^2.7.0, eslint-module-utils@^2.7.3: version "2.7.3" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz#ad7e3a10552fdd0642e1e55292781bd6e34876ee" integrity sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ== @@ -6749,6 +7025,25 @@ eslint-plugin-compat@^4.0.0: lodash.memoize "4.1.2" semver "7.3.5" +eslint-plugin-import@2.25.2: + version "2.25.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.2.tgz#b3b9160efddb702fc1636659e71ba1d10adbe9e9" + integrity sha512-qCwQr9TYfoBHOFcVGKY9C9unq05uOxxdklmBXLVvcwo68y5Hta6/GzCZEMx2zQiu0woKNEER0LE7ZgaOfBU14g== + dependencies: + array-includes "^3.1.4" + array.prototype.flat "^1.2.5" + debug "^2.6.9" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.6" + eslint-module-utils "^2.7.0" + has "^1.0.3" + is-core-module "^2.7.0" + is-glob "^4.0.3" + minimatch "^3.0.4" + object.values "^1.1.5" + resolve "^1.20.0" + tsconfig-paths "^3.11.0" + eslint-plugin-import@^2.25.2: version "2.26.0" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz#f812dc47be4f2b72b478a021605a59fc6fe8b88b" @@ -6869,6 +7164,13 @@ eslint-scope@^7.1.1: esrecurse "^4.3.0" estraverse "^5.2.0" +eslint-utils@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" + integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== + dependencies: + eslint-visitor-keys "^1.1.0" + eslint-utils@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" @@ -6876,6 +7178,11 @@ eslint-utils@^3.0.0: dependencies: eslint-visitor-keys "^2.0.0" +eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" @@ -6886,6 +7193,52 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== +eslint@^7.26.0: + version "7.32.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" + integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== + dependencies: + "@babel/code-frame" "7.12.11" + "@eslint/eslintrc" "^0.4.3" + "@humanwhocodes/config-array" "^0.5.0" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.0.1" + doctrine "^3.0.0" + enquirer "^2.3.5" + escape-string-regexp "^4.0.0" + eslint-scope "^5.1.1" + eslint-utils "^2.1.0" + eslint-visitor-keys "^2.0.0" + espree "^7.3.1" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^5.1.2" + globals "^13.6.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + js-yaml "^3.13.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.0.4" + natural-compare "^1.4.0" + optionator "^0.9.1" + progress "^2.0.0" + regexpp "^3.1.0" + semver "^7.2.1" + strip-ansi "^6.0.0" + strip-json-comments "^3.1.0" + table "^6.0.9" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + eslint@^8.19.0: version "8.19.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.19.0.tgz#7342a3cbc4fbc5c106a1eefe0fd0b50b6b1a7d28" @@ -6968,6 +7321,15 @@ eslint@~8.18.0: text-table "^0.2.0" v8-compile-cache "^2.0.3" +espree@^7.3.0, espree@^7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" + integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== + dependencies: + acorn "^7.4.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^1.3.0" + espree@^9.3.2: version "9.3.2" resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.2.tgz#f58f77bd334731182801ced3380a8cc859091596" @@ -7109,6 +7471,42 @@ express-fileupload@^1.4.0: dependencies: busboy "^1.6.0" +express@4.17.2: + version "4.17.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.17.2.tgz#c18369f265297319beed4e5558753cc8c1364cb3" + integrity sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg== + dependencies: + accepts "~1.3.7" + array-flatten "1.1.1" + body-parser "1.19.1" + content-disposition "0.5.4" + content-type "~1.0.4" + cookie "0.4.1" + cookie-signature "1.0.6" + debug "2.6.9" + depd "~1.1.2" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "~1.1.2" + fresh "0.5.2" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.7" + qs "6.9.6" + range-parser "~1.2.1" + safe-buffer "5.2.1" + send "0.17.2" + serve-static "1.14.2" + setprototypeof "1.2.0" + statuses "~1.5.0" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + express@^4.17.3, express@^4.18.1: version "4.18.1" resolved "https://registry.yarnpkg.com/express/-/express-4.18.1.tgz#7797de8b9c72c857b9cd0e14a5eea80666267caf" @@ -7306,6 +7704,19 @@ finalhandler@1.2.0: statuses "2.0.1" unpipe "~1.0.0" +finalhandler@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" + integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.3" + statuses "~1.5.0" + unpipe "~1.0.0" + find-cache-dir@^3.3.1, find-cache-dir@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" @@ -7464,6 +7875,15 @@ form-data@^3.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -7828,6 +8248,13 @@ globals@^13.15.0: dependencies: type-fest "^0.20.2" +globals@^13.6.0, globals@^13.9.0: + version "13.16.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.16.0.tgz#9be4aca28f311aaeb974ea54978ebbb5e35ce46a" + integrity sha512-A1lrQfpNF+McdPOnnFqY3kSN0AFTy485bTi1bkLk4mVPODIUEcSfhHgRqA+QdXPksrSTTztYXx37NFV+GpGk3Q== + dependencies: + type-fest "^0.20.2" + globby@10.0.1: version "10.0.1" resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.1.tgz#4782c34cb75dd683351335c5829cc3420e606b22" @@ -8120,6 +8547,17 @@ http-deceiver@^1.2.7: resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" integrity sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw== +http-errors@1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c" + integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.1" + http-errors@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" @@ -8272,6 +8710,11 @@ ignore-by-default@^1.0.1: resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09" integrity sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA== +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + ignore@^5.0.4, ignore@^5.1.1, ignore@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" @@ -8643,7 +9086,7 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.5.0, is-core-module@^2.8.1, is-core-module@^2.9.0: +is-core-module@^2.5.0, is-core-module@^2.7.0, is-core-module@^2.8.1, is-core-module@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69" integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A== @@ -9268,6 +9711,20 @@ jest-environment-jsdom@^27.5.1: jest-util "^27.5.1" jsdom "^16.6.0" +jest-environment-jsdom@^28.1.2: + version "28.1.2" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-28.1.2.tgz#d3fe82ef8f900c34ab582df7d3002c5079e3d8ab" + integrity sha512-Ujhx/xFZGVPuxAVpseQ7KqdBErenuWH3Io2HujkGOKMS2VWmpnTGYHzv+73p21QJ9yYQlJkeg06rTe1svV+u0g== + dependencies: + "@jest/environment" "^28.1.2" + "@jest/fake-timers" "^28.1.2" + "@jest/types" "^28.1.1" + "@types/jsdom" "^16.2.4" + "@types/node" "*" + jest-mock "^28.1.1" + jest-util "^28.1.1" + jsdom "^19.0.0" + jest-environment-node@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.5.1.tgz#dedc2cfe52fab6b8f5714b4808aefa85357a365e" @@ -9755,7 +10212,7 @@ jest-worker@^28.1.1: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@28.1.1, jest@^28.1.1: +jest@28.1.1: version "28.1.1" resolved "https://registry.yarnpkg.com/jest/-/jest-28.1.1.tgz#3c39a3a09791e16e9ef283597d24ab19a0df701e" integrity sha512-qw9YHBnjt6TCbIDMPMpJZqf9E12rh6869iZaN08/vpOGgHJSAaLLUn6H8W3IAEuy34Ls3rct064mZLETkxJ2XA== @@ -9825,6 +10282,39 @@ jsdom@^16.6.0: ws "^7.4.6" xml-name-validator "^3.0.0" +jsdom@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-19.0.0.tgz#93e67c149fe26816d38a849ea30ac93677e16b6a" + integrity sha512-RYAyjCbxy/vri/CfnjUWJQQtZ3LKlLnDqj+9XLNnJPgEGeirZs3hllKR20re8LUZ6o1b1X4Jat+Qd26zmP41+A== + dependencies: + abab "^2.0.5" + acorn "^8.5.0" + acorn-globals "^6.0.0" + cssom "^0.5.0" + cssstyle "^2.3.0" + data-urls "^3.0.1" + decimal.js "^10.3.1" + domexception "^4.0.0" + escodegen "^2.0.0" + form-data "^4.0.0" + html-encoding-sniffer "^3.0.0" + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.0" + is-potential-custom-element-name "^1.0.1" + nwsapi "^2.2.0" + parse5 "6.0.1" + saxes "^5.0.1" + symbol-tree "^3.2.4" + tough-cookie "^4.0.0" + w3c-hr-time "^1.0.2" + w3c-xmlserializer "^3.0.0" + webidl-conversions "^7.0.0" + whatwg-encoding "^2.0.0" + whatwg-mimetype "^3.0.0" + whatwg-url "^10.0.0" + ws "^8.2.3" + xml-name-validator "^4.0.0" + jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" @@ -10291,6 +10781,11 @@ lodash.once@^4.0.0: resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg== +lodash.truncate@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" + integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== + lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" @@ -10870,6 +11365,42 @@ nx@14.3.6: yargs "^17.4.0" yargs-parser "21.0.1" +nx@14.4.2: + version "14.4.2" + resolved "https://registry.yarnpkg.com/nx/-/nx-14.4.2.tgz#48ac7f82caccdf26ecd77b76e110c550bcafe7ca" + integrity sha512-bYO//HuwQL4X8y+2BjUPtkPLDiYI1zMejQo6+uJl3+VdYPcsjwW/ca581tBPHiPH95XnHiBartnMrMJtn11grw== + dependencies: + "@nrwl/cli" "14.4.2" + "@nrwl/tao" "14.4.2" + "@parcel/watcher" "2.0.4" + chalk "4.1.0" + chokidar "^3.5.1" + cli-cursor "3.1.0" + cli-spinners "2.6.1" + cliui "^7.0.2" + dotenv "~10.0.0" + enquirer "~2.3.6" + fast-glob "3.2.7" + figures "3.2.0" + flat "^5.0.2" + fs-extra "^10.1.0" + glob "7.1.4" + ignore "^5.0.4" + js-yaml "4.1.0" + jsonc-parser "3.0.0" + minimatch "3.0.5" + npm-run-path "^4.0.1" + open "^8.4.0" + semver "7.3.4" + string-width "^4.2.3" + tar-stream "~2.2.0" + tmp "~0.2.1" + tsconfig-paths "^3.9.0" + tslib "^2.3.0" + v8-compile-cache "2.3.0" + yargs "^17.4.0" + yargs-parser "21.0.1" + object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -11785,6 +12316,11 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + promise-polyfill@8.1.3: version "8.1.3" resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-8.1.3.tgz#8c99b3cf53f3a91c68226ffde7bde81d7f904116" @@ -11907,6 +12443,11 @@ qs@6.10.3: dependencies: side-channel "^1.0.4" +qs@6.9.6: + version "6.9.6" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee" + integrity sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ== + qs@^6.4.0: version "6.10.5" resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.5.tgz#974715920a80ff6a262264acd2c7e6c2a53282b4" @@ -11953,6 +12494,16 @@ range-parser@^1.2.1, range-parser@~1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== +raw-body@2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.2.tgz#baf3e9c21eebced59dd6533ac872b71f7b61cb32" + integrity sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ== + dependencies: + bytes "3.1.1" + http-errors "1.8.1" + iconv-lite "0.4.24" + unpipe "1.0.0" + raw-body@2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" @@ -12143,7 +12694,7 @@ regexp.prototype.flags@^1.3.0, regexp.prototype.flags@^1.4.1, regexp.prototype.f define-properties "^1.1.3" functions-have-names "^1.2.2" -regexpp@^3.2.0: +regexpp@^3.1.0, regexpp@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== @@ -12230,7 +12781,7 @@ resolve.exports@1.1.0, resolve.exports@^1.1.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== -resolve@^1.1.7, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0: +resolve@^1.1.7, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.22.1: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -12367,6 +12918,13 @@ rollup-pluginutils@^2.8.2: dependencies: estree-walker "^0.6.1" +rollup@^2.47.0: + version "2.76.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.76.0.tgz#c69fe03db530ac53fcb9523b3caa0d3c0b9491a1" + integrity sha512-9jwRIEY1jOzKLj3nsY/yot41r19ITdQrhs+q3ggNWhr9TQgduHqANvPpS32RNpzGklJu3G1AJfvlZLi/6wFgWA== + optionalDependencies: + fsevents "~2.3.2" + rollup@^2.56.2, rollup@^2.59.0: version "2.75.7" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.75.7.tgz#221ff11887ae271e37dcc649ba32ce1590aaa0b9" @@ -12565,7 +13123,7 @@ semver@7.3.5: dependencies: lru-cache "^6.0.0" -semver@7.3.7, semver@7.x, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7: +semver@7.3.7, semver@7.x, semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7: version "7.3.7" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== @@ -12577,6 +13135,25 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +send@0.17.2: + version "0.17.2" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.2.tgz#926622f76601c41808012c8bf1688fe3906f7820" + integrity sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww== + dependencies: + debug "2.6.9" + depd "~1.1.2" + destroy "~1.0.4" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "1.8.1" + mime "1.6.0" + ms "2.1.3" + on-finished "~2.3.0" + range-parser "~1.2.1" + statuses "~1.5.0" + send@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" @@ -12616,6 +13193,16 @@ serve-index@^1.9.1: mime-types "~2.1.17" parseurl "~1.3.2" +serve-static@1.14.2: + version "1.14.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.2.tgz#722d6294b1d62626d41b43a013ece4598d292bfa" + integrity sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.17.2" + serve-static@1.15.0: version "1.15.0" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" @@ -12939,7 +13526,7 @@ statuses@2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -"statuses@>= 1.4.0 < 2": +"statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@~1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== @@ -13232,10 +13819,21 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -tailwindcss@^3.0.23: - version "3.1.4" - resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.1.4.tgz#64b09059805505902139fa805d97046080bd90b9" - integrity sha512-NrxbFV4tYsga/hpWbRyUfIaBrNMXDxx5BsHgBS4v5tlyjf+sDsgBg5m9OxjrXIqAS/uR9kicxLKP+bEHI7BSeQ== +table@^6.0.9: + version "6.8.0" + resolved "https://registry.yarnpkg.com/table/-/table-6.8.0.tgz#87e28f14fa4321c3377ba286f07b79b281a3b3ca" + integrity sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA== + dependencies: + ajv "^8.0.1" + lodash.truncate "^4.4.2" + slice-ansi "^4.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" + +tailwindcss@^3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.1.6.tgz#bcb719357776c39e6376a8d84e9834b2b19a49f1" + integrity sha512-7skAOY56erZAFQssT1xkpk+kWt2NrO45kORlxFPXUt3CiGsVPhH1smuH5XoDH6sGPXLyBv+zgCKA2HWBsgCytg== dependencies: arg "^5.0.2" chokidar "^3.5.3" @@ -13258,7 +13856,7 @@ tailwindcss@^3.0.23: postcss-selector-parser "^6.0.10" postcss-value-parser "^4.2.0" quick-lru "^5.1.1" - resolve "^1.22.0" + resolve "^1.22.1" tapable@^1.0.0: version "1.1.3" @@ -13451,6 +14049,13 @@ tr46@^2.1.0: dependencies: punycode "^2.1.1" +tr46@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-3.0.0.tgz#555c4e297a950617e8eeddef633c87d4d9d6cbf9" + integrity sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA== + dependencies: + punycode "^2.1.1" + tree-kill@1.2.2, tree-kill@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" @@ -13532,7 +14137,7 @@ tsconfig-paths-webpack-plugin@3.5.2: enhanced-resolve "^5.7.0" tsconfig-paths "^3.9.0" -tsconfig-paths@^3.14.1, tsconfig-paths@^3.9.0: +tsconfig-paths@^3.11.0, tsconfig-paths@^3.14.1, tsconfig-paths@^3.9.0: version "3.14.1" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" integrity sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ== @@ -13652,7 +14257,7 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -typescript@^4.5.4, typescript@^4.6.4, typescript@^4.7.3, typescript@^4.7.4: +typescript@^4.5.4, typescript@^4.6.4: version "4.7.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== @@ -13886,6 +14491,15 @@ vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== +vite-plugin-eslint@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/vite-plugin-eslint/-/vite-plugin-eslint-1.3.0.tgz#cbc3f1542ca5e90d592ccfb6b4957e9b63f99a0e" + integrity sha512-ng6liBWegj6bovfJVGsXXL2XeQR3xnqe4UsnwTE8rbsYTnAaiLfaZK3rruGAyiwCBPbBc2IEED6T7sus5NJfEw== + dependencies: + "@rollup/pluginutils" "^4.1.0" + eslint "^7.26.0" + rollup "^2.47.0" + vite-plugin-magical-svg@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/vite-plugin-magical-svg/-/vite-plugin-magical-svg-1.0.2.tgz#32e1be2987e4293d23684e0cf710a02fcbb3bf9c" @@ -13917,6 +14531,18 @@ vite@^2.8.0: optionalDependencies: fsevents "~2.3.2" +vite@^2.9.9: + version "2.9.14" + resolved "https://registry.yarnpkg.com/vite/-/vite-2.9.14.tgz#c438324c6594afd1050df3777da981dee988bb1b" + integrity sha512-P/UCjSpSMcE54r4mPak55hWAZPlyfS369svib/gpmz8/01L822lMPOJ/RYW6tLCe1RPvMvOsJ17erf55bKp4Hw== + dependencies: + esbuild "^0.14.27" + postcss "^8.4.13" + resolve "^1.22.0" + rollup "^2.59.0" + optionalDependencies: + fsevents "~2.3.2" + w3c-hr-time@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" @@ -13931,6 +14557,13 @@ w3c-xmlserializer@^2.0.0: dependencies: xml-name-validator "^3.0.0" +w3c-xmlserializer@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-3.0.0.tgz#06cdc3eefb7e4d0b20a560a5a3aeb0d2d9a65923" + integrity sha512-3WFqGEgSXIyGhOmAFtlicJNMjEps8b1MG31NCA0/vOF9+nKMUW1ckhi9cnNHmf88Rzw5V+dwIwsm2C7X8k9aQg== + dependencies: + xml-name-validator "^4.0.0" + walker@^1.0.7, walker@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" @@ -13970,6 +14603,11 @@ webidl-conversions@^6.1.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== +webidl-conversions@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" + integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== + webpack-dev-middleware@^5.3.1: version "5.3.3" resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-5.3.3.tgz#efae67c2793908e7311f1d9b06f2a08dcc97e51f" @@ -14109,6 +14747,27 @@ whatwg-mimetype@^2.3.0: resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== +whatwg-mimetype@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz#5fa1a7623867ff1af6ca3dc72ad6b8a4208beba7" + integrity sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q== + +whatwg-url@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-10.0.0.tgz#37264f720b575b4a311bd4094ed8c760caaa05da" + integrity sha512-CLxxCmdUby142H5FZzn4D8ikO1cmypvXVQktsgosNy4a4BHrDHeciBBGZhb0bNoR5/MltoCatso+vFjjGx8t0w== + dependencies: + tr46 "^3.0.0" + webidl-conversions "^7.0.0" + +whatwg-url@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-11.0.0.tgz#0a849eebb5faf2119b901bb76fd795c2848d4018" + integrity sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ== + dependencies: + tr46 "^3.0.0" + webidl-conversions "^7.0.0" + whatwg-url@^8.0.0, whatwg-url@^8.5.0: version "8.7.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" @@ -14260,7 +14919,7 @@ write-file-atomic@^4.0.1: imurmurhash "^0.1.4" signal-exit "^3.0.7" -ws@>=7.4.6, ws@^8.2.0, ws@^8.4.2: +ws@>=7.4.6, ws@^8.2.0, ws@^8.2.3, ws@^8.4.2: version "8.8.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.8.0.tgz#8e71c75e2f6348dbf8d78005107297056cb77769" integrity sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ== @@ -14280,6 +14939,11 @@ xml-name-validator@^3.0.0: resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== +xml-name-validator@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-4.0.0.tgz#79a006e2e63149a8600f15430f0a4725d1524835" + integrity sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw== + xml2js@^0.4.23: version "0.4.23" resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.23.tgz#a0c69516752421eb2ac758ee4d4ccf58843eac66"