Skip to content

Commit

Permalink
Auto update with latest AS Release v93.2.2 (#61)
Browse files Browse the repository at this point in the history
* Updates Package.swift with v93.2.2 release

* Version 93.2.2

Co-authored-by: Firefox Sync Engineering <sync-team@mozilla.com>
  • Loading branch information
github-actions[bot] and Firefox Sync Engineering authored May 27, 2022
1 parent 4f949c9 commit 3ec042b
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 34 deletions.
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// swift-tools-version:5.4
import PackageDescription

let checksum = "ce42430c1f7150219ba4a37bd2e1565e80ec0b8befe807d5ecddc3a650a76629"
let version = "v93.2.1"
let checksum = "feae147a97201445d143922ecc68ee06c73e08f5724be958f1f685e857a9dfd7"
let version = "v93.2.2"
let url = "https://github.com/mozilla/application-services/releases/download/\(version)/MozillaRustComponents.xcframework.zip"

// Focus xcframework
let focusChecksum = "979ce87a0552c6de1e22f48a77565e8c1c8cf3779ca0f662a27e199f5c47ec3f"
let focusChecksum = "2a21efea97f3066bc8f2b5f6f4ad725cb43457b3e7be1eac3ebd98edac97f92f"
let focusUrl = "https://github.com/mozilla/application-services/releases/download/\(version)/FocusRustComponents.xcframework.zip"
let package = Package(
name: "MozillaRustComponentsSwift",
Expand Down
2 changes: 1 addition & 1 deletion swift-source/all/Generated/Metrics/Metrics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extension GleanMetrics {
// Intentionally left private, no external user can instantiate a new global object.
}

public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2022, month: 5, day: 26, hour: 15, minute: 8, second: 49))
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2022, month: 5, day: 27, hour: 20, minute: 7, second: 43))
}

