Skip to content

Commit 1286f7d

Browse files
author
Firefox Sync Engineering
committed
Nightly auto-update (127.0.20240504050247)
1 parent 58334e3 commit 1286f7d

File tree

7 files changed

+128
-9
lines changed

7 files changed

+128
-9
lines changed

Package.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// swift-tools-version:5.4
22
import PackageDescription
33

4-
let checksum = "ce6c67d6f9415b6378071ce260d0a2112a6cedb056110788512b2077d86fbf36"
5-
let version = "127.0.20240503050236"
6-
let url = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.127.20240503050236/artifacts/public/build/MozillaRustComponents.xcframework.zip"
4+
let checksum = "33b578605914d25cbf0b6921ac28173c409ff29f473606fe9cd7bc33e579c7ec"
5+
let version = "127.0.20240504050247"
6+
let url = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.127.20240504050247/artifacts/public/build/MozillaRustComponents.xcframework.zip"
77

88
// Focus xcframework
9-
let focusChecksum = "8c00c56cbe6509654b571fcaa91a4f44bc5df58fe5135a8c60b4b402cce040fd"
10-
let focusUrl = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.127.20240503050236/artifacts/public/build/FocusRustComponents.xcframework.zip"
9+
let focusChecksum = "cbafeb387778c612dbdbb27e05e93592f8d3685f2d30bdbb6982ac0337f45f6b"
10+
let focusUrl = "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/project.application-services.v2.swift.127.20240504050247/artifacts/public/build/FocusRustComponents.xcframework.zip"
1111
let package = Package(
1212
name: "MozillaRustComponentsSwift",
1313
platforms: [.iOS(.v14)],

swift-source/all/FxAClient/FxAccountDeviceConstellation.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ public class DeviceConstellation {
9494
case let .sendTab(title, url): do {
9595
try self.account.sendSingleTab(targetDeviceId: targetDeviceId, title: title, url: url)
9696
}
97+
case let .closeTabs(urls):
98+
try self.account.closeTabs(targetDeviceId: targetDeviceId, urls: urls)
9799
}
98100
} catch {
99101
FxALog.error("Error sending event to another device: \(error).")
@@ -162,4 +164,5 @@ public class DeviceConstellation {
162164

163165
public enum DeviceEventOutgoing {
164166
case sendTab(title: String, url: String)
167+
case closeTabs(urls: [String])
165168
}

swift-source/all/FxAClient/PersistedFirefoxAccount.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ class PersistedFirefoxAccount {
189189
}
190190
}
191191

192+
public func closeTabs(targetDeviceId: String, urls: [String]) throws {
193+
return try notifyAuthErrors {
194+
try self.inner.closeTabs(targetDeviceId: targetDeviceId, urls: urls)
195+
}
196+
}
197+
192198
public func getTokenServerEndpointURL() throws -> URL {
193199
return try URL(string: inner.getTokenServerEndpointUrl())!
194200
}

swift-source/all/Generated/Metrics/Metrics.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// -*- mode: Swift -*-
22

3-
// AUTOGENERATED BY glean_parser v14.1.0. DO NOT EDIT. DO NOT COMMIT.
3+
// AUTOGENERATED BY glean_parser v14.1.1. DO NOT EDIT. DO NOT COMMIT.
44

55
#if canImport(Foundation)
66
import Foundation
@@ -23,7 +23,7 @@ extension GleanMetrics {
2323
// Intentionally left private, no external user can instantiate a new global object.
2424
}
2525

26-
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2024, month: 5, day: 3, hour: 5, minute: 16, second: 33))
26+
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2024, month: 5, day: 4, hour: 5, minute: 13, second: 8))
2727
}
2828

2929
enum NimbusEvents {

swift-source/all/Generated/fxa_client.swift

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,16 @@ public protocol FirefoxAccountProtocol: AnyObject {
465465

466466
func clearDeviceName() throws
467467

468+
/**
469+
* Use device commands to close one or more tabs on another device.
470+
*
471+
* **💾 This method alters the persisted account state.**
472+
*
473+
* If a device on the account has registered the [`CloseTabs`](DeviceCapability::CloseTabs)
474+
* capability, this method can be used to close its tabs.
475+
*/
476+
func closeTabs(targetDeviceId: String, urls: [String]) throws
477+
468478
func completeOauthFlow(code: String, state: String) throws
469479

470480
func disconnect()
@@ -624,6 +634,21 @@ open class FirefoxAccount:
624634
}
625635
}
626636

