workato-connector-sdk 1.2.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +8 -0
  3. data/README.md +2 -6
  4. data/VERSION +1 -0
  5. data/lib/workato/cli/edit_command.rb +3 -1
  6. data/lib/workato/cli/exec_command.rb +76 -10
  7. data/lib/workato/cli/generate_command.rb +3 -2
  8. data/lib/workato/cli/main.rb +18 -10
  9. data/lib/workato/cli/oauth2_command.rb +4 -4
  10. data/lib/workato/cli/push_command.rb +23 -7
  11. data/lib/workato/cli/schema_command.rb +20 -6
  12. data/lib/workato/connector/sdk/account_properties.rb +3 -3
  13. data/lib/workato/connector/sdk/action.rb +20 -70
  14. data/lib/workato/connector/sdk/block_invocation_refinements.rb +4 -11
  15. data/lib/workato/connector/sdk/connection.rb +44 -21
  16. data/lib/workato/connector/sdk/connector.rb +73 -76
  17. data/lib/workato/connector/sdk/core.rb +62 -0
  18. data/lib/workato/connector/sdk/dsl/aws.rb +13 -3
  19. data/lib/workato/connector/sdk/dsl/call.rb +1 -1
  20. data/lib/workato/connector/sdk/dsl/csv_package.rb +133 -0
  21. data/lib/workato/connector/sdk/dsl/error.rb +2 -0
  22. data/lib/workato/connector/sdk/dsl/execution_context.rb +3 -0
  23. data/lib/workato/connector/sdk/dsl/http.rb +7 -2
  24. data/lib/workato/connector/sdk/dsl/reinvoke_after.rb +84 -0
  25. data/lib/workato/connector/sdk/dsl/stream_package.rb +59 -0
  26. data/lib/workato/connector/sdk/dsl/time.rb +0 -14
  27. data/lib/workato/connector/sdk/dsl/workato_package.rb +152 -0
  28. data/lib/workato/connector/sdk/dsl.rb +65 -10
  29. data/lib/workato/connector/sdk/errors.rb +28 -11
  30. data/lib/workato/connector/sdk/object_definitions.rb +59 -18
  31. data/lib/workato/connector/sdk/operation.rb +10 -3
  32. data/lib/workato/connector/sdk/request.rb +67 -26
  33. data/lib/workato/connector/sdk/schema/field/convertors.rb +2 -2
  34. data/lib/workato/connector/sdk/schema.rb +10 -7
  35. data/lib/workato/connector/sdk/settings.rb +13 -2
  36. data/lib/workato/connector/sdk/stream.rb +262 -0
  37. data/lib/workato/connector/sdk/streams.rb +72 -0
  38. data/lib/workato/connector/sdk/summarize.rb +4 -2
  39. data/lib/workato/connector/sdk/trigger.rb +14 -7
  40. data/lib/workato/connector/sdk/version.rb +1 -1
  41. data/lib/workato/connector/sdk.rb +20 -46
  42. data/lib/workato/extension/array.rb +2 -0
  43. data/lib/workato/extension/case_sensitive_headers.rb +0 -1
  44. data/lib/workato/extension/content_encoding_decoder.rb +2 -0
  45. data/lib/workato/extension/currency/countries.rb +79 -0
  46. data/lib/workato/extension/currency/countries.yml +18433 -0
  47. data/lib/workato/extension/currency/currencies.rb +55 -0
  48. data/lib/workato/extension/currency/currencies.yml +479 -0
  49. data/lib/workato/extension/currency.rb +73 -5
  50. data/lib/workato/extension/enumerable.rb +2 -2
  51. data/lib/workato/extension/metadata_fix_wrap_kw_args.rb +11 -0
  52. data/lib/workato/extension/string.rb +23 -111
  53. data/lib/workato/testing/vcr_encrypted_cassette_serializer.rb +2 -0
  54. data/lib/workato/testing/vcr_multipart_body_matcher.rb +1 -0
  55. data/lib/workato/types/binary.rb +99 -0
  56. data/lib/workato/types/unicode_string.rb +62 -0
  57. metadata +34 -62
  58. data/lib/workato/connector/sdk/dsl/csv.rb +0 -125
  59. data/lib/workato/connector/sdk/dsl/workato_code_lib.rb +0 -167
  60. data/lib/workato/connector/sdk/schema/type/unicode_string.rb +0 -23
