Skip to content

Commit

Permalink
Merge pull request #264 from skyflowapi/public-release/1.22.1
Browse files Browse the repository at this point in the history
SK-1440 Public release/1.22.1
  • Loading branch information
skyflow-bharti committed Jan 25, 2024
2 parents f7be022 + 0e1ae38 commit 45c6798
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 25 deletions.
1 change: 1 addition & 0 deletions Samples/CollectAndRevealSample/Podfile
Expand Up @@ -5,6 +5,7 @@ source 'https://github.com/CocoaPods/Specs.git'

target 'CollectAndRevealSample' do
#use_frameworks!
pod 'AEXML', '4.6.1'

# Pods for skyflow-iOS-sample-app
pod 'Skyflow', ">= 1.22.0"
Expand Down
1 change: 1 addition & 0 deletions Samples/ComposableElements/Podfile
Expand Up @@ -4,6 +4,7 @@
target 'ComposableElements' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
pod 'AEXML', '4.6.1'
pod 'Skyflow', ">= 1.22.0"
# Pods for ComposableElements

Expand Down
2 changes: 1 addition & 1 deletion Samples/GetSample/Podfile
Expand Up @@ -5,7 +5,7 @@ source 'https://github.com/CocoaPods/Specs.git'

target 'GetSample' do
#use_frameworks!

pod 'AEXML', '4.6.1'
# Pods for GetSample
pod 'Skyflow', ">= 1.22.0"

Expand Down
3 changes: 2 additions & 1 deletion Samples/InputFormatting/Podfile
Expand Up @@ -3,7 +3,8 @@
target 'InputFormatting' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

pod 'AEXML', '4.6.1'

pod 'Skyflow', ">= 1.22.0"

# Pods for InputFormatting
Expand Down
2 changes: 1 addition & 1 deletion Samples/Validations/Podfile
Expand Up @@ -5,7 +5,7 @@ source 'https://github.com/CocoaPods/Specs.git'

target 'Validations' do
#use_frameworks!

pod 'AEXML', '4.6.1'
# Pods for skyflow-iOS-sample-app
pod 'Skyflow', ">= 1.22.0"

Expand Down
6 changes: 3 additions & 3 deletions Skyflow.podspec
Expand Up @@ -2,7 +2,7 @@ Pod::Spec.new do |spec|

spec.name = "Skyflow"

spec.version = "1.22.0"
spec.version = "1.22.1"

spec.summary = "skyflow-iOS"

Expand All @@ -20,12 +20,12 @@ Pod::Spec.new do |spec|

spec.ios.deployment_target = "9.0"

spec.source = { :git => "https://github.com/skyflowapi/skyflow-iOS.git", :tag => "1.22.0" }
spec.source = { :git => "https://github.com/skyflowapi/skyflow-iOS.git", :tag => "1.22.1" }

spec.source_files = "Sources/Skyflow/**/*.{swift}"

spec.resource_bundles = {'Skyflow' => ['Sources/Skyflow/Resources/**/*.{xcassets}'] }

spec.dependency "AEXML"
spec.dependency "AEXML", "4.6.1"
end

2 changes: 1 addition & 1 deletion Sources/Skyflow/Version.swift
Expand Up @@ -11,4 +11,4 @@

import Foundation