enum NimbusEvents {
Expand Down
40 changes: 25 additions & 15 deletions swift-source/all/Generated/tabs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ private extension RustBuffer {
}

static func from(_ ptr: UnsafeBufferPointer<UInt8>) -> RustBuffer {
try! rustCall { ffi_tabs_1245_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
try! rustCall { ffi_tabs_60f6_rustbuffer_from_bytes(ForeignBytes(bufferPointer: ptr), $0) }
}

// Frees the buffer in place.
// The buffer must not be used after this is called.
func deallocate() {
try! rustCall { ffi_tabs_1245_rustbuffer_free(self, $0) }
try! rustCall { ffi_tabs_60f6_rustbuffer_free(self, $0) }
}
}

Expand Down Expand Up @@ -362,52 +362,52 @@ public class TabsStore: TabsStoreProtocol {
self.init(unsafeFromRawPointer: try!

rustCall {
tabs_1245_TabsStore_new(
tabs_60f6_TabsStore_new(
FfiConverterString.lower(path), $0
)
})
}

deinit {
try! rustCall { ffi_tabs_1245_TabsStore_object_free(pointer, $0) }
try! rustCall { ffi_tabs_60f6_TabsStore_object_free(pointer, $0) }
}

public func getAll() -> [ClientRemoteTabs] {
return try! FfiConverterSequenceTypeClientRemoteTabs.lift(
try!
rustCall {
tabs_1245_TabsStore_get_all(self.pointer, $0)
tabs_60f6_TabsStore_get_all(self.pointer, $0)
}
)
}

public func setLocalTabs(remoteTabs: [RemoteTabRecord]) {
try!
rustCall {
tabs_1245_TabsStore_set_local_tabs(self.pointer,
tabs_60f6_TabsStore_set_local_tabs(self.pointer,
FfiConverterSequenceTypeRemoteTabRecord.lower(remoteTabs), $0)
}
}

public func registerWithSyncManager() {
try!
rustCall {
tabs_1245_TabsStore_register_with_sync_manager(self.pointer, $0)
tabs_60f6_TabsStore_register_with_sync_manager(self.pointer, $0)
}
}

public func reset() throws {
try
rustCallWithError(FfiConverterTypeTabsError.self) {
tabs_1245_TabsStore_reset(self.pointer, $0)
tabs_60f6_TabsStore_reset(self.pointer, $0)
}
}

public func sync(keyId: String, accessToken: String, syncKey: String, tokenserverUrl: String, localId: String) throws -> String {
return try FfiConverterString.lift(
try
rustCallWithError(FfiConverterTypeTabsError.self) {
tabs_1245_TabsStore_sync(self.pointer,
tabs_60f6_TabsStore_sync(self.pointer,
FfiConverterString.lower(keyId),
FfiConverterString.lower(accessToken),
FfiConverterString.lower(syncKey),
Expand Down Expand Up @@ -576,6 +576,9 @@ public enum TabsError {
// Simple error enums only carry a message
case JsonError(message: String)

// Simple error enums only carry a message
case MissingLocalIdError(message: String)

// Simple error enums only carry a message
case UrlParseError(message: String)

Expand Down Expand Up @@ -604,15 +607,19 @@ private struct FfiConverterTypeTabsError: FfiConverterRustBuffer {
message: try FfiConverterString.read(from: buf)
)

case 4: return .UrlParseError(
case 4: return .MissingLocalIdError(
message: try FfiConverterString.read(from: buf)
)

case 5: return .UrlParseError(
message: try FfiConverterString.read(from: buf)
)

case 5: return .SqlError(
case 6: return .SqlError(
message: try FfiConverterString.read(from: buf)
)

case 6: return .OpenDatabaseError(
case 7: return .OpenDatabaseError(
message: try FfiConverterString.read(from: buf)
)

Expand All @@ -631,15 +638,18 @@ private struct FfiConverterTypeTabsError: FfiConverterRustBuffer {
case let .JsonError(message):
buf.writeInt(Int32(3))
FfiConverterString.write(message, into: buf)
case let .UrlParseError(message):
case let .MissingLocalIdError(message):
buf.writeInt(Int32(4))
FfiConverterString.write(message, into: buf)
case let .SqlError(message):
case let .UrlParseError(message):
buf.writeInt(Int32(5))
FfiConverterString.write(message, into: buf)
case let .OpenDatabaseError(message):
case let .SqlError(message):
buf.writeInt(Int32(6))
FfiConverterString.write(message, into: buf)
case let .OpenDatabaseError(message):
buf.writeInt(Int32(7))
FfiConverterString.write(message, into: buf)
}
}
}
Expand Down
22 changes: 11 additions & 11 deletions swift-source/all/Generated/tabsFFI.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,47 +46,47 @@ typedef struct RustCallStatus {
// ⚠️ increment the version suffix in all instances of UNIFFI_SHARED_HEADER_V4 in this file. ⚠️
#endif // def UNIFFI_SHARED_H

void ffi_tabs_1245_TabsStore_object_free(
void ffi_tabs_60f6_TabsStore_object_free(
void*_Nonnull ptr,
RustCallStatus *_Nonnull out_status
);
void*_Nonnull tabs_1245_TabsStore_new(
void*_Nonnull tabs_60f6_TabsStore_new(
RustBuffer path,
RustCallStatus *_Nonnull out_status
);
RustBuffer tabs_1245_TabsStore_get_all(
RustBuffer tabs_60f6_TabsStore_get_all(
void*_Nonnull ptr,
RustCallStatus *_Nonnull out_status
);
void tabs_1245_TabsStore_set_local_tabs(
void tabs_60f6_TabsStore_set_local_tabs(
void*_Nonnull ptr,RustBuffer remote_tabs,
RustCallStatus *_Nonnull out_status
);
void tabs_1245_TabsStore_register_with_sync_manager(
void tabs_60f6_TabsStore_register_with_sync_manager(
void*_Nonnull ptr,
RustCallStatus *_Nonnull out_status
);
void tabs_1245_TabsStore_reset(
void tabs_60f6_TabsStore_reset(
void*_Nonnull ptr,
RustCallStatus *_Nonnull out_status
);
RustBuffer tabs_1245_TabsStore_sync(
RustBuffer tabs_60f6_TabsStore_sync(
void*_Nonnull ptr,RustBuffer key_id,RustBuffer access_token,RustBuffer sync_key,RustBuffer tokenserver_url,RustBuffer local_id,
RustCallStatus *_Nonnull out_status
);
RustBuffer ffi_tabs_1245_rustbuffer_alloc(
RustBuffer ffi_tabs_60f6_rustbuffer_alloc(
int32_t size,
RustCallStatus *_Nonnull out_status
);
RustBuffer ffi_tabs_1245_rustbuffer_from_bytes(
RustBuffer ffi_tabs_60f6_rustbuffer_from_bytes(
ForeignBytes bytes,
RustCallStatus *_Nonnull out_status
);
void ffi_tabs_1245_rustbuffer_free(
void ffi_tabs_60f6_rustbuffer_free(
RustBuffer buf,
RustCallStatus *_Nonnull out_status
);
RustBuffer ffi_tabs_1245_rustbuffer_reserve(
RustBuffer ffi_tabs_60f6_rustbuffer_reserve(
RustBuffer buf,int32_t additional,
RustCallStatus *_Nonnull out_status
);
4 changes: 2 additions & 2 deletions swift-source/all/SyncUnlockInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ open class SyncUnlockInfo {
public var syncKey: String
public var tokenserverURL: String
public var loginEncryptionKey: String
public var tabsLocalId: String
public var tabsLocalId: String?

public init(kid: String, fxaAccessToken: String, syncKey: String, tokenserverURL: String, loginEncryptionKey: String, tabsLocalId: String) {
public init(kid: String, fxaAccessToken: String, syncKey: String, tokenserverURL: String, loginEncryptionKey: String, tabsLocalId: String? = nil) {
self.kid = kid
self.fxaAccessToken = fxaAccessToken
self.syncKey = syncKey
Expand Down
6 changes: 5 additions & 1 deletion swift-source/all/Tabs/Tabs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@ open class TabsStorage {
}

open func sync(unlockInfo: SyncUnlockInfo) throws -> String {
guard let tabsLocalId = unlockInfo.tabsLocalId else {
throw TabsError.MissingLocalIdError(message: "tabs local ID was not provided")
}

return try queue.sync {
return try self.store
.sync(
keyId: unlockInfo.kid,
accessToken: unlockInfo.fxaAccessToken,
syncKey: unlockInfo.syncKey,
tokenserverUrl: unlockInfo.tokenserverURL,
localId: unlockInfo.tabsLocalId
localId: tabsLocalId
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion swift-source/focus/Generated/Metrics/Metrics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extension GleanMetrics {
// Intentionally left private, no external user can instantiate a new global object.
}

public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2022, month: 5, day: 26, hour: 15, minute: 12, second: 40))
public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2022, month: 5, day: 27, hour: 20, minute: 10, second: 7))
}

enum NimbusEvents {
Expand Down

0 comments on commit 3ec042b

Please sign in to comment.