@@ -32,14 +32,16 @@ module Workato
32
32
 
33
33
  class Connection
34
34
  extend T::Sig
35
+ include MonitorMixin
35
36
 
36
37
  using BlockInvocationRefinements
37
38
 
39
+ # @api private
38
40
  sig { returns(HashWithIndifferentAccess) }
39
41
  attr_reader :source
40
42
 
41
- cattr_accessor :on_settings_update
42
- cattr_accessor :multi_auth_selected_fallback
43
+ class_attribute :on_settings_update, instance_predicate: false
44
+ class_attribute :multi_auth_selected_fallback, instance_predicate: false
43
45
 
44
46
  sig do
45
47
  params(
@@ -49,28 +51,35 @@ module Workato
49
51
  ).void
50
52
  end
51
53
  def initialize(connection: {}, methods: {}, settings: {})
54
+ super()
52
55
  @methods_source = T.let(HashWithIndifferentAccess.wrap(methods), HashWithIndifferentAccess)
53
56
  @source = T.let(HashWithIndifferentAccess.wrap(connection), HashWithIndifferentAccess)
54
57
  @settings = T.let(settings, SorbetTypes::SettingsHash)
55
58
  end
56
59
 
60
+ # @api private
57
61
  sig { returns(SorbetTypes::SettingsHash) }
58
62
  def settings!
59
63
  @settings
60
64
  end
61
65
 
66
+ # @api private
62
67
  sig { returns(HashWithIndifferentAccess) }
63
68
  def settings
64
69
  # we can't freeze or memoise because some developers modify it for storing something temporary in it.
65
70
  # always return a new copy
66
- @settings.with_indifferent_access
71
+ synchronize do
72
+ @settings.with_indifferent_access
73
+ end
67
74
  end
68
75
 
76
+ # @api private
69
77
  sig { params(settings: SorbetTypes::SettingsHash).returns(SorbetTypes::SettingsHash) }
70
78
  def merge_settings!(settings)
71
79
  @settings.merge!(settings)
72
80
  end
73
81
 
82
+ # @api private
74
83
  sig { returns(T::Boolean) }
75
84
  def authorization?
76
85
  source[:authorization].present?
@@ -93,16 +102,18 @@ module Workato
93
102
  return unless source[:base_uri]
94
103
 
95
104
  merge_settings!(settings) if settings
96
- Dsl::WithDsl.execute(self, self.settings, &source[:base_uri])
105
+ global_dsl_context.execute(self.settings, &source['base_uri'])
97
106
  end
98
107
 
108
+ # @api private
99
109
  sig do
100
110
  params(
101
111
  message: String,
112
+ settings_before: SorbetTypes::SettingsHash,
102
113
  refresher: T.proc.returns(T.nilable(SorbetTypes::SettingsHash))
103
114
  ).returns(T::Boolean)
104
115
  end
105
- def update_settings!(message, &refresher)
116
+ def update_settings!(message, settings_before, &refresher)
106
117
  updater = lambda do
107
118
  new_settings = refresher.call
108
119
  next unless new_settings
@@ -110,16 +121,18 @@ module Workato
110
121
  settings.merge(new_settings)
111
122
  end
112
123
 
113
- new_settings = if on_settings_update
114
- on_settings_update.call(message, &updater)
115
- else
116
- updater.call
117
- end
118
- return false unless new_settings
124
+ synchronize do
125
+ new_settings = if on_settings_update
126
+ T.must(on_settings_update).call(message, settings_before, updater)
127
+ else
128
+ updater.call
129
+ end
130
+ return false unless new_settings
119
131
 
120
- merge_settings!(new_settings)
132
+ merge_settings!(new_settings)
121
133
 
