Skip to content

Commit

Permalink
Merge pull request #6 from intrinio/v2.8.1
Browse files Browse the repository at this point in the history
v2.8.1
  • Loading branch information
Joey French committed Jul 14, 2017
2 parents 4699e37 + 3da1596 commit 136b3d8
Show file tree
Hide file tree
Showing 19 changed files with 54 additions and 70 deletions.
Binary file modified Intrinio_Excel_Addin.xlam
Binary file not shown.
16 changes: 0 additions & 16 deletions lib/VBA-Dictionary/.gitattributes

This file was deleted.

6 changes: 0 additions & 6 deletions lib/VBA-Dictionary/.gitignore

This file was deleted.

16 changes: 0 additions & 16 deletions lib/VBA-Web/.gitattributes

This file was deleted.

17 changes: 0 additions & 17 deletions lib/VBA-Web/.gitignore

This file was deleted.

2 changes: 2 additions & 0 deletions lib/VBA-Web/CHANGELOG.md
Expand Up @@ -9,6 +9,8 @@
- `UrlEncodingMode.PathUrlEncoding` uses "pchar" from [RFC 3986](https://tools.ietf.org/html/rfc3986) and is the default
- Update VBA-JSON to v2.2.2
- __4.1.1__ Adjust `CookieUrlEncoding` mode to match value encoding in RFC 6265 (rather than name encoding)
- __4.1.2__ Compatibility with 64-bit Mac
- __4.1.3__ Mac bugfix for % encoding

# 4.0.0

Expand Down
2 changes: 1 addition & 1 deletion lib/VBA-Web/README.md
Expand Up @@ -6,7 +6,7 @@ VBA-Web (formerly Excel-REST) makes working with complex webservices and APIs ea
Getting started
---------------

- Download the [latest release (v4.1.2)](https://github.com/VBA-tools/VBA-Web/releases)
- Download the [latest release (v4.1.3)](https://github.com/VBA-tools/VBA-Web/releases)
- To install/upgrade in an existing file, use `VBA-Web - Installer.xlsm`
- To start from scratch in Excel, `VBA-Web - Blank.xlsm` has everything setup and ready to go

Expand Down
Binary file modified lib/VBA-Web/VBA-Web - Blank.xlsm
Binary file not shown.
Binary file modified lib/VBA-Web/VBA-Web - Installer.xlsm
Binary file not shown.
Binary file modified lib/VBA-Web/examples/VBA-Web - Example.xlsm
Binary file not shown.
Binary file modified lib/VBA-Web/specs/VBA-Web - Specs - Async.xlsm
Binary file not shown.
Binary file modified lib/VBA-Web/specs/VBA-Web - Specs.xlsm
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/VBA-Web/src/IWebAuthenticator.cls
Expand Up @@ -8,7 +8,7 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
''
' IWebAuthenticator v4.1.2
' IWebAuthenticator v4.1.3
' (c) Tim Hall - https://github.com/VBA-tools/VBA-Web
'
' Interface for creating authenticators for rest client
Expand Down
2 changes: 1 addition & 1 deletion lib/VBA-Web/src/WebAsyncWrapper.cls
Expand Up @@ -8,7 +8,7 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
''
' WebAsyncWrapper v4.1.2
' WebAsyncWrapper v4.1.3
' (c) Tim Hall - https://github.com/VBA-tools/VBA-Web
'
' Wrapper WebClient and WebRequest that enables callback-style async requests
Expand Down
2 changes: 1 addition & 1 deletion lib/VBA-Web/src/WebClient.cls
Expand Up @@ -8,7 +8,7 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
''
' WebClient v4.1.2
' WebClient v4.1.3
' (c) Tim Hall - https://github.com/VBA-tools/VBA-Web
'
' `WebClient` executes requests and handles response and is responsible for functionality shared between requests,
Expand Down
49 changes: 43 additions & 6 deletions lib/VBA-Web/src/WebHelpers.bas
@@ -1,6 +1,6 @@
Attribute VB_Name = "WebHelpers"
''
' WebHelpers v4.1.2
' WebHelpers v4.1.3
' (c) Tim Hall - https://github.com/VBA-tools/VBA-Web
'
' Contains general-purpose helpers that are used throughout VBA-Web. Includes:
Expand Down Expand Up @@ -281,7 +281,7 @@ Private Declare Function web_feof Lib "libc.dylib" Alias "feof" (ByVal web_File
#End If
#End If

Public Const WebUserAgent As String = "VBA-Web v4.1.2 (https://github.com/VBA-tools/VBA-Web)"
Public Const WebUserAgent As String = "VBA-Web v4.1.3 (https://github.com/VBA-tools/VBA-Web)"

' @internal
Public Type ShellResult
Expand Down Expand Up @@ -1080,7 +1080,7 @@ End Function
Public Function Base64Encode(Text As String) As String
#If Mac Then
Dim web_Command As String
web_Command = "printf " & PrepareTextForShell(Text) & " | openssl base64"
web_Command = "printf " & PrepareTextForPrintf(Text) & " | openssl base64"
Base64Encode = ExecuteInShell(web_Command).Output
#Else
Dim web_Bytes() As Byte
Expand Down Expand Up @@ -1699,6 +1699,43 @@ Public Function PrepareTextForShell(ByVal web_Text As String) As String
PrepareTextForShell = web_Text
End Function

''
' Prepare text for using with printf command
' - Wrap in "..."
' - Replace ! with '!' (reserved in bash)
' - Escape \, `, $, and "
' - Replace % with %% (used as an argument marker in printf)
'
' @internal
' @method PrepareTextForPrintf
' @param {String} Text
' @return {String}
''
Public Function PrepareTextForPrintf(ByVal web_Text As String) As String
' Escape special characters (except for !)
web_Text = VBA.Replace(web_Text, "\", "\\")
web_Text = VBA.Replace(web_Text, "`", "\`")
web_Text = VBA.Replace(web_Text, "$", "\$")
web_Text = VBA.Replace(web_Text, "%", "%%")
web_Text = VBA.Replace(web_Text, """", "\""")

' Wrap in quotes
web_Text = """" & web_Text & """"

' Escape !
web_Text = VBA.Replace(web_Text, "!", """'!'""")

' Guard for ! at beginning or end (""'!'"..." or "..."'!'"" -> '!'"..." or "..."'!')
If VBA.Left$(web_Text, 3) = """""'" Then
web_Text = VBA.Right$(web_Text, VBA.Len(web_Text) - 2)
End If
If VBA.Right$(web_Text, 3) = "'""""" Then
web_Text = VBA.Left$(web_Text, VBA.Len(web_Text) - 2)
End If

PrepareTextForPrintf = web_Text
End Function

' ============================================= '
' 8. Cryptography
' ============================================= '
Expand All @@ -1724,7 +1761,7 @@ End Function
Public Function HMACSHA1(Text As String, Secret As String, Optional Format As String = "Hex") As String
#If Mac Then
Dim web_Command As String
web_Command = "printf " & PrepareTextForShell(Text) & " | openssl dgst -sha1 -hmac " & PrepareTextForShell(Secret)
web_Command = "printf " & PrepareTextForPrintf(Text) & " | openssl dgst -sha1 -hmac " & PrepareTextForShell(Secret)

If Format = "Base64" Then
web_Command = web_Command & " -binary | openssl enc -base64"
Expand Down Expand Up @@ -1771,7 +1808,7 @@ End Function
Public Function HMACSHA256(Text As String, Secret As String, Optional Format As String = "Hex") As String
#If Mac Then
Dim web_Command As String
web_Command = "printf " & PrepareTextForShell(Text) & " | openssl dgst -sha256 -hmac " & PrepareTextForShell(Secret)
web_Command = "printf " & PrepareTextForPrintf(Text) & " | openssl dgst -sha256 -hmac " & PrepareTextForShell(Secret)

If Format = "Base64" Then
web_Command = web_Command & " -binary | openssl enc -base64"
Expand Down Expand Up @@ -1820,7 +1857,7 @@ End Function
Public Function MD5(Text As String, Optional Format As String = "Hex") As String
#If Mac Then
Dim web_Command As String
web_Command = "printf " & PrepareTextForShell(Text) & " | openssl dgst -md5"
web_Command = "printf " & PrepareTextForPrintf(Text) & " | openssl dgst -md5"

If Format = "Base64" Then
web_Command = web_Command & " -binary | openssl enc -base64"
Expand Down
2 changes: 1 addition & 1 deletion lib/VBA-Web/src/WebRequest.cls
Expand Up @@ -8,7 +8,7 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
''
' WebRequest v4.1.2
' WebRequest v4.1.3
' (c) Tim Hall - https://github.com/VBA-tools/VBA-Web
'
' `WebRequest` is used to create detailed requests
Expand Down
2 changes: 1 addition & 1 deletion lib/VBA-Web/src/WebResponse.cls
Expand Up @@ -8,7 +8,7 @@ Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
''
' WebResponse v4.1.2
' WebResponse v4.1.3
' (c) Tim Hall - https://github.com/VBA-tools/VBA-Web
'
' Wrapper for http/cURL responses that includes parsed Data based on WebRequest.ResponseFormat.
Expand Down
6 changes: 3 additions & 3 deletions src/Intrinio.bas
Expand Up @@ -29,7 +29,7 @@ Private UpdatePrompt As Boolean
Private APICallsAtLimit As Boolean

Public Const BaseUrl = "https://api.intrinio.com"
Public Const Intrinio_Addin_Version = "2.8.0"
Public Const Intrinio_Addin_Version = "2.8.1"

Public Sub IntrinioInitialize()

Expand Down Expand Up @@ -462,7 +462,7 @@ Attribute IntrinioDataPoint.VB_ProcData.VB_Invoke_Func = " \n19"
identifier = VBA.UCase(identifier)

If identifier <> "" And LoginFailure = False Then
coFailure = InvalidIdentifier(identifier, item)
coFailure = InvalidIdentifier(identifier, Item)
End If

If identifier <> "" And LoginFailure = False And APICallsAtLimit = False And coFailure = False Then
Expand Down Expand Up @@ -1033,7 +1033,7 @@ Attribute IHD.VB_ProcData.VB_Invoke_Func = " \n19"
ticker = VBA.UCase(ticker)

If ticker <> "" And LoginFailure = False And APICallsAtLimit = False Then
coFailure = InvalidIdentifier(ticker, item)
coFailure = InvalidIdentifier(ticker, Item)
End If

If ticker <> "" And Item <> "" And LoginFailure = False And APICallsAtLimit = False And coFailure = False Then
Expand Down

0 comments on commit 136b3d8

Please sign in to comment.