diff --git a/Frameworks/Bindings.txt b/Frameworks/Bindings.txt index abefa3d76d3d78893e07f970b43adf4b3de67953..71d4cdcc695cfa1f74475cb87bf938d990484b98 100644 --- a/Frameworks/Bindings.txt +++ b/Frameworks/Bindings.txt @@ -1,4 +1,4 @@ -https://git.xx.network/elixxir/client/-/commit/a3ffe7a64ae4dd92739db291eede0353a5366551 +https://git.xx.network/elixxir/client/-/commit/12144ff4fa0bb0bf0308094c1353033cc75af3a0 go version go1.17.13 darwin/arm64 Xcode 13.4.1 Build version 13F100 gomobile bind target: ios,iossimulator,macos diff --git a/Frameworks/Bindings.xcframework/Info.plist b/Frameworks/Bindings.xcframework/Info.plist index 1e6b67e7e5ab26303902b1288f432c61b61a6f28..ab0338a02ded757edb59566001da4efa827302aa 100644 --- a/Frameworks/Bindings.xcframework/Info.plist +++ b/Frameworks/Bindings.xcframework/Info.plist @@ -18,7 +18,7 @@ </dict> <dict> <key>LibraryIdentifier</key> - <string>ios-arm64_x86_64-simulator</string> + <string>macos-arm64_x86_64</string> <key>LibraryPath</key> <string>Bindings.framework</string> <key>SupportedArchitectures</key> @@ -27,13 +27,11 @@ <string>x86_64</string> </array> <key>SupportedPlatform</key> - <string>ios</string> - <key>SupportedPlatformVariant</key> - <string>simulator</string> + <string>macos</string> </dict> <dict> <key>LibraryIdentifier</key> - <string>macos-arm64_x86_64</string> + <string>ios-arm64_x86_64-simulator</string> <key>LibraryPath</key> <string>Bindings.framework</string> <key>SupportedArchitectures</key> @@ -42,7 +40,9 @@ <string>x86_64</string> </array> <key>SupportedPlatform</key> - <string>macos</string> + <string>ios</string> + <key>SupportedPlatformVariant</key> + <string>simulator</string> </dict> </array> <key>CFBundlePackageType</key> diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings index 4b12ea6fae25a8c97dbc64956836e59af6b937e9..8bbfe7e9f322e837ec6665ffd1ea4a478a98133b 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h index 5d794b630d29654c2d7f48ca38792a9745cb0ddc..1d32aaf959f293467ac499bdc8cd5dd39fabc980 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h @@ -298,9 +298,11 @@ Example BackupReport: /** * BroadcastMessage is the bindings representation of a broadcast message. -Example JSON: - {"RoundID":42, +BroadcastMessage Example JSON: + { + "RoundID":42, "EphID":[0,0,0,0,0,0,24,61], + "RoundURL":"https://dashboard.xx.network/rounds/25?xxmessenger=true", "Payload":"SGVsbG8sIGJyb2FkY2FzdCBmcmllbmRzIQ==" } */ @@ -320,9 +322,11 @@ Example JSON: * BroadcastReport is the bindings representation of the info on how a broadcast message was sent -Example JSON: - {"RoundID":42, - "EphID":[0,0,0,0,0,0,24,61] +BroadcastReport Example JSON: + { + "Rounds": [25, 26, 29], + "EphID":[0,0,0,0,0,0,24,61], + "RoundURL":"https://dashboard.xx.network/rounds/25?xxmessenger=true" } */ @interface BindingsBroadcastReport : NSObject <goSeqRefInterface> { @@ -333,6 +337,7 @@ Example JSON: - (nonnull instancetype)init; // skipped field BroadcastReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; // skipped field BroadcastReport.EphID with unsupported type: gitlab.com/xx_network/primitives/id/ephemeral.Id - (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @@ -697,13 +702,14 @@ Returns: * E2ESendReport is the bindings' representation of the return values of SendE2E. -Example E2ESendReport: -{ -"Rounds": [ 1, 4, 9], -"MessageID": "iM34yCIr4Je8ZIzL9iAAG1UWAeDiHybxMTioMAaezvs=", -"Timestamp": 1661532254302612000, -"KeyResidue": "9q2/A69EAuFM1hFAT7Bzy5uGOQ4T6bPFF72h5PlgCWE=" -} +E2ESendReport Example JSON: + { + "Rounds": [ 1, 4, 9], + "RoundURL":"https://dashboard.xx.network/rounds/25?xxmessenger=true", + "MessageID": "iM34yCIr4Je8ZIzL9iAAG1UWAeDiHybxMTioMAaezvs=", + "Timestamp": 1661532254302612000, + "KeyResidue": "9q2/A69EAuFM1hFAT7Bzy5uGOQ4T6bPFF72h5PlgCWE=" + } */ @interface BindingsE2ESendReport : NSObject <goSeqRefInterface> { } @@ -713,6 +719,7 @@ Example E2ESendReport: - (nonnull instancetype)init; // skipped field E2ESendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) NSData* _Nullable messageID; @property (nonatomic) int64_t timestamp; @property (nonatomic) NSData* _Nullable keyResidue; @@ -1346,6 +1353,14 @@ Returns: * GroupReport is returned when creating a new group and contains the ID of the group, a list of rounds that the group requests were sent on, and the status of the send operation. + +Example GroupReport JSON: + { + "Id": "AAAAAAAAAM0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE", + "Rounds": [25, 64], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", + "Status": 1 + } */ @interface BindingsGroupReport : NSObject <goSeqRefInterface> { } @@ -1356,6 +1371,7 @@ status of the send operation. @property (nonatomic) NSData* _Nullable id_; // skipped field GroupReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) long status; - (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end @@ -1363,6 +1379,14 @@ status of the send operation. /** * GroupSendReport is returned when sending a group message. It contains the round ID sent on and the timestamp of the send operation. + +Example GroupSendReport JSON: + { + "Rounds": [25, 64], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", + "Timestamp": 1662577352813112000, + "MessageID": "69ug6FA50UT2q6MWH3hne9PkHQ+H9DnEDsBhc0m0Aww=" + } */ @interface BindingsGroupSendReport : NSObject <goSeqRefInterface> { } @@ -1372,6 +1396,7 @@ round ID sent on and the timestamp of the send operation. - (nonnull instancetype)init; // skipped field GroupSendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) int64_t timestamp; @property (nonatomic) NSData* _Nullable messageID; - (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @@ -1579,7 +1604,7 @@ JSON example: /** * RoundsList contains a list of round IDs. -Example marshalled roundList object: +JSON Example: [1001,1003,1006] */ @interface BindingsRoundsList : NSObject <goSeqRefInterface> { @@ -1600,14 +1625,15 @@ Example marshalled roundList object: * SingleUseCallbackReport is the bindings-layer struct used to represent single -use messages received by a callback passed into single.Listen. -JSON example: - { - "Rounds":[1,5,9], - "Payload":"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==", - "Partner":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD", - "EphID":1655533, - "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"} - } +SingleUseCallbackReport JSON example: + { + "Rounds":[1,5,9], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", + "Payload":"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==", + "Partner":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD", + "EphID":1655533, + "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"} + } */ @interface BindingsSingleUseCallbackReport : NSObject <goSeqRefInterface> { } @@ -1617,6 +1643,7 @@ JSON example: - (nonnull instancetype)init; // skipped field SingleUseCallbackReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) NSData* _Nullable payload; // skipped field SingleUseCallbackReport.Partner with unsupported type: *gitlab.com/xx_network/primitives/id.ID @@ -1631,9 +1658,10 @@ JSON example: information passed to the single.Response callback interface in response to single.TransmitRequest. -JSON example: +SingleUseResponseReport JSON example: { "Rounds":[1,5,9], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", "Payload":"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==", "EphID":1655533, "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"}, @@ -1648,6 +1676,7 @@ JSON example: - (nonnull instancetype)init; // skipped field SingleUseResponseReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) NSData* _Nullable payload; // skipped field SingleUseResponseReport.ReceptionID with unsupported type: *gitlab.com/xx_network/primitives/id.ID @@ -1660,9 +1689,10 @@ JSON example: * SingleUseSendReport is the bindings-layer struct used to represent information returned by single.TransmitRequest. -JSON example: +SingleUseSendReport JSON example: { "Rounds":[1,5,9], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", "EphID":1655533, "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"} } @@ -1675,6 +1705,7 @@ JSON example: - (nonnull instancetype)init; // skipped field SingleUseSendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; // skipped field SingleUseSendReport.ReceptionID with unsupported type: *gitlab.com/xx_network/primitives/id.ID @property (nonatomic) int64_t ephID; @@ -2268,6 +2299,19 @@ Returns: */ FOUNDATION_EXPORT NSData* _Nullable BindingsSearchUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdSearchCallback> _Nullable cb, NSData* _Nullable factListJSON, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); +/** + * SetDashboardURL is a function which modifies the base dashboard URL +that is returned as part of any send report. Internally, this is defaulted +to "https://dashboard.xx.network". This should only be called if the user +explicitly wants to modify the dashboard URL. This function is not +thread-safe, and as such should only be called on setup. + +Parameters: + - newURL - A valid URL that will be used for round look up on any send + report. + */ +FOUNDATION_EXPORT void BindingsSetDashboardURL(NSString* _Nullable newURL); + /** * SetFactsOnContact replaces the facts on the contact with the passed in facts pass in empty facts in order to clear the facts. diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings index b43201b5eb4033863f2b69e56e634b3b7a5ca117..0409f2c54516429447f076c565e9682988e099b1 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h index 5d794b630d29654c2d7f48ca38792a9745cb0ddc..1d32aaf959f293467ac499bdc8cd5dd39fabc980 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h @@ -298,9 +298,11 @@ Example BackupReport: /** * BroadcastMessage is the bindings representation of a broadcast message. -Example JSON: - {"RoundID":42, +BroadcastMessage Example JSON: + { + "RoundID":42, "EphID":[0,0,0,0,0,0,24,61], + "RoundURL":"https://dashboard.xx.network/rounds/25?xxmessenger=true", "Payload":"SGVsbG8sIGJyb2FkY2FzdCBmcmllbmRzIQ==" } */ @@ -320,9 +322,11 @@ Example JSON: * BroadcastReport is the bindings representation of the info on how a broadcast message was sent -Example JSON: - {"RoundID":42, - "EphID":[0,0,0,0,0,0,24,61] +BroadcastReport Example JSON: + { + "Rounds": [25, 26, 29], + "EphID":[0,0,0,0,0,0,24,61], + "RoundURL":"https://dashboard.xx.network/rounds/25?xxmessenger=true" } */ @interface BindingsBroadcastReport : NSObject <goSeqRefInterface> { @@ -333,6 +337,7 @@ Example JSON: - (nonnull instancetype)init; // skipped field BroadcastReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; // skipped field BroadcastReport.EphID with unsupported type: gitlab.com/xx_network/primitives/id/ephemeral.Id - (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @@ -697,13 +702,14 @@ Returns: * E2ESendReport is the bindings' representation of the return values of SendE2E. -Example E2ESendReport: -{ -"Rounds": [ 1, 4, 9], -"MessageID": "iM34yCIr4Je8ZIzL9iAAG1UWAeDiHybxMTioMAaezvs=", -"Timestamp": 1661532254302612000, -"KeyResidue": "9q2/A69EAuFM1hFAT7Bzy5uGOQ4T6bPFF72h5PlgCWE=" -} +E2ESendReport Example JSON: + { + "Rounds": [ 1, 4, 9], + "RoundURL":"https://dashboard.xx.network/rounds/25?xxmessenger=true", + "MessageID": "iM34yCIr4Je8ZIzL9iAAG1UWAeDiHybxMTioMAaezvs=", + "Timestamp": 1661532254302612000, + "KeyResidue": "9q2/A69EAuFM1hFAT7Bzy5uGOQ4T6bPFF72h5PlgCWE=" + } */ @interface BindingsE2ESendReport : NSObject <goSeqRefInterface> { } @@ -713,6 +719,7 @@ Example E2ESendReport: - (nonnull instancetype)init; // skipped field E2ESendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) NSData* _Nullable messageID; @property (nonatomic) int64_t timestamp; @property (nonatomic) NSData* _Nullable keyResidue; @@ -1346,6 +1353,14 @@ Returns: * GroupReport is returned when creating a new group and contains the ID of the group, a list of rounds that the group requests were sent on, and the status of the send operation. + +Example GroupReport JSON: + { + "Id": "AAAAAAAAAM0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE", + "Rounds": [25, 64], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", + "Status": 1 + } */ @interface BindingsGroupReport : NSObject <goSeqRefInterface> { } @@ -1356,6 +1371,7 @@ status of the send operation. @property (nonatomic) NSData* _Nullable id_; // skipped field GroupReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) long status; - (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end @@ -1363,6 +1379,14 @@ status of the send operation. /** * GroupSendReport is returned when sending a group message. It contains the round ID sent on and the timestamp of the send operation. + +Example GroupSendReport JSON: + { + "Rounds": [25, 64], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", + "Timestamp": 1662577352813112000, + "MessageID": "69ug6FA50UT2q6MWH3hne9PkHQ+H9DnEDsBhc0m0Aww=" + } */ @interface BindingsGroupSendReport : NSObject <goSeqRefInterface> { } @@ -1372,6 +1396,7 @@ round ID sent on and the timestamp of the send operation. - (nonnull instancetype)init; // skipped field GroupSendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) int64_t timestamp; @property (nonatomic) NSData* _Nullable messageID; - (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @@ -1579,7 +1604,7 @@ JSON example: /** * RoundsList contains a list of round IDs. -Example marshalled roundList object: +JSON Example: [1001,1003,1006] */ @interface BindingsRoundsList : NSObject <goSeqRefInterface> { @@ -1600,14 +1625,15 @@ Example marshalled roundList object: * SingleUseCallbackReport is the bindings-layer struct used to represent single -use messages received by a callback passed into single.Listen. -JSON example: - { - "Rounds":[1,5,9], - "Payload":"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==", - "Partner":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD", - "EphID":1655533, - "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"} - } +SingleUseCallbackReport JSON example: + { + "Rounds":[1,5,9], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", + "Payload":"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==", + "Partner":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD", + "EphID":1655533, + "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"} + } */ @interface BindingsSingleUseCallbackReport : NSObject <goSeqRefInterface> { } @@ -1617,6 +1643,7 @@ JSON example: - (nonnull instancetype)init; // skipped field SingleUseCallbackReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) NSData* _Nullable payload; // skipped field SingleUseCallbackReport.Partner with unsupported type: *gitlab.com/xx_network/primitives/id.ID @@ -1631,9 +1658,10 @@ JSON example: information passed to the single.Response callback interface in response to single.TransmitRequest. -JSON example: +SingleUseResponseReport JSON example: { "Rounds":[1,5,9], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", "Payload":"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==", "EphID":1655533, "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"}, @@ -1648,6 +1676,7 @@ JSON example: - (nonnull instancetype)init; // skipped field SingleUseResponseReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) NSData* _Nullable payload; // skipped field SingleUseResponseReport.ReceptionID with unsupported type: *gitlab.com/xx_network/primitives/id.ID @@ -1660,9 +1689,10 @@ JSON example: * SingleUseSendReport is the bindings-layer struct used to represent information returned by single.TransmitRequest. -JSON example: +SingleUseSendReport JSON example: { "Rounds":[1,5,9], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", "EphID":1655533, "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"} } @@ -1675,6 +1705,7 @@ JSON example: - (nonnull instancetype)init; // skipped field SingleUseSendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; // skipped field SingleUseSendReport.ReceptionID with unsupported type: *gitlab.com/xx_network/primitives/id.ID @property (nonatomic) int64_t ephID; @@ -2268,6 +2299,19 @@ Returns: */ FOUNDATION_EXPORT NSData* _Nullable BindingsSearchUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdSearchCallback> _Nullable cb, NSData* _Nullable factListJSON, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); +/** + * SetDashboardURL is a function which modifies the base dashboard URL +that is returned as part of any send report. Internally, this is defaulted +to "https://dashboard.xx.network". This should only be called if the user +explicitly wants to modify the dashboard URL. This function is not +thread-safe, and as such should only be called on setup. + +Parameters: + - newURL - A valid URL that will be used for round look up on any send + report. + */ +FOUNDATION_EXPORT void BindingsSetDashboardURL(NSString* _Nullable newURL); + /** * SetFactsOnContact replaces the facts on the contact with the passed in facts pass in empty facts in order to clear the facts. diff --git a/Frameworks/Bindings.xcframework/macos-arm64_x86_64/Bindings.framework/Versions/A/Bindings b/Frameworks/Bindings.xcframework/macos-arm64_x86_64/Bindings.framework/Versions/A/Bindings index 8ccbabd6f164766ec582b23221e997bc34ed7593..d59df29aaa7b4f2d93a378b4c129b1a5069ef869 100644 Binary files a/Frameworks/Bindings.xcframework/macos-arm64_x86_64/Bindings.framework/Versions/A/Bindings and b/Frameworks/Bindings.xcframework/macos-arm64_x86_64/Bindings.framework/Versions/A/Bindings differ diff --git a/Frameworks/Bindings.xcframework/macos-arm64_x86_64/Bindings.framework/Versions/A/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/macos-arm64_x86_64/Bindings.framework/Versions/A/Headers/Bindings.objc.h index 5d794b630d29654c2d7f48ca38792a9745cb0ddc..1d32aaf959f293467ac499bdc8cd5dd39fabc980 100644 --- a/Frameworks/Bindings.xcframework/macos-arm64_x86_64/Bindings.framework/Versions/A/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/macos-arm64_x86_64/Bindings.framework/Versions/A/Headers/Bindings.objc.h @@ -298,9 +298,11 @@ Example BackupReport: /** * BroadcastMessage is the bindings representation of a broadcast message. -Example JSON: - {"RoundID":42, +BroadcastMessage Example JSON: + { + "RoundID":42, "EphID":[0,0,0,0,0,0,24,61], + "RoundURL":"https://dashboard.xx.network/rounds/25?xxmessenger=true", "Payload":"SGVsbG8sIGJyb2FkY2FzdCBmcmllbmRzIQ==" } */ @@ -320,9 +322,11 @@ Example JSON: * BroadcastReport is the bindings representation of the info on how a broadcast message was sent -Example JSON: - {"RoundID":42, - "EphID":[0,0,0,0,0,0,24,61] +BroadcastReport Example JSON: + { + "Rounds": [25, 26, 29], + "EphID":[0,0,0,0,0,0,24,61], + "RoundURL":"https://dashboard.xx.network/rounds/25?xxmessenger=true" } */ @interface BindingsBroadcastReport : NSObject <goSeqRefInterface> { @@ -333,6 +337,7 @@ Example JSON: - (nonnull instancetype)init; // skipped field BroadcastReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; // skipped field BroadcastReport.EphID with unsupported type: gitlab.com/xx_network/primitives/id/ephemeral.Id - (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @@ -697,13 +702,14 @@ Returns: * E2ESendReport is the bindings' representation of the return values of SendE2E. -Example E2ESendReport: -{ -"Rounds": [ 1, 4, 9], -"MessageID": "iM34yCIr4Je8ZIzL9iAAG1UWAeDiHybxMTioMAaezvs=", -"Timestamp": 1661532254302612000, -"KeyResidue": "9q2/A69EAuFM1hFAT7Bzy5uGOQ4T6bPFF72h5PlgCWE=" -} +E2ESendReport Example JSON: + { + "Rounds": [ 1, 4, 9], + "RoundURL":"https://dashboard.xx.network/rounds/25?xxmessenger=true", + "MessageID": "iM34yCIr4Je8ZIzL9iAAG1UWAeDiHybxMTioMAaezvs=", + "Timestamp": 1661532254302612000, + "KeyResidue": "9q2/A69EAuFM1hFAT7Bzy5uGOQ4T6bPFF72h5PlgCWE=" + } */ @interface BindingsE2ESendReport : NSObject <goSeqRefInterface> { } @@ -713,6 +719,7 @@ Example E2ESendReport: - (nonnull instancetype)init; // skipped field E2ESendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) NSData* _Nullable messageID; @property (nonatomic) int64_t timestamp; @property (nonatomic) NSData* _Nullable keyResidue; @@ -1346,6 +1353,14 @@ Returns: * GroupReport is returned when creating a new group and contains the ID of the group, a list of rounds that the group requests were sent on, and the status of the send operation. + +Example GroupReport JSON: + { + "Id": "AAAAAAAAAM0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE", + "Rounds": [25, 64], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", + "Status": 1 + } */ @interface BindingsGroupReport : NSObject <goSeqRefInterface> { } @@ -1356,6 +1371,7 @@ status of the send operation. @property (nonatomic) NSData* _Nullable id_; // skipped field GroupReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) long status; - (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end @@ -1363,6 +1379,14 @@ status of the send operation. /** * GroupSendReport is returned when sending a group message. It contains the round ID sent on and the timestamp of the send operation. + +Example GroupSendReport JSON: + { + "Rounds": [25, 64], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", + "Timestamp": 1662577352813112000, + "MessageID": "69ug6FA50UT2q6MWH3hne9PkHQ+H9DnEDsBhc0m0Aww=" + } */ @interface BindingsGroupSendReport : NSObject <goSeqRefInterface> { } @@ -1372,6 +1396,7 @@ round ID sent on and the timestamp of the send operation. - (nonnull instancetype)init; // skipped field GroupSendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) int64_t timestamp; @property (nonatomic) NSData* _Nullable messageID; - (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @@ -1579,7 +1604,7 @@ JSON example: /** * RoundsList contains a list of round IDs. -Example marshalled roundList object: +JSON Example: [1001,1003,1006] */ @interface BindingsRoundsList : NSObject <goSeqRefInterface> { @@ -1600,14 +1625,15 @@ Example marshalled roundList object: * SingleUseCallbackReport is the bindings-layer struct used to represent single -use messages received by a callback passed into single.Listen. -JSON example: - { - "Rounds":[1,5,9], - "Payload":"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==", - "Partner":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD", - "EphID":1655533, - "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"} - } +SingleUseCallbackReport JSON example: + { + "Rounds":[1,5,9], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", + "Payload":"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==", + "Partner":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD", + "EphID":1655533, + "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"} + } */ @interface BindingsSingleUseCallbackReport : NSObject <goSeqRefInterface> { } @@ -1617,6 +1643,7 @@ JSON example: - (nonnull instancetype)init; // skipped field SingleUseCallbackReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) NSData* _Nullable payload; // skipped field SingleUseCallbackReport.Partner with unsupported type: *gitlab.com/xx_network/primitives/id.ID @@ -1631,9 +1658,10 @@ JSON example: information passed to the single.Response callback interface in response to single.TransmitRequest. -JSON example: +SingleUseResponseReport JSON example: { "Rounds":[1,5,9], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", "Payload":"rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==", "EphID":1655533, "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"}, @@ -1648,6 +1676,7 @@ JSON example: - (nonnull instancetype)init; // skipped field SingleUseResponseReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; @property (nonatomic) NSData* _Nullable payload; // skipped field SingleUseResponseReport.ReceptionID with unsupported type: *gitlab.com/xx_network/primitives/id.ID @@ -1660,9 +1689,10 @@ JSON example: * SingleUseSendReport is the bindings-layer struct used to represent information returned by single.TransmitRequest. -JSON example: +SingleUseSendReport JSON example: { "Rounds":[1,5,9], + "RoundURL": "https://dashboard.xx.network/rounds/25?xxmessenger=true", "EphID":1655533, "ReceptionID":"emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD"} } @@ -1675,6 +1705,7 @@ JSON example: - (nonnull instancetype)init; // skipped field SingleUseSendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList +@property (nonatomic) NSString* _Nonnull roundURL; // skipped field SingleUseSendReport.ReceptionID with unsupported type: *gitlab.com/xx_network/primitives/id.ID @property (nonatomic) int64_t ephID; @@ -2268,6 +2299,19 @@ Returns: */ FOUNDATION_EXPORT NSData* _Nullable BindingsSearchUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdSearchCallback> _Nullable cb, NSData* _Nullable factListJSON, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); +/** + * SetDashboardURL is a function which modifies the base dashboard URL +that is returned as part of any send report. Internally, this is defaulted +to "https://dashboard.xx.network". This should only be called if the user +explicitly wants to modify the dashboard URL. This function is not +thread-safe, and as such should only be called on setup. + +Parameters: + - newURL - A valid URL that will be used for round look up on any send + report. + */ +FOUNDATION_EXPORT void BindingsSetDashboardURL(NSString* _Nullable newURL); + /** * SetFactsOnContact replaces the facts on the contact with the passed in facts pass in empty facts in order to clear the facts. diff --git a/Sources/XXClient/Functions/SetDashboardURL.swift b/Sources/XXClient/Functions/SetDashboardURL.swift new file mode 100644 index 0000000000000000000000000000000000000000..f76c23377e3c35df2d3143fc6bf6e09dbc72d21f --- /dev/null +++ b/Sources/XXClient/Functions/SetDashboardURL.swift @@ -0,0 +1,22 @@ +import Bindings +import XCTestDynamicOverlay + +public struct SetDashboardURL { + public var run: (String) -> Void + + public func callAsFunction(baseURL: String) { + run(baseURL) + } +} + +extension SetDashboardURL { + public static let live = SetDashboardURL { baseURL in + BindingsSetDashboardURL(baseURL) + } +} + +extension SetDashboardURL { + public static let unimplemented = SetDashboardURL( + run: XCTUnimplemented("\(Self.self)") + ) +} diff --git a/Sources/XXClient/Models/BroadcastMessage.swift b/Sources/XXClient/Models/BroadcastMessage.swift index 19f311835766b1c95e3225b956d84b34c71cec1f..3d4520bf94ed98026b276229407689a4823e8516 100644 --- a/Sources/XXClient/Models/BroadcastMessage.swift +++ b/Sources/XXClient/Models/BroadcastMessage.swift @@ -4,15 +4,18 @@ public struct BroadcastMessage: Equatable { public init( roundId: Int, ephId: [Int], + roundURL: String, payload: Data ) { self.roundId = roundId self.ephId = ephId + self.roundURL = roundURL self.payload = payload } public var roundId: Int public var ephId: [Int] + public var roundURL: String public var payload: Data } @@ -20,6 +23,7 @@ extension BroadcastMessage: Codable { enum CodingKeys: String, CodingKey { case roundId = "RoundID" case ephId = "EphID" + case roundURL = "RoundURL" case payload = "Payload" } diff --git a/Sources/XXClient/Models/BroadcastReport.swift b/Sources/XXClient/Models/BroadcastReport.swift index 3114a12b733bd4f44829e7d55f8ed4534b2155cc..98df89091b78ee9a447e9e29e9604adbe2547588 100644 --- a/Sources/XXClient/Models/BroadcastReport.swift +++ b/Sources/XXClient/Models/BroadcastReport.swift @@ -2,21 +2,25 @@ import Foundation public struct BroadcastReport: Equatable { public init( - roundId: Int, - ephId: [Int] + rounds: [Int], + ephId: [Int], + roundURL: String ) { - self.roundId = roundId + self.rounds = rounds self.ephId = ephId + self.roundURL = roundURL } - public var roundId: Int + public var rounds: [Int] public var ephId: [Int] + public var roundURL: String } extension BroadcastReport: Codable { enum CodingKeys: String, CodingKey { - case roundId = "RoundID" + case rounds = "Rounds" case ephId = "EphID" + case roundURL = "RoundURL" } public static func decode(_ data: Data) throws -> Self { diff --git a/Sources/XXClient/Models/E2ESendReport.swift b/Sources/XXClient/Models/E2ESendReport.swift index f334ab71c0c9c9c5dd1179b661c75e74407f4b10..b4b08ec587e6dcf052bea0f25e6a5543aff6d47d 100644 --- a/Sources/XXClient/Models/E2ESendReport.swift +++ b/Sources/XXClient/Models/E2ESendReport.swift @@ -2,18 +2,21 @@ import Foundation public struct E2ESendReport: Equatable { public init( - roundList: [Int]?, + rounds: [Int]?, + roundURL: String?, messageId: Data?, timestamp: Int?, keyResidue: Data? ) { - self.roundList = roundList + self.rounds = rounds + self.roundURL = roundURL self.messageId = messageId self.timestamp = timestamp self.keyResidue = keyResidue } - public var roundList: [Int]? + public var rounds: [Int]? + public var roundURL: String? public var messageId: Data? public var timestamp: Int? public var keyResidue: Data? @@ -21,7 +24,8 @@ public struct E2ESendReport: Equatable { extension E2ESendReport: Codable { enum CodingKeys: String, CodingKey { - case roundList = "Rounds" + case rounds = "Rounds" + case roundURL = "RoundURL" case messageId = "MessageID" case timestamp = "Timestamp" case keyResidue = "KeyResidue" diff --git a/Sources/XXClient/Models/GroupReport.swift b/Sources/XXClient/Models/GroupReport.swift index 0407507dfe034255822b07f78eaf9310dff3975b..7ff59b823139da98908457f7b45ac9761dcfde45 100644 --- a/Sources/XXClient/Models/GroupReport.swift +++ b/Sources/XXClient/Models/GroupReport.swift @@ -4,15 +4,18 @@ public struct GroupReport: Equatable { public init( id: Data, rounds: [Int], + roundURL: String, status: Int ) { self.id = id self.rounds = rounds + self.roundURL = roundURL self.status = status } public var id: Data public var rounds: [Int] + public var roundURL: String public var status: Int } @@ -20,6 +23,7 @@ extension GroupReport: Codable { enum CodingKeys: String, CodingKey { case id = "Id" case rounds = "Rounds" + case roundURL = "RoundURL" case status = "Status" } diff --git a/Sources/XXClient/Models/GroupSendReport.swift b/Sources/XXClient/Models/GroupSendReport.swift index c7b3b01d5da48cc518773572c95bdd76213544ab..9d450e46dbaaec575b24cb425661ab7e5a80803a 100644 --- a/Sources/XXClient/Models/GroupSendReport.swift +++ b/Sources/XXClient/Models/GroupSendReport.swift @@ -2,23 +2,27 @@ import Foundation public struct GroupSendReport: Equatable { public init( - roundId: UInt64, + rounds: [Int], + roundURL: String, timestamp: Int64, messageId: Data ) { - self.roundId = roundId + self.rounds = rounds + self.roundURL = roundURL self.timestamp = timestamp self.messageId = messageId } - public var roundId: UInt64 + public var rounds: [Int] + public var roundURL: String public var timestamp: Int64 public var messageId: Data } extension GroupSendReport: Codable { enum CodingKeys: String, CodingKey { - case roundId = "RoundID" + case rounds = "Rounds" + case roundURL = "RoundURL" case timestamp = "Timestamp" case messageId = "MessageID" } diff --git a/Sources/XXClient/Models/SingleUseCallbackReport.swift b/Sources/XXClient/Models/SingleUseCallbackReport.swift index 032f7c1c2b75b5e527037569a6d9867cc2487633..7456382e5e9cea8d2055881237c004789a967eee 100644 --- a/Sources/XXClient/Models/SingleUseCallbackReport.swift +++ b/Sources/XXClient/Models/SingleUseCallbackReport.swift @@ -3,12 +3,14 @@ import Foundation public struct SingleUseCallbackReport: Equatable { public init( rounds: [Int], + roundURL: String, payload: Data, partner: Data, ephId: Int64, receptionId: Data ) { self.rounds = rounds + self.roundURL = roundURL self.payload = payload self.partner = partner self.ephId = ephId @@ -16,6 +18,7 @@ public struct SingleUseCallbackReport: Equatable { } public var rounds: [Int] + public var roundURL: String public var payload: Data public var partner: Data public var ephId: Int64 @@ -25,6 +28,7 @@ public struct SingleUseCallbackReport: Equatable { extension SingleUseCallbackReport: Codable { enum CodingKeys: String, CodingKey { case rounds = "Rounds" + case roundURL = "RoundURL" case payload = "Payload" case partner = "Partner" case ephId = "EphID" diff --git a/Sources/XXClient/Models/SingleUseResponseReport.swift b/Sources/XXClient/Models/SingleUseResponseReport.swift index 788ca27c6c1f84d4d0af8bb1c1a5d197eb679797..8c509749b4f7dbe899cc988194fd6a313b4bc318 100644 --- a/Sources/XXClient/Models/SingleUseResponseReport.swift +++ b/Sources/XXClient/Models/SingleUseResponseReport.swift @@ -3,12 +3,14 @@ import Foundation public struct SingleUseResponseReport: Equatable { public init( rounds: [Int], + roundURL: String, payload: Data, ephId: Int64, receptionId: Data, error: String? ) { self.rounds = rounds + self.roundURL = roundURL self.payload = payload self.ephId = ephId self.receptionId = receptionId @@ -16,6 +18,7 @@ public struct SingleUseResponseReport: Equatable { } public var rounds: [Int] + public var roundURL: String public var payload: Data public var ephId: Int64 public var receptionId: Data @@ -25,6 +28,7 @@ public struct SingleUseResponseReport: Equatable { extension SingleUseResponseReport: Codable { enum CodingKeys: String, CodingKey { case rounds = "Rounds" + case roundURL = "RoundURL" case payload = "Payload" case ephId = "EphID" case receptionId = "ReceptionID" diff --git a/Sources/XXClient/Models/SingleUseSendReport.swift b/Sources/XXClient/Models/SingleUseSendReport.swift index affd341d2ae8d236d529b090bbccaf52418f6318..870e73e2f99398e1bf58a1083c0fc9d02fac61fd 100644 --- a/Sources/XXClient/Models/SingleUseSendReport.swift +++ b/Sources/XXClient/Models/SingleUseSendReport.swift @@ -3,15 +3,18 @@ import Foundation public struct SingleUseSendReport: Equatable { public init( rounds: [Int], + roundURL: String, ephId: Int64, receptionId: Data ) { self.rounds = rounds + self.roundURL = roundURL self.ephId = ephId self.receptionId = receptionId } public var rounds: [Int] + public var roundURL: String public var ephId: Int64 public var receptionId: Data } @@ -19,6 +22,7 @@ public struct SingleUseSendReport: Equatable { extension SingleUseSendReport: Codable { enum CodingKeys: String, CodingKey { case rounds = "Rounds" + case roundURL = "RoundURL" case ephId = "EphID" case receptionId = "ReceptionID" } diff --git a/Tests/XXClientTests/Models/BroadcastMessageTests.swift b/Tests/XXClientTests/Models/BroadcastMessageTests.swift index 13c676ec18fa5e015a2484d74eb575892700bcc2..c0b0fa8abaa7507db8cd4e3f80071a15202c2d24 100644 --- a/Tests/XXClientTests/Models/BroadcastMessageTests.swift +++ b/Tests/XXClientTests/Models/BroadcastMessageTests.swift @@ -6,11 +6,13 @@ final class BroadcastMessageTests: XCTestCase { func testCoding() throws { let roundId: Int = 42 let ephId: [Int] = [0, 0, 0, 0, 0, 0, 24, 61] + let roundURL = "https://dashboard.xx.network/rounds/25?xxmessenger=true" let payloadB64 = "SGVsbG8sIGJyb2FkY2FzdCBmcmllbmRzIQ==" let jsonString = """ { "RoundID": \(roundId), "EphID": [\(ephId.map { "\($0)" }.joined(separator: ", "))], + "RoundURL": "\(roundURL)", "Payload": "\(payloadB64)" } """ @@ -20,6 +22,7 @@ final class BroadcastMessageTests: XCTestCase { XCTAssertNoDifference(model, BroadcastMessage( roundId: roundId, ephId: ephId, + roundURL: roundURL, payload: Data(base64Encoded: payloadB64)! )) diff --git a/Tests/XXClientTests/Models/BroadcastReportTests.swift b/Tests/XXClientTests/Models/BroadcastReportTests.swift index 846657bb1afcbef64279732c9ab1096fe1c6240d..3439b1dce41275324206b241b041d84a9db90e61 100644 --- a/Tests/XXClientTests/Models/BroadcastReportTests.swift +++ b/Tests/XXClientTests/Models/BroadcastReportTests.swift @@ -4,20 +4,23 @@ import XCTest final class BroadcastReportTests: XCTestCase { func testCoding() throws { - let roundId: Int = 42 + let rounds: [Int] = [25, 26, 29] let ephId: [Int] = [0, 0, 0, 0, 0, 0, 24, 61] + let roundURL = "https://dashboard.xx.network/rounds/25?xxmessenger=true" let jsonString = """ { - "RoundID": \(roundId), - "EphID": [\(ephId.map { "\($0)" }.joined(separator: ", "))] + "Rounds": [\(rounds.map { "\($0)" }.joined(separator: ", "))], + "EphID": [\(ephId.map { "\($0)" }.joined(separator: ", "))], + "RoundURL": "\(roundURL)" } """ let jsonData = jsonString.data(using: .utf8)! let model = try BroadcastReport.decode(jsonData) XCTAssertNoDifference(model, BroadcastReport( - roundId: roundId, - ephId: ephId + rounds: rounds, + ephId: ephId, + roundURL: roundURL )) let encodedModel = try model.encode() diff --git a/Tests/XXClientTests/Models/E2ESendReportTests.swift b/Tests/XXClientTests/Models/E2ESendReportTests.swift index d931009e3dddc4be16542db57f7c14866480daf7..e3824bf581bdccb1ddc42f451e33d24274b1616f 100644 --- a/Tests/XXClientTests/Models/E2ESendReportTests.swift +++ b/Tests/XXClientTests/Models/E2ESendReportTests.swift @@ -5,12 +5,14 @@ import XCTest final class E2ESendReportTests: XCTestCase { func testCoding() throws { let rounds = [1, 5, 9] + let roundURL = "https://dashboard.xx.network/rounds/25?xxmessenger=true" let messageIdB64 = "iM34yCIr4Je8ZIzL9iAAG1UWAeDiHybxMTioMAaezvs=" let timestamp: Int = 1_661_532_254_302_612_000 let keyResidueB64 = "9q2/A69EAuFM1hFAT7Bzy5uGOQ4T6bPFF72h5PlgCWE=" let jsonString = """ { "Rounds": [\(rounds.map { "\($0)" }.joined(separator: ", "))], + "RoundURL": "\(roundURL)", "MessageID": "\(messageIdB64)", "Timestamp": \(timestamp), "KeyResidue": "\(keyResidueB64)" @@ -20,7 +22,8 @@ final class E2ESendReportTests: XCTestCase { let model = try E2ESendReport.decode(jsonData) XCTAssertNoDifference(model, E2ESendReport( - roundList: rounds, + rounds: rounds, + roundURL: roundURL, messageId: Data(base64Encoded: messageIdB64)!, timestamp: timestamp, keyResidue: Data(base64Encoded: keyResidueB64) @@ -38,7 +41,8 @@ final class E2ESendReportTests: XCTestCase { let model = try E2ESendReport.decode(jsonData) XCTAssertNoDifference(model, E2ESendReport( - roundList: nil, + rounds: nil, + roundURL: nil, messageId: nil, timestamp: nil, keyResidue: nil diff --git a/Tests/XXClientTests/Models/GroupReportTests.swift b/Tests/XXClientTests/Models/GroupReportTests.swift index fbdf17f4cc93d02fddced935e5cb2bc5fe40f723..95aeeb97c01510901334c577732ed7299f5ecb03 100644 --- a/Tests/XXClientTests/Models/GroupReportTests.swift +++ b/Tests/XXClientTests/Models/GroupReportTests.swift @@ -4,13 +4,15 @@ import XCTest final class GroupReportTests: XCTestCase { func testCoding() throws { - let idB64 = "EB/70R5HYEw5htZ4Hg9ondrn3+cAc/lH2G0mjQMja3w=" - let rounds: [Int] = [1, 5, 9] - let status: Int = 123 + let idB64 = "AAAAAAAAAM0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE" + let rounds: [Int] = [25, 64] + let roundURL = "https://dashboard.xx.network/rounds/25?xxmessenger=true" + let status: Int = 1 let jsonString = """ { "Id": "\(idB64)", "Rounds": [\(rounds.map { "\($0)" }.joined(separator: ", "))], + "RoundURL": "\(roundURL)", "Status": \(status) } """ @@ -20,6 +22,7 @@ final class GroupReportTests: XCTestCase { XCTAssertNoDifference(model, GroupReport( id: Data(base64Encoded: idB64)!, rounds: rounds, + roundURL: roundURL, status: status )) diff --git a/Tests/XXClientTests/Models/GroupSendReportTests.swift b/Tests/XXClientTests/Models/GroupSendReportTests.swift index b8addf78fdab01a066f095ab5c574ad84a73c4e1..552e315c8b7b51414a25f36316d03a0d6fab1754 100644 --- a/Tests/XXClientTests/Models/GroupSendReportTests.swift +++ b/Tests/XXClientTests/Models/GroupSendReportTests.swift @@ -4,12 +4,14 @@ import XCTest final class GroupSendReportTests: XCTestCase { func testCoding() throws { - let roundId: UInt64 = 123 - let timestamp: Int64 = 321 - let messageIdB64 = "EB/70R5HYEw5htZ4Hg9ondrn3+cAc/lH2G0mjQMja3w=" + let rounds: [Int] = [25, 64] + let roundURL = "https://dashboard.xx.network/rounds/25?xxmessenger=true" + let timestamp: Int64 = 1_662_577_352_813_112_000 + let messageIdB64 = "69ug6FA50UT2q6MWH3hne9PkHQ+H9DnEDsBhc0m0Aww=" let jsonString = """ { - "RoundID": \(roundId), + "Rounds": [\(rounds.map { "\($0)" }.joined(separator: ", "))], + "RoundURL": "\(roundURL)", "Timestamp": \(timestamp), "MessageID": "\(messageIdB64)" } @@ -18,7 +20,8 @@ final class GroupSendReportTests: XCTestCase { let model = try GroupSendReport.decode(jsonData) XCTAssertNoDifference(model, GroupSendReport( - roundId: roundId, + rounds: rounds, + roundURL: roundURL, timestamp: timestamp, messageId: Data(base64Encoded: messageIdB64)! )) diff --git a/Tests/XXClientTests/Models/SingleUseCallbackReportTests.swift b/Tests/XXClientTests/Models/SingleUseCallbackReportTests.swift index b0b22284a301ab7bda575c45605bc03bde7616c3..297754da807264c9c4ab99cc85e0c93d74e4df74 100644 --- a/Tests/XXClientTests/Models/SingleUseCallbackReportTests.swift +++ b/Tests/XXClientTests/Models/SingleUseCallbackReportTests.swift @@ -5,6 +5,7 @@ import XCTest final class SingleUseCallbackReportTests: XCTestCase { func testCoding() throws { let rounds: [Int] = [1, 5, 9] + let roundURL = "https://dashboard.xx.network/rounds/25?xxmessenger=true" let payloadB64 = "rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==" let partnerB64 = "emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD" let ephId: Int64 = 1_655_533 @@ -12,6 +13,7 @@ final class SingleUseCallbackReportTests: XCTestCase { let jsonString = """ { "Rounds": [\(rounds.map { "\($0)" }.joined(separator: ", "))], + "RoundURL": "\(roundURL)", "Payload": "\(payloadB64)", "Partner": "\(partnerB64)", "EphID": \(ephId), @@ -23,6 +25,7 @@ final class SingleUseCallbackReportTests: XCTestCase { XCTAssertNoDifference(model, SingleUseCallbackReport( rounds: rounds, + roundURL: roundURL, payload: Data(base64Encoded: payloadB64)!, partner: Data(base64Encoded: partnerB64)!, ephId: ephId, diff --git a/Tests/XXClientTests/Models/SingleUseResponseReportTests.swift b/Tests/XXClientTests/Models/SingleUseResponseReportTests.swift index 087ac8cfc02f2c596ed8a6d8fac92288370221e7..1cec51ebe33ce7df993967505f9524e0c4a10c20 100644 --- a/Tests/XXClientTests/Models/SingleUseResponseReportTests.swift +++ b/Tests/XXClientTests/Models/SingleUseResponseReportTests.swift @@ -5,12 +5,14 @@ import XCTest final class SingleUseResponseReportTests: XCTestCase { func testCoding() throws { let rounds: [Int] = [1, 5, 9] + let roundURL = "https://dashboard.xx.network/rounds/25?xxmessenger=true" let payloadB64 = "rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==" let ephId: Int64 = 1_655_533 let receptionIdB64 = "emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD" let jsonString = """ { "Rounds": [\(rounds.map { "\($0)" }.joined(separator: ", "))], + "RoundURL": "\(roundURL)", "Payload": "\(payloadB64)", "EphID": \(ephId), "ReceptionID": "\(receptionIdB64)", @@ -22,6 +24,7 @@ final class SingleUseResponseReportTests: XCTestCase { XCTAssertNoDifference(model, SingleUseResponseReport( rounds: rounds, + roundURL: roundURL, payload: Data(base64Encoded: payloadB64)!, ephId: ephId, receptionId: Data(base64Encoded: receptionIdB64)!, @@ -36,6 +39,7 @@ final class SingleUseResponseReportTests: XCTestCase { func testDecodingReportWithError() throws { let rounds: [Int] = [1, 5, 9] + let roundURL = "https://dashboard.xx.network/rounds/25?xxmessenger=true" let payloadB64 = "rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==" let ephId: Int64 = 1_655_533 let receptionIdB64 = "emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD" @@ -43,6 +47,7 @@ final class SingleUseResponseReportTests: XCTestCase { let jsonString = """ { "Rounds": [\(rounds.map { "\($0)" }.joined(separator: ", "))], + "RoundURL": "\(roundURL)", "Payload": "\(payloadB64)", "EphID": \(ephId), "ReceptionID": "\(receptionIdB64)", @@ -54,6 +59,7 @@ final class SingleUseResponseReportTests: XCTestCase { XCTAssertNoDifference(model, SingleUseResponseReport( rounds: rounds, + roundURL: roundURL, payload: Data(base64Encoded: payloadB64)!, ephId: ephId, receptionId: Data(base64Encoded: receptionIdB64)!, diff --git a/Tests/XXClientTests/Models/SingleUseSendReportTests.swift b/Tests/XXClientTests/Models/SingleUseSendReportTests.swift index 07a836d9cf10f43ddfe4a9b445dd3870aac39253..db25f50e3d4e7d7bd10b53e545d164e5c0ba54ac 100644 --- a/Tests/XXClientTests/Models/SingleUseSendReportTests.swift +++ b/Tests/XXClientTests/Models/SingleUseSendReportTests.swift @@ -5,11 +5,13 @@ import XCTest final class SingleUseSendReportTests: XCTestCase { func testCoding() throws { let rounds: [Int] = [1, 5, 9] + let roundURL = "https://dashboard.xx.network/rounds/25?xxmessenger=true" let ephId: Int64 = 1_655_533 let receptionIdB64 = "emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD" let jsonString = """ { "Rounds": [\(rounds.map { "\($0)" }.joined(separator: ", "))], + "RoundURL": "\(roundURL)", "EphID": \(ephId), "ReceptionID": "\(receptionIdB64)" } @@ -19,6 +21,7 @@ final class SingleUseSendReportTests: XCTestCase { XCTAssertNoDifference(model, SingleUseSendReport( rounds: rounds, + roundURL: roundURL, ephId: ephId, receptionId: Data(base64Encoded: receptionIdB64)! )) diff --git a/Tests/XXMessengerClientTests/Messenger/Functions/MessengerSearchUsersTests.swift b/Tests/XXMessengerClientTests/Messenger/Functions/MessengerSearchUsersTests.swift index 9ffa1c82bdc0fec3fc7b089c2ef25a60f634d86d..21152086ca38c771ae678109a4545be1232c5b9f 100644 --- a/Tests/XXMessengerClientTests/Messenger/Functions/MessengerSearchUsersTests.swift +++ b/Tests/XXMessengerClientTests/Messenger/Functions/MessengerSearchUsersTests.swift @@ -38,7 +38,7 @@ final class MessengerSearchUsersTests: XCTestCase { .unimplemented("contact-2".data(using: .utf8)!), .unimplemented("contact-3".data(using: .utf8)!), ])) - return SingleUseSendReport(rounds: [], ephId: 0, receptionId: Data()) + return SingleUseSendReport(rounds: [], roundURL: "", ephId: 0, receptionId: Data()) } let search: MessengerSearchUsers = .live(env) @@ -128,7 +128,7 @@ final class MessengerSearchUsersTests: XCTestCase { env.getSingleUseParams.run = { Data() } env.searchUD.run = { _, _, _, _, callback in callback.handle(.failure(error as NSError)) - return SingleUseSendReport(rounds: [], ephId: 0, receptionId: Data()) + return SingleUseSendReport(rounds: [], roundURL: "", ephId: 0, receptionId: Data()) } let search: MessengerSearchUsers = .live(env)