122
- true
134
+ true
135
+ end
123
136
  end
124
137
 
125
138
  private
@@ -127,6 +140,11 @@ module Workato
127
140
  sig { returns(HashWithIndifferentAccess) }
128
141
  attr_reader :methods_source
129
142
 
143
+ sig { returns(Dsl::WithDsl) }
144
+ def global_dsl_context
145
+ Dsl::WithDsl.new(self)
146
+ end
147
+
130
148
  class Authorization
131
149
  extend T::Sig
132
150
 
@@ -175,7 +193,7 @@ module Workato
175
193
  client_id = source[:client_id]
176
194
 
177
195
  if client_id.is_a?(Proc)
178
- Dsl::WithDsl.execute(@connection, @connection.settings, &client_id)
196
+ global_dsl_context.execute(@connection.settings, &client_id)
179
197
  else
180
198
  client_id
181
199
  end
@@ -187,7 +205,7 @@ module Workato
187
205
  client_secret_source = source[:client_secret]
188
206
 
189
207
  if client_secret_source.is_a?(Proc)
190
- Dsl::WithDsl.execute(@connection, @connection.settings, &client_secret_source)
208
+ global_dsl_context.execute(@connection.settings, &client_secret_source)
191
209
  else
192
210
  client_secret_source
193
211
  end
@@ -198,7 +216,7 @@ module Workato
198
216
  @connection.merge_settings!(settings) if settings
199
217
  return unless source[:authorization_url]
200
218
 
201
- Dsl::WithDsl.execute(@connection, @connection.settings, &source[:authorization_url])
219
+ global_dsl_context.execute(@connection.settings, &source[:authorization_url])
202
220
  end
203
221
 
204
222
  sig { params(settings: T.nilable(SorbetTypes::SettingsHash)).returns(T.nilable(String)) }
@@ -206,7 +224,7 @@ module Workato
206
224
  @connection.merge_settings!(settings) if settings
207
225
  return unless source[:token_url]
208
226
 
209
- Dsl::WithDsl.execute(@connection, @connection.settings, &source[:token_url])
227
+ global_dsl_context.execute(@connection.settings, &source[:token_url])
210
228
  end
211
229
 
212
230
  sig do
@@ -249,12 +267,13 @@ module Workato
249
267
 
250
268
  refresh_on = self.refresh_on
251
269
  refresh_on.blank? || refresh_on.any? do |pattern|
252
- pattern.is_a?(::Integer) && pattern == http_code ||
270
+ (pattern.is_a?(::Integer) && pattern == http_code) ||
253
271
  pattern === exception&.to_s ||
254
272
  pattern === http_body
255
273
  end
256
274
  end
257
275
 
276
+ # @api private
258
277
  sig { params(settings: HashWithIndifferentAccess).returns(T.nilable(HashWithIndifferentAccess)) }
259
278
  def refresh!(settings)
260
279
  if oauth2?
@@ -288,6 +307,7 @@ module Workato
288
307
  end
289
308
  end
290
309
 
310
+ # @api private
291
311
  sig { returns(HashWithIndifferentAccess) }
292
312
  def source
293
313
  return @source unless multi?
@@ -341,7 +361,7 @@ module Workato
341
361
  def refresh_oauth2_token_using_token_url(settings)
342
362
  if settings[:refresh_token].blank?
343
363
  raise NotImplementedError, 'refresh_token is empty. ' \
344
- 'Use workato oauth2 command to acquire access_token and refresh_token'
364
+ 'Use workato oauth2 command to acquire access_token and refresh_token'
345
365
  end
346
366
 
347
367
  response = RestClient::Request.execute(
@@ -363,9 +383,12 @@ module Workato
363
383
  refresh_token: tokens['refresh_token'].presence || settings[:refresh_token]
364
384
  }.with_indifferent_access
365
385
  end
366
- end
367
386
 
368
- private_constant :Authorization
387
+ sig { returns(Dsl::WithDsl) }
388
+ def global_dsl_context
389
+ Dsl::WithDsl.new(@connection)
390
+ end
391
+ end
369
392
  end