637+
/**
638+
* Use device commands to close one or more tabs on another device.
639+
*
640+
* **💾 This method alters the persisted account state.**
641+
*
642+
* If a device on the account has registered the [`CloseTabs`](DeviceCapability::CloseTabs)
643+
* capability, this method can be used to close its tabs.
644+
*/
645+
open func closeTabs(targetDeviceId: String, urls: [String]) throws { try rustCallWithError(FfiConverterTypeFxaError.lift) {
646+
uniffi_fxa_client_fn_method_firefoxaccount_close_tabs(self.uniffiClonePointer(),
647+
FfiConverterString.lower(targetDeviceId),
648+
FfiConverterSequenceString.lower(urls), $0)
649+
}
650+
}
651+
627652
open func completeOauthFlow(code: String, state: String) throws { try rustCallWithError(FfiConverterTypeFxaError.lift) {
628653
uniffi_fxa_client_fn_method_firefoxaccount_complete_oauth_flow(self.uniffiClonePointer(),
629654
FfiConverterString.lower(code),
@@ -1285,6 +1310,60 @@ public func FfiConverterTypeAuthorizationParameters_lower(_ value: Authorization
12851310
return FfiConverterTypeAuthorizationParameters.lower(value)
12861311
}
12871312

1313+
/**
1314+
* The payload sent when invoking a "close tabs" command.
1315+
*/
1316+
public struct CloseTabsPayload {
1317+
/**
1318+
* The URLs of the tabs to close.
1319+
*/
1320+
public var urls: [String]
1321+
1322+
// Default memberwise initializers are never public by default, so we
1323+
// declare one manually.
1324+
public init(
1325+
/**
1326+
* The URLs of the tabs to close.
1327+
*/ urls: [String]
1328+
) {
1329+
self.urls = urls
1330+
}
1331+
}
1332+
1333+
extension CloseTabsPayload: Equatable, Hashable {
1334+
public static func == (lhs: CloseTabsPayload, rhs: CloseTabsPayload) -> Bool {
1335+
if lhs.urls != rhs.urls {
1336+
return false
1337+
}
1338+
return true
1339+
}
1340+
1341+
public func hash(into hasher: inout Hasher) {
1342+
hasher.combine(urls)
1343+
}
1344+
}
1345+
1346+
public struct FfiConverterTypeCloseTabsPayload: FfiConverterRustBuffer {
1347+
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CloseTabsPayload {
1348+
return
1349+
try CloseTabsPayload(
1350+
urls: FfiConverterSequenceString.read(from: &buf)
1351+
)
1352+
}
1353+
1354+
public static func write(_ value: CloseTabsPayload, into buf: inout [UInt8]) {
1355+
FfiConverterSequenceString.write(value.urls, into: &buf)
1356+
}
1357+
}
1358+
1359+
public func FfiConverterTypeCloseTabsPayload_lift(_ buf: RustBuffer) throws -> CloseTabsPayload {
1360+
return try FfiConverterTypeCloseTabsPayload.lift(buf)
1361+
}
1362+
1363+
public func FfiConverterTypeCloseTabsPayload_lower(_ value: CloseTabsPayload) -> RustBuffer {
1364+
return FfiConverterTypeCloseTabsPayload.lower(value)
1365+
}
1366+
12881367
public struct Device {
12891368
public var id: String
12901369
public var displayName: String
@@ -2067,6 +2146,7 @@ extension AccountEvent: Equatable, Hashable {}
20672146

20682147
public enum DeviceCapability {
20692148
case sendTab
2149+
case closeTabs
20702150
}
20712151

20722152
public struct FfiConverterTypeDeviceCapability: FfiConverterRustBuffer {
@@ -2077,6 +2157,8 @@ public struct FfiConverterTypeDeviceCapability: FfiConverterRustBuffer {
20772157
switch variant {
20782158
case 1: return .sendTab
20792159

2160+
case 2: return .closeTabs
2161+
20802162
default: throw UniffiInternalError.unexpectedEnumCase
20812163
}
20822164
}
@@ -2085,6 +2167,9 @@ public struct FfiConverterTypeDeviceCapability: FfiConverterRustBuffer {
20852167
switch value {
20862168
case .sendTab:
20872169
writeInt(&buf, Int32(1))
2170+
2171+
case .closeTabs:
2172+
writeInt(&buf, Int32(2))
20882173
}
20892174
}
20902175
}
@@ -2678,6 +2763,10 @@ extension FxaStateCheckerState: Equatable, Hashable {}
26782763

26792764
public enum IncomingDeviceCommand {
26802765
case tabReceived(sender: Device?, payload: SendTabPayload)
2766+
/**
2767+
* Indicates that the sender wants to close one or more tabs on this device.
2768+
*/
2769+
case tabsClosed(sender: Device?, payload: CloseTabsPayload)
26812770
}
26822771

26832772
public struct FfiConverterTypeIncomingDeviceCommand: FfiConverterRustBuffer {
@@ -2688,6 +2777,8 @@ public struct FfiConverterTypeIncomingDeviceCommand: FfiConverterRustBuffer {
26882777
switch variant {
26892778
case 1: return try .tabReceived(sender: FfiConverterOptionTypeDevice.read(from: &buf), payload: FfiConverterTypeSendTabPayload.read(from: &buf))
26902779

2780+
case 2: return try .tabsClosed(sender: FfiConverterOptionTypeDevice.read(from: &buf), payload: FfiConverterTypeCloseTabsPayload.read(from: &buf))
2781+
26912782
default: throw UniffiInternalError.unexpectedEnumCase
26922783
}
26932784
}
@@ -2698,6 +2789,11 @@ public struct FfiConverterTypeIncomingDeviceCommand: FfiConverterRustBuffer {
26982789
writeInt(&buf, Int32(1))
26992790
FfiConverterOptionTypeDevice.write(sender, into: &buf)
27002791
FfiConverterTypeSendTabPayload.write(payload, into: &buf)
2792+
2793+
case let .tabsClosed(sender, payload):
2794+
writeInt(&buf, Int32(2))
2795+
FfiConverterOptionTypeDevice.write(sender, into: &buf)
2796+
FfiConverterTypeCloseTabsPayload.write(payload, into: &buf)
27012797
}
27022798
}
27032799
}
@@ -3004,6 +3100,9 @@ private var initializationResult: InitializationResult {
30043100
if uniffi_fxa_client_checksum_method_firefoxaccount_clear_device_name() != 42324 {
30053101
return InitializationResult.apiChecksumMismatch
30063102
}
3103+
if uniffi_fxa_client_checksum_method_firefoxaccount_close_tabs() != 64219 {
3104+
return InitializationResult.apiChecksumMismatch
3105+
}
30073106
if uniffi_fxa_client_checksum_method_firefoxaccount_complete_oauth_flow() != 41338 {
30083107
return InitializationResult.apiChecksumMismatch
30093108
}

swift-source/all/Generated/fxa_clientFFI.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,11 @@ void uniffi_fxa_client_fn_method_firefoxaccount_clear_access_token_cache(void*_N
301301
void uniffi_fxa_client_fn_method_firefoxaccount_clear_device_name(void*_Nonnull ptr, RustCallStatus *_Nonnull out_status
302302
);
303303
#endif
304+
#ifndef UNIFFI_FFIDEF_UNIFFI_FXA_CLIENT_FN_METHOD_FIREFOXACCOUNT_CLOSE_TABS
305+
#define UNIFFI_FFIDEF_UNIFFI_FXA_CLIENT_FN_METHOD_FIREFOXACCOUNT_CLOSE_TABS
306+
void uniffi_fxa_client_fn_method_firefoxaccount_close_tabs(void*_Nonnull ptr, RustBuffer target_device_id, RustBuffer urls, RustCallStatus *_Nonnull out_status
307+
);
308+
#endif
304309
#ifndef UNIFFI_FFIDEF_UNIFFI_FXA_CLIENT_FN_METHOD_FIREFOXACCOUNT_COMPLETE_OAUTH_FLOW
305310
#define UNIFFI_FFIDEF_UNIFFI_FXA_CLIENT_FN_METHOD_FIREFOXACCOUNT_COMPLETE_OAUTH_FLOW
306311
void uniffi_fxa_client_fn_method_firefoxaccount_complete_oauth_flow(void*_Nonnull ptr, RustBuffer code, RustBuffer state, RustCallStatus *_Nonnull out_status
@@ -806,6 +811,12 @@ uint16_t uniffi_fxa_client_checksum_method_firefoxaccount_clear_access_token_cac
806811
#define UNIFFI_FFIDEF_UNIFFI_FXA_CLIENT_CHECKSUM_METHOD_FIREFOXACCOUNT_CLEAR_DEVICE_NAME
807812
uint16_t uniffi_fxa_client_checksum_method_firefoxaccount_clear_device_name(void
808813

814+
);
815+
#endif
816+
#ifndef UNIFFI_FFIDEF_UNIFFI_FXA_CLIENT_CHECKSUM_METHOD_FIREFOXACCOUNT_CLOSE_TABS
817+
#define UNIFFI_FFIDEF_UNIFFI_FXA_CLIENT_CHECKSUM_METHOD_FIREFOXACCOUNT_CLOSE_TABS
818+
uint16_t uniffi_fxa_client_checksum_method_firefoxaccount_close_tabs(void
819+
809820
);
810821
#endif
811822
#ifndef UNIFFI_FFIDEF_UNIFFI_FXA_CLIENT_CHECKSUM_METHOD_FIREFOXACCOUNT_COMPLETE_OAUTH_FLOW

swift-source/focus/Generated/Metrics/Metrics.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// -*- mode: Swift -*-
22

3-
// AUTOGENERATED BY glean_parser v14.1.0. DO NOT EDIT. DO NOT COMMIT.
3+
// AUTOGENERATED BY glean_parser v14.1.1. DO NOT EDIT. DO NOT COMMIT.
44

55
#if canImport(Foundation)
66
import Foundation
@@ -23,7 +23,7 @@ extension GleanMetrics {
2323
// Intentionally left private, no external user can instantiate a new global object.
2424
}
2525

26-
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2024, month: 5, day: 3, hour: 5, minute: 16, second: 36))
26+
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2024, month: 5, day: 4, hour: 5, minute: 13, second: 10))
2727
}
2828

2929
enum NimbusEvents {

0 commit comments

Comments
 (0)