Skip to content

Commit

Permalink
Support aggregate query result (#95)
Browse files Browse the repository at this point in the history
* Support aggregate query result
* Adapt query tests to handle single or multiple result pages
  • Loading branch information
mike4aday authored Oct 11, 2018
1 parent f2aef7e commit 9b65f14
Show file tree
Hide file tree
Showing 12 changed files with 262 additions and 108 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Change Log

## Version 7.1.2 (Oct. 11, 2018)
Support aggregate query result. Resolves issue [issue #88](https://github.com/mike4aday/SwiftlySalesforce/issues/88).

## Version 7.1.1 (Oct. 11, 2018)
Adapt to Winter '19 date format change in `identity` JSON response. See [release notes](https://releasenotes.docs.salesforce.com/en-us/winter19/release-notes/rn_security_auth_json_value_endpoints.htm).
Resolves issue [issue #91](https://github.com/mike4aday/SwiftlySalesforce/issues/91)
Resolves issue [issue #91](https://github.com/mike4aday/SwiftlySalesforce/issues/91).

## Version 7.1.0 (Oct. 10, 2018)
Support OpenID Connect 'ID token.' Resolves issue [issue #92](https://github.com/mike4aday/SwiftlySalesforce/issues/92)
Support OpenID Connect 'ID token.' Resolves issue [issue #92](https://github.com/mike4aday/SwiftlySalesforce/issues/92).

## Version 7.0.4 (Oct. 5, 2018)
Updated podspec 'source_files' attribute to avoid Xcode 10 build errors.
Expand Down
4 changes: 2 additions & 2 deletions Example/Pods/Local Podspecs/SwiftlySalesforce.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Example/SwiftlySalesforce.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
EA223AD91F8DD532003DC025 /* MockContactMetadata.json in Resources */ = {isa = PBXBuildFile; fileRef = EA87A4BD1F8DD2C100C16580 /* MockContactMetadata.json */; };
EA34D068216FB0F7000ACBC6 /* MockAccountQueryResult.json in Resources */ = {isa = PBXBuildFile; fileRef = EA34D066216FB0AD000ACBC6 /* MockAccountQueryResult.json */; };
EA34D069216FB0FC000ACBC6 /* MockAccount.json in Resources */ = {isa = PBXBuildFile; fileRef = EA34D064216FB064000ACBC6 /* MockAccount.json */; };
EA34D06C216FB13F000ACBC6 /* MockAggregateQueryResult.json in Resources */ = {isa = PBXBuildFile; fileRef = EA34D06A216FB138000ACBC6 /* MockAggregateQueryResult.json */; };
EA3DA7E120E68F4800648FE0 /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EABD723A1DC0455C00790BCB /* MasterViewController.swift */; };
EA3DA7E220E68F4C00648FE0 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EABD723F1DC0455C00790BCB /* DetailViewController.swift */; };
EA57EBF320D2B7E300374451 /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA133DA91F91DC060055DC2F /* TestUtils.swift */; };
Expand Down Expand Up @@ -77,6 +80,9 @@
EA133DA91F91DC060055DC2F /* TestUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestUtils.swift; sourceTree = "<group>"; };
EA18C7A91C4404F800DAED6A /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; sourceTree = "<group>"; };
EA2399F720D1E93B00E7FF32 /* OrganizationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrganizationTests.swift; sourceTree = "<group>"; };
EA34D064216FB064000ACBC6 /* MockAccount.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = MockAccount.json; sourceTree = "<group>"; };
EA34D066216FB0AD000ACBC6 /* MockAccountQueryResult.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = MockAccountQueryResult.json; sourceTree = "<group>"; };
EA34D06A216FB138000ACBC6 /* MockAggregateQueryResult.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = MockAggregateQueryResult.json; sourceTree = "<group>"; };
EA62132120EAD6AC009F1C52 /* Salesforce_SearchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Salesforce_SearchTests.swift; sourceTree = "<group>"; };
EA62132520EADA3F009F1C52 /* Salesforce_SObjectTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Salesforce_SObjectTests.swift; sourceTree = "<group>"; };
EA62C6621F196E6600D6CF4E /* MockAccountMetadata.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = MockAccountMetadata.json; sourceTree = "<group>"; };
Expand Down Expand Up @@ -216,7 +222,10 @@
isa = PBXGroup;
children = (
EAAC9EB820D44F5500F0E16B /* Configuration.json */,
EA34D064216FB064000ACBC6 /* MockAccount.json */,
EA62C6621F196E6600D6CF4E /* MockAccountMetadata.json */,
EA34D066216FB0AD000ACBC6 /* MockAccountQueryResult.json */,
EA34D06A216FB138000ACBC6 /* MockAggregateQueryResult.json */,
EA87A4BD1F8DD2C100C16580 /* MockContactMetadata.json */,
EA62C6681F196E6600D6CF4E /* MockIdentityPreWinter19.json */,
EA99C043216F03E600FD8976 /* MockIdentityPostWinter19.json */,
Expand Down Expand Up @@ -363,8 +372,11 @@
buildActionMask = 2147483647;
files = (
EA99C045216F05F900FD8976 /* MockIdentityPostWinter19.json in Resources */,
EA34D068216FB0F7000ACBC6 /* MockAccountQueryResult.json in Resources */,
EA62C6781F196E7C00D6CF4E /* MockAccountMetadata.json in Resources */,
EA34D06C216FB13F000ACBC6 /* MockAggregateQueryResult.json in Resources */,
EA62C67E1F196E9500D6CF4E /* MockIdentityPreWinter19.json in Resources */,
EA34D069216FB0FC000ACBC6 /* MockAccount.json in Resources */,
EAAC9EB920D44F5500F0E16B /* Configuration.json in Resources */,
EA223AD91F8DD532003DC025 /* MockContactMetadata.json in Resources */,
);
Expand Down
75 changes: 75 additions & 0 deletions Example/Tests/MockAccount.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"attributes" : {
"type" : "Account",
"url" : "/services/data/v41.0/sobjects/Account/0011Y00002LZRxeQAH"
},
"Id" : "0011Y00002LZRxeQAH",
"IsDeleted" : false,
"MasterRecordId" : null,
"Name" : "Megacorp, Inc.",
"Type" : null,
"RecordTypeId" : null,
"ParentId" : null,
"BillingStreet" : null,
"BillingCity" : null,
"BillingState" : null,
"BillingPostalCode" : "55141",
"BillingCountry" : "US",
"BillingLatitude" : null,
"BillingLongitude" : null,
"BillingGeocodeAccuracy" : null,
"BillingAddress" : {
"city" : "Pleasant Prairie",
"country" : "US",
"geocodeAccuracy" : null,
"latitude" : null,
"longitude" : null,
"postalCode" : "55141",
"state" : "WI",
"street" : null
},
"ShippingStreet" : null,
"ShippingCity" : null,
"ShippingState" : null,
"ShippingPostalCode" : null,
"ShippingCountry" : null,
"ShippingLatitude" : null,
"ShippingLongitude" : null,
"ShippingGeocodeAccuracy" : null,
"ShippingAddress" : null,
"Phone" : null,
"Fax" : null,
"AccountNumber" : null,
"Website" : "https://www.megacorp.com",
"PhotoUrl" : "/services/images/photo/0011Y00002LZRxeQAH",
"Sic" : null,
"Industry" : null,
"AnnualRevenue" : 543210.0,
"NumberOfEmployees" : 12345,
"Ownership" : null,
"TickerSymbol" : null,
"Description" : null,
"Rating" : null,
"Site" : null,
"OwnerId" : "005i00000016PdaAAE",
"CreatedDate" : "2017-10-11T13:11:58.000+0000",
"CreatedById" : "005i00000016PdaAAE",
"LastModifiedDate" : "2017-10-11T13:11:58.000+0000",
"LastModifiedById" : "005i00000016PdaAAE",
"SystemModstamp" : "2017-10-12T00:02:54.000+0000",
"LastActivityDate" : null,
"LastViewedDate" : null,
"LastReferencedDate" : null,
"Jigsaw" : null,
"JigsawCompanyId" : null,
"AccountSource" : null,
"SicDesc" : null,
"playground__CustomerPriority__c" : null,
"playground__SLA__c" : null,
"playground__Active__c" : null,
"playground__NumberofLocations__c" : null,
"playground__UpsellOpportunity__c" : null,
"playground__SLASerialNumber__c" : null,
"playground__SLAExpirationDate__c" : null,
"playground__Owners_Manager_Name__c" : "User, Test",
}
89 changes: 89 additions & 0 deletions Example/Tests/MockAccountQueryResult.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"totalSize" : 12,
"done" : true,
"records" : [ {
"attributes" : {
"type" : "Account",
"url" : "/services/data/v44.0/sobjects/Account/001B000000oAiZ9IAK"
},
"Id" : "001B000000oAiW9IAK",
"Name" : "Edge Communications"
}, {
"attributes" : {
"type" : "Account",
"url" : "/services/data/v44.0/sobjects/Account/001B000000oAiZAIA0"
},
"Id" : "001B000000oAiWAIA0",
"Name" : "Burlington Textiles Corp of America"
}, {
"attributes" : {
"type" : "Account",
"url" : "/services/data/v44.0/sobjects/Account/001B000000oAiZBIA0"
},
"Id" : "001B000000oAiWBIA0",
"Name" : "Pyramid Construction Inc."
}, {
"attributes" : {
"type" : "Account",
"url" : "/services/data/v44.0/sobjects/Account/001B000000oAiZCIA0"
},
"Id" : "001B000000oAiWCIA0",
"Name" : "Dickenson plc"
}, {
"attributes" : {
"type" : "Account",
"url" : "/services/data/v44.0/sobjects/Account/001B000000oAiZDIA0"
},
"Id" : "001B000000oAiWDIA0",
"Name" : "Grand Hotels & Resorts Ltd"
}, {
"attributes" : {
"type" : "Account",
"url" : "/services/data/v44.0/sobjects/Account/001B000000oAiZEIA0"
},
"Id" : "001B000000oAiWEIA0",
"Name" : "United Oil & Gas Corp."
}, {
"attributes" : {
"type" : "Account",
"url" : "/services/data/v44.0/sobjects/Account/001B000000oAiZFIA0"
},
"Id" : "001B000000oAiWFIA0",
"Name" : "Express Logistics and Transport"
}, {
"attributes" : {
"type" : "Account",
"url" : "/services/data/v44.0/sobjects/Account/001B000000oAiZGIA0"
},
"Id" : "001B000000oAiWGIA0",
"Name" : "University of Arizona"
}, {
"attributes" : {
"type" : "Account",
"url" : "/services/data/v44.0/sobjects/Account/001B000000oAiZHIA0"
},
"Id" : "001B000000oAiWHIA0",
"Name" : "United Oil & Gas, UK"
}, {
"attributes" : {
"type" : "Account",
"url" : "/services/data/v44.0/sobjects/Account/001B000000oAiZIIA0"
},
"Id" : "001B000000oAiWIIA0",
"Name" : "United Oil & Gas, Singapore"
}, {
"attributes" : {
"type" : "Account",
"url" : "/services/data/v44.0/sobjects/Account/001B000000oAiZJIA0"
},
"Id" : "001B000000oAiWJIA0",
"Name" : "GenePoint"
}, {
"attributes" : {
"type" : "Account",
"url" : "/services/data/v44.0/sobjects/Account/001B000000oAiZKIA0"
},
"Id" : "001B000000oAiWKIA0",
"Name" : "sForce"
} ]
}
17 changes: 17 additions & 0 deletions Example/Tests/MockAggregateQueryResult.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"totalSize" : 2,
"done" : true,
"records" : [ {
"attributes" : {
"type" : "AggregateResult"
},
"AccountId" : "001B000000oAiZAIA0",
"expr0" : 2
}, {
"attributes" : {
"type" : "AggregateResult"
},
"AccountId" : "001B000000oAiZ9IAK",
"expr0" : 1
} ]
}
Loading

0 comments on commit 9b65f14

Please sign in to comment.