370
393
  end
371
394
  end
@@ -13,6 +13,7 @@ module Workato
13
13
  class Connector
14
14
  extend T::Sig
15
15
 
16
+ # @api private
16
17
  sig { returns(HashWithIndifferentAccess) }
17
18
  attr_reader :source
18
19
 
@@ -29,11 +30,6 @@ module Workato
29
30
  @methods_source = T.let(HashWithIndifferentAccess.wrap(@source[:methods]), HashWithIndifferentAccess)
30
31
  end
31
32
 
32
- sig { params(path: String, params: T::Hash[Symbol, T.untyped]).returns(T.untyped) }
33
- def invoke(path, params = {})
34
- InvokePath.new(path: path, connector: self, params: params).call
35
- end
36
-
37
33
  sig { returns(T.nilable(String)) }
38
34
  def title
39
35
  @source[:title]
@@ -46,7 +42,8 @@ module Workato
46
42
  actions: source[:actions].presence || {},
47
43
  methods: methods_source,
48
44
  object_definitions: object_definitions,
49
- connection: connection
45
+ connection: connection,
46
+ streams: streams
50
47
  )
51
48
  end
52
49
 
@@ -55,7 +52,8 @@ module Workato
55
52
  @methods = T.let(@methods, T.nilable(MethodsProxy))
56
53
  @methods ||= MethodsProxy.new(
57
54
  methods: methods_source,
58
- connection: connection
55
+ connection: connection,
56
+ streams: streams
59
57
  )
60
58
  end
61
59
 
@@ -79,7 +77,8 @@ module Workato
79
77
  triggers: source[:triggers].presence || {},
80
78
  methods: methods_source,
81
79
  connection: connection,
82
- object_definitions: object_definitions
80
+ object_definitions: object_definitions,
81
+ streams: streams
83
82
  )
84
83
  end
85
84
 
@@ -113,8 +112,34 @@ module Workato
113
112
  )
114
113
  end
115
114
 
115
+ sig { returns(Streams) }
116
+ def streams
117
+ @streams = T.let(@streams, T.nilable(Streams))
118
+ @streams ||= Streams.new(
119
+ streams: streams_sources,
120
+ methods: methods_source,
121
+ connection: connection
122
+ )
123
+ end
124
+
116
125
  private
117
126
 
127
+ sig { returns(HashWithIndifferentAccess) }
128
+ def streams_sources
129
+ @streams_sources = T.let(@streams_sources, T.nilable(HashWithIndifferentAccess))
130
+ return @streams_sources if @streams_sources
131
+
132
+ @streams_sources = HashWithIndifferentAccess.new
133
+ @streams_sources.merge!(source[:streams].presence || {})
134
+ (source[:actions] || {}).values.map do |action|
135
+ @streams_sources.merge!(action[:streams] || {})
136
+ end
137
+ (source[:trigger] || {}).values.map do |trigger|
138
+ @streams_sources.merge!(trigger[:streams] || {})
139
+ end
140
+ @streams_sources
141
+ end
142
+
118
143
  sig { returns(HashWithIndifferentAccess) }
119
144
  attr_reader :methods_source
120
145
 
@@ -133,18 +158,20 @@ module Workato
133
158
  actions: HashWithIndifferentAccess,
134
159
  object_definitions: ObjectDefinitions,
135
160
  methods: HashWithIndifferentAccess,
136
- connection: Connection
161
+ connection: Connection,
162
+ streams: Streams
137
163
  ).void
138
164
  end
139
- def initialize(actions:, object_definitions:, methods:, connection:)
165
+ def initialize(actions:, object_definitions:, methods:, connection:, streams:)
140
166
  @methods = methods
141
167
  @connection = connection
142
168
  @object_definitions = object_definitions
169
+ @streams = streams
143
170
  @actions = T.let({}, T::Hash[T.any(Symbol, String), Action])
144
171
  define_action_methods(actions)
145
172
  end
146
173
 
