Skip to content

Commit 551c2fd

Browse files
Merge pull request #86 from StevenMMortimer/dev
Version bump, no need to wait for dplyr
2 parents 6b2d10d + c979e35 commit 551c2fd

File tree

343 files changed

+4319
-1102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

343 files changed

+4319
-1102
lines changed

DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: salesforcer
22
Title: An Implementation of 'Salesforce' APIs Using Tidy Principles
3-
Version: 0.2.0.9000
4-
Date: 2020-08-17
3+
Version: 0.2.1
4+
Date: 2020-08-21
55
Description: Functions connecting to the 'Salesforce' Platform APIs (REST, SOAP,
66
Bulk 1.0, Bulk 2.0, Metadata, Reports and Dashboards)
77
<https://trailhead.salesforce.com/en/content/learn/modules/api_basics/api_basics_overview>.

NEWS.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
## salesforcer 0.2.0.9000
1+
## salesforcer 0.2.1
22

33
### Dependencies
44

55
* **CAUTION: This release requires {dplyr 1.0.0} because {dplyr 1.0.1} introduced
66
a bug in `bind_rows()` with how it binds lists where the list elements have differing
77
lengths. This is documented in tidyverse/dplyr#5417 and r-lib/vctrs#1073. The
8-
timeline for a fix is unknown as of Aug 16, 2020.**
8+
timeline for a fix is unknown as of Aug 16, 2020.** You can install the older
9+
version of {dplyr} using the following command:
10+
11+
```r
12+
remotes::install_version("dplyr", "1.0.0")
13+
```
914

1015
### Features
1116

