Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 93 additions & 48 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/JohnSundell/Ink.git", from: "0.5.1"),
.package(url: "https://github.com/swift-server/swift-prometheus.git", from: "1.0.0"),
.package(url: "https://github.com/SwiftPackageIndex/Plot.git", branch: "main"),
.package(url: "https://github.com/SwiftPackageIndex/CanonicalPackageURL.git", from: "1.0.0"),
.package(url: "https://github.com/SwiftPackageIndex/DependencyResolution.git", from: "1.1.2"),
.package(url: "https://github.com/SwiftPackageIndex/PackageCollections.git", branch: "main"),
.package(url: "https://github.com/SwiftPackageIndex/Plot.git", branch: "main"),
.package(url: "https://github.com/SwiftPackageIndex/SPIManifest.git", from: "1.2.0"),
.package(url: "https://github.com/SwiftPackageIndex/SemanticVersion.git", from: "0.3.0"),
.package(url: "https://github.com/SwiftPackageIndex/ShellOut.git", from: "3.1.4"),
.package(url: "https://github.com/swiftlang/swift-package-manager.git", branch: "release/6.1"),
.package(url: "https://github.com/pointfreeco/swift-custom-dump.git", from: "1.0.0"),
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.8.0"),
.package(url: "https://github.com/pointfreeco/swift-parsing.git", from: "0.12.0"),
Expand Down Expand Up @@ -68,10 +68,11 @@ let package = Package(
.product(name: "DependencyResolution", package: "DependencyResolution"),
.product(name: "Fluent", package: "fluent"),
.product(name: "FluentPostgresDriver", package: "fluent-postgres-driver"),
.product(name: "PackageCollections", package: "PackageCollections"),
.product(name: "Parsing", package: "swift-parsing"),
.product(name: "Redis", package: "redis"),
.product(name: "ShellOut", package: "ShellOut"),
.product(name: "SwiftPMDataModel-auto", package: "swift-package-manager"),
.product(name: "SwiftPMPackageCollections", package: "swift-package-manager"),
.product(name: "Vapor", package: "vapor"),
.product(name: "SotoCognitoAuthentication", package: "soto-cognito-authentication"),
.product(name: "JWTKit", package: "jwt-kit")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import Fluent
import PackageCollectionsModel
import PackageCollectionsSigning
import Vapor


Expand All @@ -22,14 +23,14 @@ extension API {
enum PackageCollectionController {

@Sendable
static func generate(req: Request) async throws -> PackageCollection {
static func generate(req: Request) async throws -> SignedCollection {
AppMetrics.apiPackageCollectionGetTotal?.inc()

let dto = try req.content.decode(PostPackageCollectionDTO.self)

switch dto.selection {
case let .author(author):
return try await PackageCollection.generate(
return try await SignedCollection.generate(
db: req.db,
filterBy: .author(author),
authorName: dto.authorName ?? "Swift Package Index",
Expand All @@ -43,7 +44,7 @@ extension API {
guard packageURLs.count <= 20 else {
throw Abort(.badRequest)
}
return try await PackageCollection.generate(
return try await SignedCollection.generate(
db: req.db,
filterBy: .urls(packageURLs),
authorName: dto.authorName ?? "Swift Package Index",
Expand All @@ -60,7 +61,7 @@ extension API {
}


extension PackageCollectionModel.V1.Collection: Vapor.Content {}
extension PackageCollectionSigning.Model.SignedCollection: @retroactive @unchecked Sendable, Vapor.Content {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should open a PR upstream to conform PackageCollectionModel.V1.Collection to Sendable so we can avoid this @retroactive @unchecked Sendable here.



extension API {
Expand Down
Loading
Loading