147
- sig { params(action: T.any(Symbol, String)).returns(T.untyped) }
174
+ sig { params(action: T.any(Symbol, String)).returns(Action) }
148
175
  def [](action)
149
176
  public_send(action)
150
177
  end
@@ -157,6 +184,9 @@ module Workato
157
184
  sig { returns(Connection) }
158
185
  attr_reader :connection
159
186
 
187
+ sig { returns(Streams) }
188
+ attr_reader :streams
189
+
160
190
  sig { returns(ObjectDefinitions) }
161
191
  attr_reader :object_definitions
162
192
 
@@ -168,7 +198,8 @@ module Workato
168
198
  action: definition,
169
199
  object_definitions: object_definitions,
170
200
  methods: methods,
171
- connection: connection
201
+ connection: connection,
202
+ streams: streams
172
203
  )
173
204
  return @actions[action] if input_.nil?
174
205
 
@@ -178,18 +209,22 @@ module Workato
178
209
  end
179
210
  end
180
211
 
212
+ private_constant :ActionsProxy
213
+
181
214
  class MethodsProxy
182
215
  extend T::Sig
183
216
 
184
217
  sig do
185
218
  params(
186
219
  methods: HashWithIndifferentAccess,
187
- connection: Connection
220
+ connection: Connection,
221
+ streams: Streams
188
222
  ).void
189
223
  end
190
- def initialize(methods:, connection:)
224
+ def initialize(methods:, connection:, streams:)
191
225
  @methods = methods
192
226
  @connection = connection
227
+ @streams = streams
193
228
  @actions = T.let({}, T::Hash[T.any(Symbol, String), Action])
194
229
  define_action_methods
195
230
  end
@@ -202,6 +237,9 @@ module Workato
202
237
  sig { returns(Connection) }
203
238
  attr_reader :connection
204
239
 
240
+ sig { returns(Streams) }
241
+ attr_reader :streams
242
+
205
243
  sig { void }
206
244
  def define_action_methods
207
245
  methods.each do |method, _definition|
@@ -211,7 +249,8 @@ module Workato
211
249
  execute: -> { T.unsafe(self).call(method, *args) }
212
250
  },
213
251
  methods: methods,
214
- connection: connection
252
+ connection: connection,
253
+ streams: streams
215
254
  )
216
255
  T.must(@actions[method]).execute
217
256
  end
@@ -219,6 +258,8 @@ module Workato
219
258
  end
220
259
  end
221
260
 
261
+ private_constant :MethodsProxy
262
+
222
263
  class PickListsProxy
223
264
  extend T::Sig
224
265
 
@@ -270,6 +311,8 @@ module Workato
270
311
  end
271
312
  end
272
313
 
314
+ private_constant :PickListsProxy
315
+
273
316
  class TriggersProxy
274
317
  extend T::Sig
275
318
 
@@ -278,17 +321,24 @@ module Workato
278
321
  triggers: HashWithIndifferentAccess,
279
322
  object_definitions: ObjectDefinitions,
280
323
  methods: HashWithIndifferentAccess,
281
- connection: Connection
324
+ connection: Connection,
325
+ streams: Streams
282
326
  ).void
283
327
  end
284
- def initialize(triggers:, object_definitions:, methods:, connection:)
328
+ def initialize(triggers:, object_definitions:, methods:, connection:, streams:)
285
329
  @methods = methods
286
330
  @connection = connection
287
331
  @object_definitions = object_definitions
332
+ @streams = streams
288
333
  @triggers = T.let({}, T::Hash[T.any(Symbol, String), Trigger])
289
334
  define_trigger_methods(triggers)
290
335
  end
291
336
 
337
+ sig { params(trigger: T.any(Symbol, String)).returns(Trigger) }
338
+ def [](trigger)
339
+ public_send(trigger)
340
+ end
341
+
292
342
  private
293
343
 
294
344
  sig { returns(HashWithIndifferentAccess) }
@@ -297,6 +347,9 @@ module Workato
297
347
  sig { returns(Connection) }
298
348
  attr_reader :connection
