tla-sbuilder-salesforce 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -13
- data/VERSION +1 -1
- data/lib/sbuilder/sales_force_loader.rb +28 -10
- data/tla-sbuilder-salesforce.gemspec +2 -3
- metadata +5 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f20932bffc0e4abe5f38bb1a6b27cb2c3d900f69
|
4
|
+
data.tar.gz: 59605d71bb2dd6d26c120d6969836f173a063e99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e91f1b087aa8efba33b3a3f42e1860a47357e6dca259fd341180ddd22c06fbc15ad24fe5e8397a11434ee374e55709f5b3ec40dc768acbfb3e9de4a6d86fb9e1
|
7
|
+
data.tar.gz: c5fed995b9897d204d34ae2494752ac52e9bfc11612fbb141208d9390c8023e21c5c33d8d07da10e965b2b91f44005f232acc7bc6a581eb39fe3273844b9b1d2
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
[Up](../index.php) [Readme](README.html) [Releases](RELEASES.html) [Todo](TODO.html)
|
3
3
|
|
4
4
|
|
5
|
-
# tla-sbuilder-salesforce - Salesforce API interface loader (for tla-sbuilder) - $Release:0.0.
|
5
|
+
# tla-sbuilder-salesforce - Salesforce API interface loader (for tla-sbuilder) - $Release:0.0.2$
|
6
6
|
|
7
7
|
API loader plugin for
|
8
8
|
[Sbuilder](https://github.com/jarjuk/tla-sbuilder) to load Salasforce
|
@@ -91,8 +91,8 @@ of entries with the following properties:
|
|
91
91
|
* `sObject`: Salesforce sObject for the API operation
|
92
92
|
* `path`: REST entrypoint for the interface
|
93
93
|
* `action`: REST action (put, get, post, ..)
|
94
|
-
* `request`: name of request attribute
|
95
|
-
* `reply`: name of
|
94
|
+
* `request`: type name (sObject) of request attribute
|
95
|
+
* `reply`: type name (sObject) of reply attribute
|
96
96
|
|
97
97
|
|
98
98
|
For example, to access Salasesforce sObjects `Lead` and `Account` use
|
@@ -101,20 +101,14 @@ configuration:
|
|
101
101
|
- sObject: Account
|
102
102
|
path: /sf/account
|
103
103
|
action: get
|
104
|
-
request:
|
105
|
-
reply:
|
104
|
+
request: Account
|
105
|
+
reply: Account
|
106
106
|
|
107
107
|
- sObject: Lead
|
108
108
|
path: /sf/lead
|
109
109
|
action: post
|
110
|
-
request:
|
111
|
-
reply:
|
112
|
-
|
113
|
-
- sObject: Lead
|
114
|
-
path: /sf/lead
|
115
|
-
action: put
|
116
|
-
request: account
|
117
|
-
reply: account
|
110
|
+
request: Account
|
111
|
+
reply: Account
|
118
112
|
|
119
113
|
## License
|
120
114
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
@@ -36,6 +36,7 @@ module Sbuilder
|
|
36
36
|
Config.configuration.logger = lambda do |progname|
|
37
37
|
facade.createLogger( progname )
|
38
38
|
end
|
39
|
+
@logger.info "#{__method__} logger set"
|
39
40
|
end
|
40
41
|
|
41
42
|
# ------------------------------------------------------------------
|
@@ -64,11 +65,8 @@ module Sbuilder
|
|
64
65
|
def load( yamlFileUri )
|
65
66
|
logger.info( "#{__method__} yamlFileUri=#{yamlFileUri}" )
|
66
67
|
|
67
|
-
#
|
68
|
-
|
69
|
-
|
70
|
-
# YAML parse & schema validation
|
71
|
-
config_hash = YAML.load( yaml_lines )
|
68
|
+
# access plugin confiration
|
69
|
+
config_hash = readConfig( yamlFileUri )
|
72
70
|
|
73
71
|
# and extract interfaces && definitions
|
74
72
|
doLoadDefinitions( config_hash )
|
@@ -76,6 +74,18 @@ module Sbuilder
|
|
76
74
|
|
77
75
|
end
|
78
76
|
|
77
|
+
# @param yamlFileUri [String] path or url to YAML file to process
|
78
|
+
# @return [Hash] cached configuration in file 'yamlFileUri'
|
79
|
+
private def readConfig( yamlFileUri )
|
80
|
+
return @config_hash if @config_hash
|
81
|
+
|
82
|
+
# use facade services to read lines in
|
83
|
+
yaml_lines = readLines( yamlFileUri )
|
84
|
+
|
85
|
+
# YAML parse & schema validation
|
86
|
+
@config_hash = YAML.load( yaml_lines )
|
87
|
+
end
|
88
|
+
|
79
89
|
# @param yamlFileUri [String] path or url to YAML file to process
|
80
90
|
private def readLines( yamlFileUri )
|
81
91
|
yaml_lines = facade.read_cached( yamlFileUri )
|
@@ -104,11 +114,11 @@ module Sbuilder
|
|
104
114
|
end
|
105
115
|
|
106
116
|
# Iterate 'path': for each path create 'newInterface'
|
107
|
-
def doLoadInterfaces(
|
117
|
+
def doLoadInterfaces( operationDefs )
|
108
118
|
|
109
|
-
operationDefs = config_hash
|
110
119
|
|
111
120
|
operationDefs.each do |operationDef|
|
121
|
+
@logger.debug "#{__method__}, operationDef=#{operationDef}"
|
112
122
|
|
113
123
|
validateProperties( operationDef, ['action', 'sObject', 'request', 'reply', 'path' ] , [] )
|
114
124
|
|
@@ -116,14 +126,22 @@ module Sbuilder
|
|
116
126
|
valid_urls = read_urls( operationDef['sObject'] )
|
117
127
|
|
118
128
|
request = facade.newInterface( operationDef['path'], operationDef['action'] )
|
129
|
+
# access parameter set for response from request
|
130
|
+
response = request.response
|
119
131
|
|
120
|
-
input = facade.newParameterReference(
|
132
|
+
input = facade.newParameterReference( 'request', operationDef['request'], false )
|
121
133
|
request.addParameter( input )
|
122
134
|
|
135
|
+
# configure reponse to return
|
136
|
+
# [
|
137
|
+
# operationDef['reply'] |-> operationDef['sObject'],
|
138
|
+
# status |-> status]
|
139
|
+
# ]
|
140
|
+
@logger.info "#{__method__}, reponse#{operationDef['sObject']}, status="#{operationDef['reply']}"
|
141
|
+
response.addParameter( facade.newParameterReference( 'reply', operationDef['reply'], false ) ) if operationDef['reply']
|
142
|
+
|
123
143
|
# add fully configured pojo to model
|
124
144
|
facade.modelInterface( request )
|
125
|
-
# end # ops
|
126
|
-
# end # urls
|
127
145
|
|
128
146
|
end
|
129
147
|
end
|
@@ -28,11 +28,10 @@ EOF
|
|
28
28
|
# s.executables = [ "sbuilder.rb" ]
|
29
29
|
s.license = 'MIT'
|
30
30
|
|
31
|
-
|
32
|
-
|
31
|
+
s.homepage = "https://github.com/jarjuk/tla-sbuilder-salesforce"
|
33
32
|
s.required_ruby_version = '~> 2'
|
34
33
|
|
35
34
|
s.add_runtime_dependency 'restforce', '~>2.1', ">=2.1.3"
|
36
|
-
s.add_runtime_dependency 'tla-sbuilder', '
|
35
|
+
s.add_runtime_dependency 'tla-sbuilder', '>= 0.2.1.pre'
|
37
36
|
|
38
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tla-sbuilder-salesforce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jarjuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: restforce
|
@@ -34,22 +34,16 @@ dependencies:
|
|
34
34
|
name: tla-sbuilder
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '0.1'
|
40
37
|
- - ">="
|
41
38
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.
|
39
|
+
version: 0.2.1.pre
|
43
40
|
type: :runtime
|
44
41
|
prerelease: false
|
45
42
|
version_requirements: !ruby/object:Gem::Requirement
|
46
43
|
requirements:
|
47
|
-
- - "~>"
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '0.1'
|
50
44
|
- - ">="
|
51
45
|
- !ruby/object:Gem::Version
|
52
|
-
version: 0.
|
46
|
+
version: 0.2.1.pre
|
53
47
|
description: |2+
|
54
48
|
|
55
49
|
Sbuilder Salasforce API loader interfaces with Salesforce Rest API,
|
@@ -70,7 +64,7 @@ files:
|
|
70
64
|
- lib/sbuilder/sales_force_loader.rb
|
71
65
|
- lib/tla-sbuilder-salesforce.rb
|
72
66
|
- tla-sbuilder-salesforce.gemspec
|
73
|
-
homepage:
|
67
|
+
homepage: https://github.com/jarjuk/tla-sbuilder-salesforce
|
74
68
|
licenses:
|
75
69
|
- MIT
|
76
70
|
metadata: {}
|