@@ -147,7 +147,25 @@ public final class RegistryClient: Cancellable {
147
147
callback: completion
148
148
)
149
149
}
150
+
151
+ public func getPackageMetadata(
152
+ package : PackageIdentity ,
153
+ timeout: DispatchTimeInterval ? = . none,
154
+ observabilityScope: ObservabilityScope ,
155
+ callbackQueue: DispatchQueue
156
+ ) async throws -> PackageMetadata {
157
+ try await safe_async {
158
+ self . getPackageMetadata (
159
+ package : package ,
160
+ timeout: timeout,
161
+ observabilityScope: observabilityScope,
162
+ callbackQueue: callbackQueue,
163
+ completion: $0
164
+ )
165
+ }
166
+ }
150
167
168
+ @available ( * , noasync, message: " Use the async alternative " )
151
169
public func getPackageMetadata(
152
170
package : PackageIdentity ,
153
171
timeout: DispatchTimeInterval ? = . none,
@@ -260,7 +278,29 @@ public final class RegistryClient: Cancellable {
260
278
)
261
279
}
262
280
}
281
+
282
+ public func getPackageVersionMetadata(
283
+ package : PackageIdentity ,
284
+ version: Version ,
285
+ timeout: DispatchTimeInterval ? = . none,
286
+ fileSystem: FileSystem ,
287
+ observabilityScope: ObservabilityScope ,
288
+ callbackQueue: DispatchQueue
289
+ ) async throws -> PackageVersionMetadata {
290
+ try await safe_async {
291
+ self . getPackageVersionMetadata (
292
+ package : package ,
293
+ version: version,
294
+ timeout: timeout,
295
+ fileSystem: fileSystem,
296
+ observabilityScope: observabilityScope,
297
+ callbackQueue: callbackQueue,
298
+ completion: $0
299
+ )
300
+ }
301
+ }
263
302
303
+ @available ( * , noasync, message: " Use the async alternative " )
264
304
public func getPackageVersionMetadata(
265
305
package : PackageIdentity ,
266
306
version: Version ,
@@ -462,6 +502,26 @@ public final class RegistryClient: Cancellable {
462
502
}
463
503
}
464
504
505
+ public func getAvailableManifests(
506
+ package : PackageIdentity ,
507
+ version: Version ,
508
+ timeout: DispatchTimeInterval ? = . none,
509
+ observabilityScope: ObservabilityScope ,
510
+ callbackQueue: DispatchQueue
511
+ ) async throws -> [ String : ( toolsVersion: ToolsVersion , content: String ? ) ] {
512
+ try await safe_async {
513
+ self . getAvailableManifests (
514
+ package : package ,
515
+ version: version,
516
+ timeout: timeout,
517
+ observabilityScope: observabilityScope,
518
+ callbackQueue: callbackQueue,
519
+ completion: $0
520
+ )
521
+ }
522
+ }
523
+
524
+ @available ( * , noasync, message: " Use the async alternative " )
465
525
public func getAvailableManifests(
466
526
package : PackageIdentity ,
467
527
version: Version ,
@@ -689,7 +749,28 @@ public final class RegistryClient: Cancellable {
689
749
}
690
750
}
691
751
}
692
-
752
+ public func getManifestContent(
753
+ package : PackageIdentity ,
754
+ version: Version ,
755
+ customToolsVersion: ToolsVersion ? ,
756
+ timeout: DispatchTimeInterval ? = . none,
757
+ observabilityScope: ObservabilityScope ,
758
+ callbackQueue: DispatchQueue
759
+ ) async throws -> String {
760
+ try await safe_async {
761
+ self . getManifestContent (
762
+ package : package ,
763
+ version: version,
764
+ customToolsVersion: customToolsVersion,
765
+ timeout: timeout,
766
+ observabilityScope: observabilityScope,
767
+ callbackQueue: callbackQueue,
768
+ completion: $0
769
+ )
770
+ }
771
+ }
772
+
773
+ @available ( * , noasync, message: " Use the async alternative " )
693
774
public func getManifestContent(
694
775
package : PackageIdentity ,
695
776
version: Version ,
@@ -898,7 +979,32 @@ public final class RegistryClient: Cancellable {
898
979
}
899
980
}
900
981
}
982
+ public func downloadSourceArchive(
983
+ package : PackageIdentity ,
984
+ version: Version ,
985
+ destinationPath: AbsolutePath ,
986
+ progressHandler: ( ( _ bytesReceived: Int64 , _ totalBytes: Int64 ? ) -> Void ) ? ,
987
+ timeout: DispatchTimeInterval ? = . none,
988
+ fileSystem: FileSystem ,
989
+ observabilityScope: ObservabilityScope ,
990
+ callbackQueue: DispatchQueue
991
+ ) async throws {
992
+ try await safe_async {
993
+ self . downloadSourceArchive (
994
+ package : package ,
995
+ version: version,
996
+ destinationPath: destinationPath,
997
+ progressHandler: progressHandler,
998
+ timeout: timeout,
999
+ fileSystem: fileSystem,
1000
+ observabilityScope: observabilityScope,
1001
+ callbackQueue: callbackQueue,
1002
+ completion: $0
1003
+ )
1004
+ }
1005
+ }
901
1006
1007
+ @available ( * , noasync, message: " Use the async alternative " )
902
1008
public func downloadSourceArchive(
903
1009
package : PackageIdentity ,
904
1010
version: Version ,
@@ -1189,7 +1295,25 @@ public final class RegistryClient: Cancellable {
1189
1295
}
1190
1296
}
1191
1297
}
1298
+
1299
+ public func lookupIdentities(
1300
+ scmURL: SourceControlURL ,
1301
+ timeout: DispatchTimeInterval ? = . none,
1302
+ observabilityScope: ObservabilityScope ,
1303
+ callbackQueue: DispatchQueue
1304
+ ) async throws -> Set < PackageIdentity > {
1305
+ try await safe_async {
1306
+ self . lookupIdentities (
1307
+ scmURL: scmURL,
1308
+ timeout: timeout,
1309
+ observabilityScope: observabilityScope,
1310
+ callbackQueue: callbackQueue,
1311
+ completion: $0
1312
+ )
1313
+ }
1314
+ }
1192
1315
1316
+ @available ( * , noasync, message: " Use the async alternative " )
1193
1317
public func lookupIdentities(
1194
1318
scmURL: SourceControlURL ,
1195
1319
timeout: DispatchTimeInterval ? = . none,
@@ -1294,7 +1418,25 @@ public final class RegistryClient: Cancellable {
1294
1418
)
1295
1419
}
1296
1420
}
1421
+
1422
+ public func login(
1423
+ loginURL: URL ,
1424
+ timeout: DispatchTimeInterval ? = . none,
1425
+ observabilityScope: ObservabilityScope ,
1426
+ callbackQueue: DispatchQueue
1427
+ ) async throws {
1428
+ try await safe_async {
1429
+ self . login (
1430
+ loginURL: loginURL,
1431
+ timeout: timeout,
1432
+ observabilityScope: observabilityScope,
1433
+ callbackQueue: callbackQueue,
1434
+ completion: $0
1435
+ )
1436
+ }
1437
+ }
1297
1438
1439
+ @available ( * , noasync, message: " Use the async alternative " )
1298
1440
public func login(
1299
1441
loginURL: URL ,
1300
1442
timeout: DispatchTimeInterval ? = . none,
@@ -1331,7 +1473,41 @@ public final class RegistryClient: Cancellable {
1331
1473
}
1332
1474
}
1333
1475
}
1476
+
1477
+ public func publish(
1478
+ registryURL: URL ,
1479
+ packageIdentity: PackageIdentity ,
1480
+ packageVersion: Version ,
1481
+ packageArchive: AbsolutePath ,
1482
+ packageMetadata: AbsolutePath ? ,
1483
+ signature: [ UInt8 ] ? ,
1484
+ metadataSignature: [ UInt8 ] ? ,
1485
+ signatureFormat: SignatureFormat ? ,
1486
+ timeout: DispatchTimeInterval ? = . none,
1487
+ fileSystem: FileSystem ,
1488
+ observabilityScope: ObservabilityScope ,
1489
+ callbackQueue: DispatchQueue
1490
+ ) async throws -> PublishResult {
1491
+ try await safe_async {
1492
+ self . publish (
1493
+ registryURL: registryURL,
1494
+ packageIdentity: packageIdentity,
1495
+ packageVersion: packageVersion,
1496
+ packageArchive: packageArchive,
1497
+ packageMetadata: packageMetadata,
1498
+ signature: signature,
1499
+ metadataSignature: metadataSignature,
1500
+ signatureFormat: signatureFormat,
1501
+ timeout: timeout,
1502
+ fileSystem: fileSystem,
1503
+ observabilityScope: observabilityScope,
1504
+ callbackQueue: callbackQueue,
1505
+ completion: $0
1506
+ )
1507
+ }
1508
+ }
1334
1509
1510
+ @available ( * , noasync, message: " Use the async alternative " )
1335
1511
public func publish(
1336
1512
registryURL: URL ,
1337
1513
packageIdentity: PackageIdentity ,
@@ -1499,8 +1675,26 @@ public final class RegistryClient: Cancellable {
1499
1675
)
1500
1676
}
1501
1677
}
1678
+
1679
+ func checkAvailability(
1680
+ registry: Registry ,
1681
+ timeout: DispatchTimeInterval ? = . none,
1682
+ observabilityScope: ObservabilityScope ,
1683
+ callbackQueue: DispatchQueue
1684
+ ) async throws -> AvailabilityStatus {
1685
+ try await safe_async {
1686
+ self . checkAvailability (
1687
+ registry: registry,
1688
+ timeout: timeout,
1689
+ observabilityScope: observabilityScope,
1690
+ callbackQueue: callbackQueue,
1691
+ completion: $0
1692
+ )
1693
+ }
1694
+ }
1502
1695
1503
1696
// marked internal for testing
1697
+ @available ( * , noasync, message: " Use the async alternative " )
1504
1698
func checkAvailability(
1505
1699
registry: Registry ,
1506
1700
timeout: DispatchTimeInterval ? = . none,
0 commit comments