299
349
 
350
+ sig { returns(Streams) }
351
+ attr_reader :streams
352
+
300
353
  sig { returns(ObjectDefinitions) }
301
354
  attr_reader :object_definitions
302
355
 
@@ -308,7 +361,8 @@ module Workato
308
361
  trigger: definition,
309
362
  object_definitions: object_definitions,
310
363
  methods: methods,
311
- connection: connection
364
+ connection: connection,
365
+ streams: streams
312
366
  )
313
367
 
314
368
  return @triggers[trigger] if input_.nil?
@@ -319,64 +373,7 @@ module Workato
319
373
  end
320
374
  end
321
375
 
322
- class InvokePath
323
- extend T::Sig
324
-
325
- sig do
326
- params(
327
- path: String,
328
- connector: Connector,
329
- params: T::Hash[Symbol, T.untyped]
330
- ).void
331
- end
332
- def initialize(path:, connector:, params:)
333
- @path = T.let(path, String)
334
- @connector = T.let(connector, Connector)
335
- @params = T.let(params, T::Hash[Symbol, T.untyped])
336
- end
337
-
338
- sig { returns(T.untyped) }
339
- def call
340
- invoke_path
341
- end
342
-
343
- private
344
-
345
- sig { returns(String) }
346
- attr_reader :path
347
-
348
- sig { returns(Connector) }
349
- attr_reader :connector
350
-
351
- sig { returns(T::Hash[Symbol, T.untyped]) }
352
- attr_reader :params
353
-
354
- sig { returns(T.untyped) }
355
- def invoke_path
356
- methods = path.split('.')
357
- method = methods.pop
358
- raise ArgumentError, 'path is not found' unless method
359
-
360
- object = methods.inject(connector) { |obj, m| obj.public_send(m) }
361
- output = invoke_method(object, method)
362
- if output.respond_to?(:invoke)
363
- invoke_method(output, :invoke)
364
- else
365
- output
366
- end
367
- end
368
-
369
- sig { params(object: T.untyped, method: T.any(Symbol, String)).returns(T.untyped) }
370
- def invoke_method(object, method)
371
- parameters = object.method(method).parameters.reject { |p| p[0] == :block }.map(&:second)
372
- args = params.values_at(*parameters)
373
- if parameters.last == :args
374
- args = args.take(args.length - 1) + Array.wrap(args.last).flatten(1)
375
- end
376
- object.public_send(method, *args)
377
- end
378
- end
379
- private_constant :InvokePath
376
+ private_constant :TriggersProxy
380
377
  end
381
378
  end
382
379
  end
