Skip to content

Commit

Permalink
[SDK ver. 3.3.7] Added missed attributes to SEAttempt. (#53)
Browse files Browse the repository at this point in the history
* Added missed attributes to SEAttempt

* clean code

Co-authored-by: Constantin Chelban <[email protected]>
  • Loading branch information
ConstantinKV and ConstantinKV authored Oct 7, 2020
1 parent cd08cc9 commit 723c0ce
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 72 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [3.3.7] - 2020-10-07

### Added.

- Added missed attributes to `SEAttempt`.


## [3.3.6] - 2020-10-02

### Added.
Expand Down
29 changes: 17 additions & 12 deletions Example/saltedge-ios/Base.lproj/LaunchScreen.xib
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -16,16 +13,16 @@
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 CocoaPods. All rights reserved" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text=" Copyright (c) 2020 Salt Edge Inc. All rights reserved" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="18" y="439" width="440" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" systemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="saltedge-ios Demo" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Salt Edge Service Demo" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="139.5" width="440" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="textColor" systemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
Expand All @@ -43,4 +40,12 @@
<point key="canvasLocation" x="548" y="455"/>
</view>
</objects>
<resources>
<systemColor name="darkTextColor">
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="darkTextColor">
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Last SDK version (3+) supports Salt Edge API v5.
for Salt Edge API v5 use

```ruby
pod 'SaltEdge-iOS-Swift', '~> 3.3.6'
pod 'SaltEdge-iOS-Swift', '~> 3.3.7'
```

for Salt Edge API v4 (***Deprecated***) use
Expand Down Expand Up @@ -223,7 +223,7 @@ Set up the `appId`, `appSecret` and `customerId` constants to your App ID and c

## Versioning

The current version of the SDK is [3.3.6](https://github.com/saltedge/saltedge-ios-swift/releases/tag/3.3.6), and supports the latest available version of Salt Edge API. Any backward-incompatible changes in the API will result in changes to the SDK.
The current version of the SDK is [3.3.7](https://github.com/saltedge/saltedge-ios-swift/releases/tag/3.3.7), and supports the latest available version of Salt Edge API. Any backward-incompatible changes in the API will result in changes to the SDK.

## Security

Expand Down
2 changes: 1 addition & 1 deletion SaltEdge-iOS-Swift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'SaltEdge-iOS-Swift'
s.version = '3.3.6'
s.version = '3.3.7'
s.summary = "A handful of classes to help you interact with the Salt Edge API from your iOS or macOS app."
s.description = <<-DESC
SaltEdge-iOS is a library targeted at easing the interaction with the [Salt Edge API](https://docs.saltedge.com/).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,17 @@ public class SEConnectionRefreshParams: SEExtendedConnectionParams {
public let attempt: SEAttempt?
public let categorization: String?

public init(attempt: SEAttempt? = nil,
categorization: String? = nil,
fromDate: Date? = nil,
toDate: Date? = nil,
dailyRefresh: Bool? = nil,
locale: String? = nil,
includeFakeProviders: Bool? = nil,
categorize: Bool? = nil,
storeCredentials: Bool? = nil) {
public init(
attempt: SEAttempt? = nil,
dailyRefresh: Bool? = nil,
includeFakeProviders: Bool? = nil,
categorization: String? = nil,
fromDate: Date? = nil,
toDate: Date? = nil,
locale: String? = nil,
categorize: Bool? = nil,
storeCredentials: Bool? = nil
) {
self.attempt = attempt
self.categorization = categorization

Expand Down
70 changes: 40 additions & 30 deletions saltedge-ios-swift/Classes/API/Models/Responses/SEAttempt.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// SEAttempt.swift
//
// Copyright (c) 2019 Salt Edge. https://saltedge.com
// Copyright (c) 2020 Salt Edge. https://saltedge.com
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -53,36 +53,42 @@ public struct SEAttempt: Codable {
public let lastStage: SEStage?
public let stages: [SEStage]?
public let returnTo: String?
public let fromDate: Date?
public let toDate: Date?

public init(id: String? = nil,
fetchScopes: [String]? = nil,
apiMode: String? = nil,
apiVersion: String? = nil,
automaticFetch: Bool? = nil,
dailyRefresh: Bool? = nil,
categorize: Bool? = nil,
createdAt: Date? = nil,
customFields: [String: String]? = nil,
deviceType: String? = nil,
remoteIp: String? = nil,
excludeAccounts: [Int]? = nil,
failAt: Date? = nil,
failErrorClass: String? = nil,
failMessage: String? = nil,
finished: Bool? = nil,
finishedRecent: Bool? = nil,
interactive: Bool? = nil,
locale: String? = nil,
partial: Bool? = nil,
storeCredentials: Bool? = nil,
successAt: Date? = nil,
updatedAt: Date? = nil,
showConsentConfirmation: Bool? = nil,
consentTypes: [String]? = nil,
consentGivenAt: Date? = nil,
lastStage: SEStage? = nil,
stages: [SEStage]? = nil,
returnTo: String? = nil) {
public init(
id: String? = nil,
fetchScopes: [String]? = nil,
apiMode: String? = nil,
apiVersion: String? = nil,
automaticFetch: Bool? = nil,
dailyRefresh: Bool? = nil,
categorize: Bool? = nil,
createdAt: Date? = nil,
customFields: [String: String]? = nil,
deviceType: String? = nil,
remoteIp: String? = nil,
excludeAccounts: [Int]? = nil,
failAt: Date? = nil,
failErrorClass: String? = nil,
failMessage: String? = nil,
finished: Bool? = nil,
finishedRecent: Bool? = nil,
interactive: Bool? = nil,
locale: String? = nil,
partial: Bool? = nil,
storeCredentials: Bool? = nil,
successAt: Date? = nil,
updatedAt: Date? = nil,
showConsentConfirmation: Bool? = nil,
consentTypes: [String]? = nil,
consentGivenAt: Date? = nil,
lastStage: SEStage? = nil,
stages: [SEStage]? = nil,
returnTo: String? = nil,
fromDate: Date? = nil,
toDate: Date? = nil
) {
self.id = id
self.fetchScopes = fetchScopes
self.apiMode = apiMode
Expand Down Expand Up @@ -112,6 +118,8 @@ public struct SEAttempt: Codable {
self.lastStage = lastStage
self.stages = stages
self.returnTo = returnTo
self.fromDate = fromDate
self.toDate = toDate
}

enum CodingKeys: String, CodingKey {
Expand Down Expand Up @@ -144,5 +152,7 @@ public struct SEAttempt: Codable {
case lastStage = "last_stage"
case stages = "stages"
case returnTo = "return_to"
case fromDate = "from_date"
case toDate = "to_date"
}
}
35 changes: 30 additions & 5 deletions saltedge-ios-swift/Classes/API/SEConnectionFetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ import Foundation
class SEConnectionFetcher {
private static let pollingInterval: Double = 3.0

static func createConnection(with params: SEConnectionParams, fetchingDelegate: SEConnectionFetchingDelegate, completion: SEHTTPResponse<SEConnection>) {
static func createConnection(
with params: SEConnectionParams,
fetchingDelegate: SEConnectionFetchingDelegate,
completion: SEHTTPResponse<SEConnection>
) {
HTTPService<SEConnection>.makeRequest(ConnectionRouter.create(params)) { response in
switch response {
case .success(let value):
Expand All @@ -37,7 +41,13 @@ class SEConnectionFetcher {
}
}

static func updateConnectionStatus(with params: SEConnectionUpdateStatusParams, id: String, secret: String, fetchingDelegate: SEConnectionFetchingDelegate, completion: SEHTTPResponse<SEConnection>) {
static func updateConnectionStatus(
with params: SEConnectionUpdateStatusParams,
id: String,
secret: String,
fetchingDelegate: SEConnectionFetchingDelegate,
completion: SEHTTPResponse<SEConnection>
) {
HTTPService<SEConnection>.makeRequest(ConnectionRouter.update(params, id, secret)) { response in
switch response {
case .success(let value):
Expand All @@ -48,7 +58,12 @@ class SEConnectionFetcher {
}
}

static func reconnectConnection(secret: String, params: SEConnectionReconnectParams, fetchingDelegate: SEConnectionFetchingDelegate, completion: SEHTTPResponse<SEConnection>) {
static func reconnectConnection(
secret: String,
params: SEConnectionReconnectParams,
fetchingDelegate: SEConnectionFetchingDelegate,
completion: SEHTTPResponse<SEConnection>
) {
HTTPService<SEConnection>.makeRequest(ConnectionRouter.reconnect(params, secret)) { response in
switch response {
case .success(let value):
Expand All @@ -59,7 +74,12 @@ class SEConnectionFetcher {
}
}

static func refreshConnection(secret: String, params: SEConnectionRefreshParams? = nil, fetchingDelegate: SEConnectionFetchingDelegate, completion: SEHTTPResponse<SEConnection>) {
static func refreshConnection(
secret: String,
params: SEConnectionRefreshParams? = nil,
fetchingDelegate: SEConnectionFetchingDelegate,
completion: SEHTTPResponse<SEConnection>
) {
HTTPService<SEConnection>.makeRequest(ConnectionRouter.refresh(params, secret)) { response in
switch response {
case .success(let value):
Expand All @@ -70,7 +90,12 @@ class SEConnectionFetcher {
}
}

static func interactiveConnection(with params: SEConnectionInteractiveParams, secret: String, fetchingDelegate: SEConnectionFetchingDelegate, completion: SEHTTPResponse<SEConnection>) {
static func interactiveConnection(
with params: SEConnectionInteractiveParams,
secret: String,
fetchingDelegate: SEConnectionFetchingDelegate,
completion: SEHTTPResponse<SEConnection>
) {
HTTPService<SEConnection>.makeRequest(ConnectionRouter.interactive(params, secret)) { response in
switch response {
case .success(let value):
Expand Down
Loading

0 comments on commit 723c0ce

Please sign in to comment.