lockstep_rails 0.3.35 → 0.3.37
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/app/concepts/lockstep/api_record.rb +4 -0
- data/app/concepts/lockstep/client.rb +16 -0
- data/app/concepts/lockstep/query.rb +7 -0
- data/app/models/lockstep/customer_summary.rb +5 -0
- data/app/models/lockstep/magic_link.rb +10 -0
- data/app/models/lockstep/vendor_summary.rb +5 -0
- data/lib/lockstep_rails/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5879e82b6ba39f2a29081df8b406a7941498eb55880a3e29266d27c29e2a915
|
4
|
+
data.tar.gz: 388b574fb28fbe6d43e2f6afca0b725cbcc87043893c6f9e36e70331411be6f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a195119cac110be1ebe2cb059eefb2601a70c83ca1ca28aa6671a32ba5fffa7aea25926a4fb88c44c579d2fa6d7d34d788d8401b2f1410080e83053dcd38ee6
|
7
|
+
data.tar.gz: 1672ecd3aa13b7d8b16aba27267fc0f210508740d3f57a06a1e3e3753cec1a8a38bdb2fba51a8ead77b4e084d4a1581f6d3f66dc3cb21d6ff186d5b1d00eeea3
|
data/README.md
CHANGED
@@ -29,6 +29,13 @@ module Lockstep
|
|
29
29
|
RequestStore.store[:lockstep_api_key]
|
30
30
|
end
|
31
31
|
|
32
|
+
def self.set_internal_service_key(key)
|
33
|
+
RequestStore.store[:internal_service_key] = key
|
34
|
+
end
|
35
|
+
|
36
|
+
def internal_service_key
|
37
|
+
RequestStore.store[:internal_service_key]
|
38
|
+
end
|
32
39
|
|
33
40
|
##
|
34
41
|
# Construct a new Lockstep API client targeting the specified server.
|
@@ -115,6 +122,7 @@ module Lockstep
|
|
115
122
|
request["SdkType"] = 'Ruby'
|
116
123
|
request["SdkVersion"] = '2022.4.32.0'
|
117
124
|
request["MachineName"] = Socket.gethostname
|
125
|
+
request["LS-InternalService"] = internal_service_key if internal_service_key_set?
|
118
126
|
body = body.to_json unless body.is_a?(String)
|
119
127
|
request.body = body
|
120
128
|
|
@@ -155,6 +163,14 @@ module Lockstep
|
|
155
163
|
request(:delete, path, {}, {})
|
156
164
|
end
|
157
165
|
|
166
|
+
def post_magic_link(path, body: {}, params: {})
|
167
|
+
request(:post, path, body, params)
|
168
|
+
end
|
169
|
+
|
170
|
+
def internal_service_key_set?
|
171
|
+
!!internal_service_key
|
172
|
+
end
|
173
|
+
|
158
174
|
def with_logger(&block)
|
159
175
|
block.call
|
160
176
|
end
|
@@ -51,6 +51,12 @@ class Lockstep::Query
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
def additional_query_params(args)
|
55
|
+
with_clone do
|
56
|
+
criteria[:additional_query_params] ||= args
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
54
60
|
def convert_arg(arg)
|
55
61
|
return arg.to_pointer if arg.is_a?(Lockstep::ApiRecord)
|
56
62
|
return Lockstep::ApiRecord.to_date_object(arg) if arg.is_a?(Time) || arg.is_a?(Date)
|
@@ -198,6 +204,7 @@ class Lockstep::Query
|
|
198
204
|
params.merge!({ :include => criteria[:include].join(",") }) if criteria[:include]
|
199
205
|
params.merge!({ :order => criteria[:order].join(",") }) if criteria[:order]
|
200
206
|
params.merge!({ :pageSize => 2 }) if criteria[:count]
|
207
|
+
params.merge!(criteria[:additional_query_params]) if criteria[:additional_query_params]
|
201
208
|
params.reject! { |k, v| v.blank? }
|
202
209
|
params
|
203
210
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class Lockstep::MagicLink < Lockstep::ApiRecord
|
2
|
+
self.model_name_uri = "v1/useraccounts/magic-links"
|
3
|
+
self.id_ref = "magicLinkId"
|
4
|
+
self.query_path = ""
|
5
|
+
|
6
|
+
def self.generate(email_id, expiry, app_id, user_role)
|
7
|
+
body = {email: email_id, expiresInMinutes: expiry, applicationId: app_id, userRole: user_role}
|
8
|
+
resource.post_magic_link('', body: body, params: {})
|
9
|
+
end
|
10
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lockstep_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.37
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vivek AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- app/models/lockstep/invoice_at_risk_summary.rb
|
56
56
|
- app/models/lockstep/invoice_summary.rb
|
57
57
|
- app/models/lockstep/invoices/address.rb
|
58
|
+
- app/models/lockstep/magic_link.rb
|
58
59
|
- app/models/lockstep/note.rb
|
59
60
|
- app/models/lockstep/payment.rb
|
60
61
|
- app/models/lockstep/payment_summary.rb
|