var SDK_VERSION = "1.22.0"
var SDK_VERSION = "1.22.1"
22 changes: 13 additions & 9 deletions Sources/Skyflow/reveal/GetAPICallback.swift
Expand Up @@ -90,11 +90,11 @@ class GetAPICallback: Callback {
internal func buildFieldsDict(dict: [String: Any]) -> [String: Any] {
var temp: [String: Any] = [:]
for (key, val) in dict {
if let v = val as? [String: Any] {
temp[key] = buildFieldsDict(dict: v)
} else {
temp[key] = val
}
if let v = val as? [String: Any] {
temp[key] = buildFieldsDict(dict: v)
} else {
temp[key] = val
}
}
return temp
}
Expand Down Expand Up @@ -133,10 +133,13 @@ class GetAPICallback: Callback {
urlComponents?.queryItems?.append(URLQueryItem(name: "skyflow_ids", value: id))
}
} else if record.columnValues != nil && record.columnName != nil{

for columnValue in record.columnValues! {
urlComponents?.queryItems?.append(URLQueryItem(name: "column_name", value: record.columnName))
urlComponents?.queryItems?.append(URLQueryItem(name: "column_values", value: columnValue))
if let array = record.columnValues {
for (index, value) in array.enumerated() {
if index == 0 {
urlComponents?.queryItems?.append(URLQueryItem(name: "column_name", value: record.columnName))
}
urlComponents?.queryItems?.append(URLQueryItem(name: "column_values", value: value))
}
}
}
if(record.redaction != nil && getOptions.tokens == false){
Expand Down Expand Up @@ -186,6 +189,7 @@ class GetAPICallback: Callback {
for entry in jsonDataArray {
var entryDict = self.buildFieldsDict(dict: entry)
entryDict["table"] = record.table
entryDict.removeValue(forKey: "tokens")
outputArray.append(entryDict)
}
}
Expand Down
1 change: 1 addition & 0 deletions Sources/Skyflow/reveal/RevealByIDAPICallback.swift
Expand Up @@ -167,6 +167,7 @@ class RevealByIDAPICallback: Callback {
for entry in jsonDataArray {
var entryDict = self.buildFieldsDict(dict: entry)
entryDict["table"] = record.table
entryDict.removeValue(forKey: "tokens")
outputArray.append(entryDict)
}
}
Expand Down
10 changes: 5 additions & 5 deletions Tests/skyflow-iOS-elementTests/skyflow_iOS_elementTests.swift
Expand Up @@ -208,28 +208,28 @@ class skyflow_iOS_elementTests: XCTestCase {
}

func testCardExpiryValidationMMYY() {
let mmyy = "12/23"
let mmyy = "12/24"

let cardexpValidation = SkyflowValidateCardExpirationDate(format: "mm/yy", error: "Invalid Card expiration date")
XCTAssertTrue(SkyflowValidator.validate(input: mmyy, rules: ValidationSet(rules: [cardexpValidation])).isEmpty)
}

func testCardExpiryValidationMMYYYY() {
let mmyyyy = "12/2023"
let mmyyyy = "12/2029"

let cardexpValidation = SkyflowValidateCardExpirationDate(format: "mm/yyyy", error: "Invalid Card expiration date")
XCTAssertTrue(SkyflowValidator.validate(input: mmyyyy, rules: ValidationSet(rules: [cardexpValidation])).isEmpty)
}

func testCardExpiryValidationYYMM() {
let yymm = "23/12"
let yymm = "28/12"

let cardexpValidation = SkyflowValidateCardExpirationDate(format: "yy/mm", error: "Invalid Card expiration date")
XCTAssertTrue(SkyflowValidator.validate(input: yymm, rules: ValidationSet(rules: [cardexpValidation])).isEmpty)
}

func testCardExpiryValidationYYYYMM() {
let yyyymm = "2023/12"
let yyyymm = "2028/12"

let cardexpValidation = SkyflowValidateCardExpirationDate(format: "yyyy/mm", error: "Invalid Card expiration date")
XCTAssertTrue(SkyflowValidator.validate(input: yyyymm, rules: ValidationSet(rules: [cardexpValidation])).isEmpty)
Expand Down Expand Up @@ -292,7 +292,7 @@ class skyflow_iOS_elementTests: XCTestCase {
let yearValidation = SkyflowValidateExpirationYear(format: "yy", error: SkyflowValidationErrorType.expirationYear.rawValue)

XCTAssertFalse(yearValidation.validate("234"))
XCTAssertTrue(yearValidation.validate("23"))
XCTAssertTrue(yearValidation.validate("27"))

}

Expand Down
19 changes: 15 additions & 4 deletions Tests/skyflow-iOS-utilTests/skyflow_iOS_getUtilTests.swift
Expand Up @@ -135,12 +135,23 @@ final class skyflow_iOS_getUtilTests: XCTestCase {
self.getApiCallback.connectionUrl = "https://example.org"
let urlComponents = self.getApiCallback.getUrlComponents(record: record, getOptions: GetOptions(tokens: false))!

XCTAssertEqual(urlComponents.queryItems?.count, 5)
XCTAssertEqual(urlComponents.queryItems?.count, 4)
XCTAssertEqual(urlComponents.queryItems![0], URLQueryItem(name: "column_name", value: "col"))
XCTAssertEqual(urlComponents.queryItems![1], URLQueryItem(name: "column_values", value: "1"))
XCTAssertEqual(urlComponents.queryItems![2], URLQueryItem(name: "column_name", value: "col"))
XCTAssertEqual(urlComponents.queryItems![3], URLQueryItem(name: "column_values", value: "2"))
XCTAssertEqual(urlComponents.queryItems![4], URLQueryItem(name: "redaction", value: RedactionType.PLAIN_TEXT.rawValue))
XCTAssertEqual(urlComponents.queryItems![2], URLQueryItem(name: "column_values", value: "2"))
XCTAssertEqual(urlComponents.queryItems![3], URLQueryItem(name: "redaction", value: RedactionType.PLAIN_TEXT.rawValue))
XCTAssertEqual(urlComponents.url?.path, "/table")
}
func testGetUrlComponentsColumnRecordWithSameValues() {
let record = GetRecord(columnValues: ["1","1"], table: "table", columnName: "col", redaction: RedactionType.PLAIN_TEXT.rawValue)
self.getApiCallback.connectionUrl = "https://example.org"
let urlComponents = self.getApiCallback.getUrlComponents(record: record, getOptions: GetOptions(tokens: false))!

XCTAssertEqual(urlComponents.queryItems?.count, 4)
XCTAssertEqual(urlComponents.queryItems![0], URLQueryItem(name: "column_name", value: "col"))
XCTAssertEqual(urlComponents.queryItems![1], URLQueryItem(name: "column_values", value: "1"))
XCTAssertEqual(urlComponents.queryItems![2], URLQueryItem(name: "column_values", value: "1"))
XCTAssertEqual(urlComponents.queryItems![3], URLQueryItem(name: "redaction", value: RedactionType.PLAIN_TEXT.rawValue))
XCTAssertEqual(urlComponents.url?.path, "/table")
}
func testConstructError() {
Expand Down

0 comments on commit 45c6798

Please sign in to comment.