R/bulk-operation.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ sf_create_job_bulk <- function(operation = c("insert", "delete", "upsert", "upda
7272
control_args$operation <- operation
7373

7474
if(is_present(line_ending)) {
75-
deprecate_warn("0.1.3", "sf_create_job_bulk(line_ending = )", "sf_create_job_bulk(LineEndingHeader = )",
75+
deprecate_warn("0.1.3", "salesforcer::sf_create_job_bulk(line_ending = )",
76+
"sf_create_job_bulk(LineEndingHeader = )",
7677
details = paste0("You can pass the line ending directly ",
7778
"as shown above or via the `control` argument."))
7879
control_args$LineEndingHeader <- list(`Sforce-Line-Ending` = line_ending)

R/compatibility.R

+12-12
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#' @export
3838
rforcecom.login <- function(username, password, loginURL="https://login.salesforce.com/", apiVersion="35.0"){
3939

40-
deprecate_soft("0.1.0", "rforcecom.login()", "sf_auth()")
40+
deprecate_soft("0.1.0", "salesforcer::rforcecom.login()", "sf_auth()")
4141

4242
if(!is.null(loginURL)){
4343
options(salesforcer.login_url = loginURL)
@@ -70,7 +70,7 @@ rforcecom.login <- function(username, password, loginURL="https://login.salesfor
7070
#' @export
7171
rforcecom.getServerTimestamp <- function(session){
7272

73-
deprecate_soft("0.1.0", "rforcecom.getServerTimestamp()", "sf_server_timestamp()")
73+
deprecate_soft("0.1.0", "salesforcer::rforcecom.getServerTimestamp()", "sf_server_timestamp()")
7474

7575
result <- sf_server_timestamp()
7676
# format like rforcecom.getServerTimestamp()
@@ -92,7 +92,7 @@ rforcecom.getServerTimestamp <- function(session){
9292
#' @export
9393
rforcecom.getObjectDescription <- function(session, objectName){
9494

95-
deprecate_soft("0.1.0", "rforcecom.getObjectDescription()", "sf_describe_objects()")
95+
deprecate_soft("0.1.0", "salesforcer::rforcecom.getObjectDescription()", "sf_describe_objects()")
9696

9797
obj_dat <- sf_describe_objects(object_names = objectName,
9898
api_type="SOAP")[[1]]
@@ -117,7 +117,7 @@ rforcecom.getObjectDescription <- function(session, objectName){
117117
#' @export
118118
rforcecom.create <- function(session, objectName, fields){
119119

120-
deprecate_soft("0.1.0", "rforcecom.create()", "sf_create()")
120+
deprecate_soft("0.1.0", "salesforcer::rforcecom.create()", "sf_create()")
121121

122122
fields <- as.data.frame(as.list(fields), stringsAsFactors = FALSE)
123123
created_records <- sf_create(input_data = fields, object_name = objectName)
@@ -155,7 +155,7 @@ rforcecom.retrieve <- function(session, objectName,
155155
offset=NULL, order=NULL,
156156
inverse=NULL, nullsLast=NULL){
157157

158-
deprecate_soft("0.1.0", "rforcecom.retrieve()", "sf_retrieve()")
158+
deprecate_soft("0.1.0", "salesforcer::rforcecom.retrieve()", "sf_retrieve()")
159159

160160
# Make SOQL
161161
fieldList <- paste(fields, collapse=", ")
@@ -208,7 +208,7 @@ rforcecom.retrieve <- function(session, objectName,
208208
#' @export
209209
rforcecom.update <- function(session, objectName, id, fields){
210210

211-
deprecate_soft("0.1.0", "rforcecom.update()", "sf_update()")
211+
deprecate_soft("0.1.0", "salesforcer::rforcecom.update()", "sf_update()")
212212

213213
fields <- as.data.frame(as.list(fields), stringsAsFactors = FALSE)
214214
fields$id <- id
@@ -230,7 +230,7 @@ rforcecom.update <- function(session, objectName, id, fields){
230230
#' @export
231231
rforcecom.delete <- function(session, objectName, id){
232232

233-
deprecate_soft("0.1.0", "rforcecom.delete()", "sf_delete()")
233+
deprecate_soft("0.1.0", "salesforcer::rforcecom.delete()", "sf_delete()")
234234

235235
invisible(sf_delete(id, object_name = objectName))
236236
# rforcecom.delete returns NULL if successful??
@@ -254,7 +254,7 @@ rforcecom.upsert <- function(session, objectName,
254254
externalIdField, externalId,
255255
fields){
256256

257-
deprecate_soft("0.1.0", "rforcecom.upsert()", "sf_upsert()")
257+
deprecate_soft("0.1.0", "salesforcer::rforcecom.upsert()", "sf_upsert()")
258258

259259
fields[externalIdField] <- externalId
260260
fields <- as.data.frame(as.list(fields), stringsAsFactors = FALSE)
@@ -276,7 +276,7 @@ rforcecom.upsert <- function(session, objectName,
276276
#' @export
277277
rforcecom.search <- function(session, queryString){
278278

279-
deprecate_soft("0.1.0", "rforcecom.search()", "sf_search()")
279+
deprecate_soft("0.1.0", "salesforcer::rforcecom.search()", "sf_search()")
280280

281281
queryString <- paste0("FIND {", queryString, "}", sep="")
282282
resultset <- sf_search(search_string = queryString, is_sosl=TRUE)
@@ -297,7 +297,7 @@ rforcecom.search <- function(session, queryString){
297297
#' @export
298298
rforcecom.query <- function(session, soqlQuery, queryAll=FALSE){
299299

300-
deprecate_soft("0.1.0", "rforcecom.query()", "sf_query()")
300+
deprecate_soft("0.1.0", "salesforcer::rforcecom.query()", "sf_query()")
301301

302302
sf_query(soql=soqlQuery, queryall=queryAll)
303303
}
@@ -324,7 +324,7 @@ rforcecom.bulkQuery <- function(session,
324324
max_attempts=100,
325325
verbose=FALSE){
326326

327-
deprecate_soft("0.1.0", "rforcecom.bulkQuery()", "sf_query()")
327+
deprecate_soft("0.1.0", "salesforcer::rforcecom.bulkQuery()", "sf_query()")
328328

329329
sf_query(soql = soqlQuery,
330330
object_name = object,
@@ -375,7 +375,7 @@ rforcecom.bulkAction <- function(session,
375375
max_attempts=100,
376376
verbose=FALSE){
377377

378-
deprecate_soft("0.1.0", "rforcecom.bulkAction()", "sf_bulk_operation()")
378+
deprecate_soft("0.1.0", "salesforcer::rforcecom.bulkAction()", "sf_bulk_operation()")
379379

380380
operation <- match.arg(operation)
381381
res <- sf_bulk_operation(input_data = data,

R/create-metadata.R

+1-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ sf_create_metadata <- function(metadata_type,
9090
control_args$operation <- "insert"
9191

9292
if(is_present(all_or_none)) {
93-
deprecate_warn("0.1.3",
94-
"sf_create_metadata(all_or_none = )",
93+
deprecate_warn("0.1.3", "salesforcer::sf_create_metadata(all_or_none = )",
9594
"sf_create_metadata(AllOrNoneHeader = )",
9695
details = paste0("You can pass the all or none header directly ",
9796
"as shown above or via the `control` argument."))

R/create.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ sf_create <- function(input_data,
5252
control_args$operation <- "insert"
5353

5454
if(is_present(all_or_none)) {
55-
deprecate_warn("0.1.3", "sf_create(all_or_none = )", "sf_create(AllOrNoneHeader = )",
55+
deprecate_warn("0.1.3", "salesforcer::sf_create(all_or_none = )",
56+
"sf_create(AllOrNoneHeader = )",
5657
details = paste0("You can pass the all or none header directly ",
5758
"as shown above or via the `control` argument."))
5859
control_args$AllOrNoneHeader <- list(allOrNone = tolower(all_or_none))

R/delete-metadata.R

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ sf_delete_metadata <- function(metadata_type,
4242
control_args$operation <- "delete"
4343

4444
if(is_present(all_or_none)) {
45-
deprecate_warn("0.1.3",
46-
"sf_delete_metadata(all_or_none = )",
45+
deprecate_warn("0.1.3", "salesforcer::sf_delete_metadata(all_or_none = )",
4746
"sf_delete_metadata(AllOrNoneHeader = )",
4847
details = paste0("You can pass the all or none header directly ",
4948
"as shown above or via the `control` argument."))

R/delete.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ sf_delete <- function(ids,
5353
control_args$operation <- "delete"
5454

5555
if(is_present(all_or_none)) {
56-
deprecate_warn("0.1.3", "sf_delete(all_or_none = )", "sf_delete(AllOrNoneHeader = )",
56+
deprecate_warn("0.1.3", "salesforcer::sf_delete(all_or_none = )",
57+
"sf_delete(AllOrNoneHeader = )",
5758
details = paste0("You can pass the all or none header directly ",
5859
"as shown above or via the `control` argument."))
5960
control_args$AllOrNoneHeader <- list(allOrNone = tolower(all_or_none))

R/query.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ sf_query <- function(soql,
6161
control_args$operation <- if(queryall) "queryall" else "query"
6262

6363
if(is_present(page_size)) {
64-
deprecate_warn("0.1.3", "sf_query(page_size = )", "sf_query(QueryOptions = )",
64+
deprecate_warn("0.1.3", "salesforcer::sf_query(page_size = )",
65+
"sf_query(QueryOptions = )",
6566
details = paste0("You can pass the page/batch size directly ",
6667
"as shown above or via the `control` argument."))
6768
control_args$QueryOptions <- list(batchSize = as.integer(page_size))

R/update-metadata.R

+1-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ sf_update_metadata <- function(metadata_type,
6565
control_args$operation <- "update"
6666

6767
if(is_present(all_or_none)) {
68-
deprecate_warn("0.1.3",
69-
"sf_update_metadata(all_or_none = )",
68+
deprecate_warn("0.1.3", "salesforcer::sf_update_metadata(all_or_none = )",
7069
"sf_update_metadata(AllOrNoneHeader = )",
7170
details = paste0("You can pass the all or none header directly ",
7271
"as shown above or via the `control` argument."))

R/update.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ sf_update <- function(input_data,
4949
control_args$operation <- "update"
5050

5151
if(is_present(all_or_none)) {
52-
deprecate_warn("0.1.3", "sf_update(all_or_none = )", "sf_update(AllOrNoneHeader = )",
52+
deprecate_warn("0.1.3", "salesforcer::sf_update(all_or_none = )",
53+
"sf_update(AllOrNoneHeader = )",
5354
details = paste0("You can pass the all or none header directly ",
5455
"as shown above or via the `control` argument."))
5556
control_args$AllOrNoneHeader <- list(allOrNone = tolower(all_or_none))

R/upsert-metadata.R

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ sf_upsert_metadata <- function(metadata_type,
6868
control_args$operation <- "upsert"
6969

7070
if(is_present(all_or_none)) {
71-
deprecate_warn("0.1.3",
72-
"sf_upsert_metadata(all_or_none = )",
71+
deprecate_warn("0.1.3", "salesforcer::sf_upsert_metadata(all_or_none = )",
7372
"sf_upsert_metadata(AllOrNoneHeader = )",
7473
details = paste0("You can pass the all or none header directly ",
7574
"as shown above or via the `control` argument."))

R/upsert.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ sf_upsert <- function(input_data,
5555
control_args$operation <- "upsert"
5656

5757
if(is_present(all_or_none)) {
58-
deprecate_warn("0.1.3", "sf_upsert(all_or_none = )", "sf_upsert(AllOrNoneHeader = )",
58+
deprecate_warn("0.1.3", "salesforcer::sf_upsert(all_or_none = )",
59+
"sf_upsert(AllOrNoneHeader = )",
5960
details = paste0("You can pass the all or none header directly ",
6061
"as shown above or via the `control` argument."))
6162
control_args$AllOrNoneHeader <- list(allOrNone = tolower(all_or_none))

R/utils-query.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ records_list_to_tbl <- function(x,
672672
bind_query_resultsets <- function(resultset, next_records){
673673

674674
# HOLD ON INTRODUCING THIS BECAUSE IT CREATES A {{data.table}} DEPENDENCY
675-
# deprecate_warn("0.2.1", "bind_query_resultsets()", "safe_bind_rows()",
675+
# deprecate_warn("0.2.1", "salesforcer::bind_query_resultsets()", "safe_bind_rows()",
676676
# details = paste0("Consider safe_bind_rows() which silently combines ",
677677
# "all columns regardless if there are mixed datatypes ",
678678
# "in a single column."))

README.Rmd

+18-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ options(tibble.print_min = 5L, tibble.print_max = 5L)
2020
[![CRAN Status](https://www.r-pkg.org/badges/version/salesforcer)](https://cran.r-project.org/package=salesforcer)
2121
[![Lifecycle: Maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
2222
[![Monthly Downloads](https://cranlogs.r-pkg.org/badges/last-month/salesforcer)](https://cran.r-project.org/package=salesforcer)
23-
[![Coverage Status](https://codecov.io/gh/StevenMMortimer/salesforcer/branch/master/graph/badge.svg)](https://codecov.io/gh/StevenMMortimer/salesforcer?branch=master)
23+
[![Coverage Status](https://codecov.io/gh/StevenMMortimer/salesforcer/branch/main/graph/badge.svg)](https://codecov.io/gh/StevenMMortimer/salesforcer?branch=main)
2424
<!-- badges: end -->
2525

2626
{salesforcer} is an R package that connects to Salesforce Platform APIs using
@@ -50,7 +50,22 @@ Package features include:
5050
and list ids of records deleted (`sf_get_deleted()`) or updated (`sf_get_updated()`)
5151
within a specific timeframe
5252
* Passing API call control parameters such as, "All or None", "Duplicate Rule",
53-
"Assignment Rule" execution and many more!
53+
"Assignment Rule" execution and many more!
54+
55+
**CAUTION: The most recent release, {salesforcer 0.2.1}, requires {dplyr 1.0.0}
56+
because {dplyr 1.0.1} introduced a bug in `bind_rows()` with how it binds
57+
lists where the list elements have differing lengths. This is documented in
58+
tidyverse/dplyr#5417 and r-lib/vctrs#1073. The timeline for a fix is unknown as
59+
of August 2020, but a new version of {salesforcer} (0.2.2) will be released
60+
immediately following the {dplyr} fix.**
61+
62+
You can install the older version of {dplyr} using the following command:
63+
64+
```r
65+
# remove.packages("dplyr")
66+
# install.packages("remotes")
67+
remotes::install_version("dplyr", "1.0.0")
68+
```
5469

5570
## Table of Contents
5671
* [Installation](#installation)
@@ -69,7 +84,7 @@ Package features include:
6984
## Installation
7085

7186
```{r, eval = FALSE}
72-
# install the current CRAN version (0.2.0)
87+
# install the current CRAN version (0.2.1)
7388
install.packages("salesforcer")
7489
7590
# or get the development version on GitHub

README.md

+31-14
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www
1212
[![Monthly
1313
Downloads](https://cranlogs.r-pkg.org/badges/last-month/salesforcer)](https://cran.r-project.org/package=salesforcer)
1414
[![Coverage
15-
Status](https://codecov.io/gh/StevenMMortimer/salesforcer/branch/master/graph/badge.svg)](https://codecov.io/gh/StevenMMortimer/salesforcer?branch=master)
15+
Status](https://codecov.io/gh/StevenMMortimer/salesforcer/branch/main/graph/badge.svg)](https://codecov.io/gh/StevenMMortimer/salesforcer?branch=main)
1616
<!-- badges: end -->
1717

1818
{salesforcer} is an R package that connects to Salesforce Platform APIs
@@ -51,6 +51,23 @@ Package features include:
5151
- Passing API call control parameters such as, “All or None”,
5252
“Duplicate Rule”, “Assignment Rule” execution and many more\!
5353

54+
**CAUTION: The most recent release, {salesforcer 0.2.1}, requires {dplyr
55+
1.0.0} because {dplyr 1.0.1} introduced a bug in `bind_rows()` with how
56+
it binds lists where the list elements have differing lengths. This is
57+
documented in tidyverse/dplyr\#5417 and r-lib/vctrs\#1073. The timeline
58+
for a fix is unknown as of August 2020, but a new version of
59+
{salesforcer} (0.2.2) will be released immediately following the {dplyr}
60+
fix.**
61+
62+
You can install the older version of {dplyr} using the following
63+
command:
64+
65+
``` r
66+
# remove.packages("dplyr")
67+
# install.packages("remotes")
68+
remotes::install_version("dplyr", "1.0.0")
69+
```
70+
5471
## Table of Contents
5572

5673
- [Installation](#installation)
@@ -69,7 +86,7 @@ Package features include:
6986
## Installation
7087

7188
``` r
72-
# install the current CRAN version (0.2.0)
89+
# install the current CRAN version (0.2.1)
7390
install.packages("salesforcer")
7491

7592
# or get the development version on GitHub
@@ -168,8 +185,8 @@ created_records
168185
#> # A tibble: 2 x 2
169186
#> id success
170187
#> <chr> <lgl>
171-
#> 1 0033s000013wZZ3AAM TRUE
172-
#> 2 0033s000013wZZ4AAM TRUE
188+
#> 1 0033s0000149YhZAAU TRUE
189+
#> 2 0033s0000149YhaAAE TRUE
173190
```
174191

175192
### Query
@@ -194,8 +211,8 @@ queried_records
194211
#> # A tibble: 2 x 3
195212
#> Id FirstName LastName
196213
#> <chr> <chr> <chr>
197-
#> 1 0033s000013wZZ3AAM Test Contact-Create-1
198-
#> 2 0033s000013wZZ4AAM Test Contact-Create-2
214+
#> 1 0033s0000149YhZAAU Test Contact-Create-1
215+
#> 2 0033s0000149YhaAAE Test Contact-Create-2
199216
```
200217

201218
**NOTE**: In the example above, you’ll notice that the `"Account.Name"`
@@ -232,8 +249,8 @@ updated_records
232249
#> # A tibble: 2 x 2
233250
#> id success
234251
#> <chr> <lgl>
235-
#> 1 0033s000013wZZ3AAM TRUE
236-
#> 2 0033s000013wZZ4AAM TRUE
252+
#> 1 0033s0000149YhZAAU TRUE
253+
#> 2 0033s0000149YhaAAE TRUE
237254
```
238255

239256
### Bulk Operations
@@ -270,8 +287,8 @@ created_records
270287
#> # A tibble: 2 x 4
271288
#> Id Success Created Error
272289
#> <chr> <lgl> <lgl> <lgl>
273-
#> 1 0033s000013wZXhAAM TRUE TRUE NA
274-
#> 2 0033s000013wZXiAAM TRUE TRUE NA
290+
#> 1 0033s0000149YheAAE TRUE TRUE NA
291+
#> 2 0033s0000149YhfAAE TRUE TRUE NA
275292

276293
# query large recordsets using the Bulk API
277294
my_soql <- sprintf("SELECT Id,
@@ -286,17 +303,17 @@ queried_records
286303
#> # A tibble: 2 x 3
287304
#> Id FirstName LastName
288305
#> <chr> <chr> <chr>
289-
#> 1 0033s000013wZXhAAM Test Contact-Create-1
290-
#> 2 0033s000013wZXiAAM Test Contact-Create-2
306+
#> 1 0033s0000149YheAAE Test Contact-Create-1
307+
#> 2 0033s0000149YhfAAE Test Contact-Create-2
291308

292309
# delete these records using the Bulk 2.0 API
293310
deleted_records <- sf_delete(queried_records$Id, "Contact", api_type = "Bulk 2.0")
294311
deleted_records
295312
#> # A tibble: 2 x 4
296313
#> Id sf__Id sf__Created sf__Error
297314
#> <chr> <chr> <lgl> <lgl>
298-
#> 1 0033s000013wZXhAAM 0033s000013wZXhAAM FALSE NA
299-
#> 2 0033s000013wZXiAAM 0033s000013wZXiAAM FALSE NA
315+
#> 1 0033s0000149YheAAE 0033s0000149YheAAE FALSE NA
316+
#> 2 0033s0000149YhfAAE 0033s0000149YhfAAE FALSE NA
300317
```
301318

302319
### Using the Metadata API

0 commit comments

Comments
 (0)