@@ -0,0 +1,62 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ require 'sorbet-runtime'
5
+ require 'active_support'
6
+ require 'active_support/core_ext/object/deep_dup'
7
+ require 'active_support/core_ext/object/try'
8
+ require 'active_support/core_ext/hash/indifferent_access'
9
+ require 'active_support/core_ext/array/wrap'
10
+ require 'active_support/core_ext/array/access'
11
+ require 'active_support/core_ext/numeric/bytes'
12
+ require 'active_support/core_ext/numeric/conversions'
13
+ require 'active_support/core_ext/numeric/time'
14
+
15
+ module Workato
16
+ module Connector
17
+ module Sdk
18
+ DEFAULT_MASTER_KEY_ENV = 'WORKATO_CONNECTOR_MASTER_KEY'
19
+ DEFAULT_MASTER_KEY_PATH = 'master.key'
20
+
21
+ DEFAULT_CONNECTOR_PATH = 'connector.rb'
22
+
23
+ DEFAULT_SETTINGS_PATH = 'settings.yaml'
24
+ DEFAULT_ENCRYPTED_SETTINGS_PATH = 'settings.yaml.enc'
25
+
26
+ DEFAULT_ACCOUNT_PROPERTIES_PATH = 'account_properties.yaml'
27
+ DEFAULT_ENCRYPTED_ACCOUNT_PROPERTIES_PATH = 'account_properties.yaml.enc'
28
+
29
+ DEFAULT_LOOKUP_TABLES_PATH = 'lookup_tables.yaml'
30
+
31
+ DEFAULT_TIME_ZONE = 'Pacific Time (US & Canada)'
32
+
33
+ DEFAULT_SCHEMAS_PATH = 'workato_schemas.json'
34
+
35
+ WORKATO_API_EMAIL_ENV = 'WORKATO_API_EMAIL'
36
+ WORKATO_API_TOKEN_ENV = 'WORKATO_API_TOKEN'
37
+
38
+ WORKATO_BASE_URL_ENV = 'WORKATO_BASE_URL'
39
+ DEFAULT_WORKATO_BASE_URL = 'https://app.workato.com'
40
+ WORKATO_BASE_URL = T.let(ENV.fetch(WORKATO_BASE_URL_ENV, DEFAULT_WORKATO_BASE_URL), String)
41
+ end
42
+ end
43
+ end
44
+
45
+ require_relative '../../extension/hash_with_indifferent_access'
46
+
47
+ require_relative './errors'
48
+ require_relative './account_properties'
49
+ require_relative './operation'
50
+ require_relative './connection'
51
+ require_relative './stream'
52
+ require_relative './streams'
53
+ require_relative './action'
54
+ require_relative './lookup_tables'
55
+ require_relative './object_definitions'
56
+ require_relative './request'
57
+ require_relative './settings'
58
+ require_relative './summarize'
59
+ require_relative './trigger'
60
+ require_relative './version'
61
+ require_relative './workato_schemas'
62
+ require_relative './connector'
@@ -12,15 +12,25 @@ module Workato
12
12
  module Dsl
13
13
  module AWS
14
14
  TEMP_CREDENTIALS_REFRESH_TIMEOUT = 60 # seconds
15
+ private_constant :TEMP_CREDENTIALS_REFRESH_TIMEOUT
15
16
 
16
17
  DUMMY_AWS_IAM_EXTERNAL_ID = 'dummy-aws-iam-external-id'
18
+ private_constant :DUMMY_AWS_IAM_EXTERNAL_ID
19
+
17
20
  DUMMY_AWS_WORKATO_ACCOUNT_ID = 'dummy-aws-workato-account-id'
21
+ private_constant :DUMMY_AWS_WORKATO_ACCOUNT_ID
22
+
23
+ AMAZON_ROLE_CLIENT_ID = ENV.fetch('AMAZON_ROLE_CLIENT_ID', nil)
24
+ private_constant :AMAZON_ROLE_CLIENT_ID
25
+
26
+ AMAZON_ROLE_CLIENT_KEY = ENV.fetch('AMAZON_ROLE_CLIENT_KEY', nil)
27
+ private_constant :AMAZON_ROLE_CLIENT_KEY
18
28
 
19
- AMAZON_ROLE_CLIENT_ID = ENV['AMAZON_ROLE_CLIENT_ID']
20
- AMAZON_ROLE_CLIENT_KEY = ENV['AMAZON_ROLE_CLIENT_KEY']
21
- AMAZON_ROLE_CLIENT_SECRET = ENV['AMAZON_ROLE_CLIENT_SECRET']
29
+ AMAZON_ROLE_CLIENT_SECRET = ENV.fetch('AMAZON_ROLE_CLIENT_SECRET', nil)
30
+ private_constant :AMAZON_ROLE_CLIENT_SECRET
22
31
 
23
32
  WWW_FORM_CONTENT_TYPE = 'application/x-www-form-urlencoded; charset=utf-8'
33
+ private_constant :WWW_FORM_CONTENT_TYPE
24
34
 
25
35
  def aws
26
36
  @aws ||= Private.new(connection: connection)
@@ -6,7 +6,7 @@ module Workato
6
6
  module Sdk
7
7
  module Dsl
8
8
  module Call
9
- def call(method, *args)
9
+ ruby2_keywords def call(method, *args)
10
10
  method_proc = @_methods[method]
11
11
 
12
12
  raise UndefinedMethodError, method unless method_proc