quickey_ruby_sdk 0.1.2 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf80fc7c44a3f8f5f9f968f1f0d6a2e2286eef3ff13ccd513d654b9e01838955
4
- data.tar.gz: 0e1c21e26ebd7dd0d7c534d1b839075130a40dc6088a0205876bc8108996c48b
3
+ metadata.gz: c3f391327a50645118b77594dc9ec83461bc9e4e8ce69062f4e45ed637731080
4
+ data.tar.gz: 614b5781705eb9375a10fd0a3dedc2010953c9338f20dc76b07195aabb2c0990
5
5
  SHA512:
6
- metadata.gz: cfb79374fe26c56eb1946280566517286b83c67e09acd63f7f096e6e10aefdbfd95017667abfce12397e13e448701eeb754a7512d580c5de8edb49a0622e4210
7
- data.tar.gz: 3e997b4ac00bc2e5633de7e3a5b8e19f817b7c339a4971f619924d1026c33304a4d6966ae36126f03144550d474fb04051c83fb5fa208d4adc22664d9894f4c8
6
+ metadata.gz: e13f03537d2667b77683beda5f3f5e8d4c138b3fe6eae0af5ecdbb85a6bf4d68a7301cd45a7b8280c82bc4e84b9fa9960fb7d529a3cb569f3daa277cece8f12f
7
+ data.tar.gz: 1ceeef7434622f8eb0bfa8030f0d3df214628c7001a4a548d82726857ee01f0d2318a0cba8c10ffed5941783da7bee622f9e840e069f0a99659ac9af7b3bdb23
data/CHANGELOG.md CHANGED
File without changes
data/CODE_OF_CONDUCT.md CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
@@ -23,23 +23,46 @@ Or install it yourself as:
23
23
  ```
24
24
  require 'quickey_ruby_sdk'
25
25
 
26
- quickey = QuickeyRubySdk::App.new(api_key: "YOUR API KEY")
26
+ quickey = QuickeyRubySdk::Sdk.new(api_key: "YOUR API KEY")
27
+ puts quickey.app.sendSMSOTP("+6282278894245", "smsOTP")
27
28
  ```
29
+
28
30
  ### Get App Data
29
31
  ```
30
- appData = quickey.getMetaData
32
+ appData = quickey.app.getMetaData
31
33
  puts appData
32
34
  ```
33
- ### Get Access Token
34
- ```
35
- accessToken = quickey.getAccessToken(appData["app"]["email"])
36
35
 
37
- or
36
+ ### Get Access Token By Email
37
+ ```
38
+ accessToken = quickey.auth.getAccessTokenByEmail("YOUR EMAIL", "YOUR PROVIDER") provider: "googleLogin" | "facebookLogin" | "linkedInLogin"
39
+ puts accessToken
40
+ ```
38
41
 
39
- accessToken = quickey.getAccessToken("YOUR APP EMAIL")
42
+ ### Get Access Token By Phone
43
+ ```
44
+ accessToken = quickey.auth.getAccessTokenByPhone("YOUR PHONE", "YOUR PROVIDER", "YOUR OTP CODE") provider: "smsOTP" | "waOTP"
40
45
  puts accessToken
41
46
  ```
42
47
 
48
+ ### Veridy Token to Get Data
49
+ ```
50
+ data = quickey.auth.verifyToken("YOUR TOKEN")
51
+ puts data
52
+ ```
53
+
54
+
55
+ ### Send OTP To Phone
56
+ ```
57
+ response = quickey.app.sendSMSOTP("YOUR PHONE", "YOUR PROVIDER")
58
+ puts response
59
+ ```
60
+
61
+ ### Link Phone Number To Email
62
+ ```
63
+ response = quickey.auth.linkPhoneToEmail("YOUR PHONE", "YOUR ACCESS TOKEN BY EMAIL")
64
+ puts response
65
+ ```
43
66
 
44
67
 
45
68
  ## Development
@@ -50,7 +73,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
50
73
 
51
74
  ## Contributing
52
75
 
53
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/quickey_ruby_sdk. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/quickey_ruby_sdk/blob/master/CODE_OF_CONDUCT.md).
76
+ Bug reports and pull requests are welcome on GitHub at https://github.com/efrizal_analisa/quickey_ruby_sdk. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/quickey_ruby_sdk/blob/master/CODE_OF_CONDUCT.md).
54
77
 
55
78
  ## License
56
79
 
data/Rakefile CHANGED
File without changes
@@ -0,0 +1,30 @@
1
+ require 'httparty'
2
+ require 'json'
3
+
4
+ module QuickeyRubySdk
5
+ class App
6
+ attr_reader :api_base
7
+ attr_reader :api_key
8
+
9
+ def initialize(api_key: nil)
10
+ @api_key = api_key
11
+ @api_base = QuickeyRubySdk::API_BASE
12
+ end
13
+
14
+ def getMetaData
15
+ JSON.parse HTTParty.post(@api_base+"/auth/apiKey", body: { "apiKey": @api_key }).body
16
+ end
17
+
18
+ def sendOTP(phone, provider)
19
+ response = JSON.parse HTTParty.post(@api_base+"/otp/sendToUserPhone",
20
+ body: {
21
+ "phone": phone,
22
+ "provider": provider
23
+ },
24
+ headers: {
25
+ "Authorization": @api_key
26
+ }).body
27
+ response
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,62 @@
1
+ require 'httparty'
2
+ require 'json'
3
+
4
+ module QuickeyRubySdk
5
+ class Auth
6
+ attr_reader :api_base
7
+ attr_reader :api_key
8
+
9
+ def initialize(api_key: nil)
10
+ @api_key = api_key
11
+ @api_base = QuickeyRubySdk::API_BASE
12
+ end
13
+
14
+ def getAccessTokenByEmail(email, provider)
15
+ response = JSON.parse HTTParty.post(@api_base+"/loginCustomer",
16
+ body: {
17
+ "email": email,
18
+ "provider": provider
19
+ },
20
+ headers: {
21
+ "Authorization": @api_key
22
+ }).body
23
+ response
24
+ end
25
+
26
+ def getAccessTokenByPhone(phone, provider, otpCode)
27
+ response = JSON.parse HTTParty.post(@api_base+"/loginCustomer",
28
+ body: {
29
+ "phone": phone,
30
+ "provider": provider,
31
+ "otpCode": otpCode
32
+ },
33
+ headers: {
34
+ "Authorization": @api_key
35
+ }).body
36
+ response
37
+ end
38
+
39
+ def verifyToken(token)
40
+ response = JSON.parse HTTParty.post(@api_base+"/auth/verifyToken",
41
+ body: {
42
+ "token": token
43
+ },
44
+ headers: {
45
+ "Authorization": @api_key
46
+ }).body
47
+ response
48
+ end
49
+
50
+ def linkPhoneToEmail(phone, provider)
51
+ response = JSON.parse HTTParty.post(@api_base+"/otp/linkToEmail",
52
+ body: {
53
+ "phone": phone,
54
+ "provider": provider
55
+ },
56
+ headers: {
57
+ "Authorization": @api_key
58
+ }).body
59
+ response
60
+ end
61
+ end
62
+ end
File without changes
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QuickeyRubySdk
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.5"
5
5
  end
@@ -1,27 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "quickey_ruby_sdk/version"
3
+ require_relative "quickey_ruby_sdk/app"
4
+ require_relative "quickey_ruby_sdk/auth"
4
5
  require_relative "quickey_ruby_sdk/config"
6
+ require_relative "quickey_ruby_sdk/version"
5
7
  require 'httparty'
6
8
  require 'json'
7
9
 
8
10
  module QuickeyRubySdk
9
- class App
10
- attr_reader :api_base
11
- attr_reader :api_key
12
-
13
- def initialize(api_key: nil)
14
- @api_key = api_key
15
- @api_base = QuickeyRubySdk::API_BASE
16
- end
17
-
18
- def getMetaData
19
- JSON.parse HTTParty.post(@api_base+"/auth/apiKey", body: { "apiKey": @api_key }).body
20
- end
11
+ class Sdk
12
+ attr_reader :app
13
+ attr_reader :auth
21
14
 
22
- def getAccessToken(email)
23
- response = JSON.parse HTTParty.post(@api_base+"/loginRegister", body: { "email": email }).body
24
- response["access_token"]
25
- end
26
- end
27
- end
15
+ def initialize(api_key: nil)
16
+ @app = QuickeyRubySdk::App.new(api_key: api_key)
17
+ @auth = QuickeyRubySdk::Auth.new(api_key: api_key)
18
+ end
19
+ end
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = 'SDK quickey for Ruby"'
13
13
  spec.description = 'A Login Management System for Application'
14
- spec.homepage = 'https://github.com/efrizal-analisa/quickey_ruby_sdk'
14
+ spec.homepage = 'https://docs.getquickey.com/ruby-sdk'
15
15
  spec.license = "MIT"
16
16
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
17
17
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quickey_ruby_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - quickey team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-14 00:00:00.000000000 Z
11
+ date: 2022-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -65,7 +65,6 @@ executables: []
65
65
  extensions: []
66
66
  extra_rdoc_files: []
67
67
  files:
68
- - ".gitignore"
69
68
  - CHANGELOG.md
70
69
  - CODE_OF_CONDUCT.md
71
70
  - Gemfile
@@ -75,14 +74,16 @@ files:
75
74
  - bin/console
76
75
  - bin/setup
77
76
  - lib/quickey_ruby_sdk.rb
77
+ - lib/quickey_ruby_sdk/app.rb
78
+ - lib/quickey_ruby_sdk/auth.rb
78
79
  - lib/quickey_ruby_sdk/config.rb
79
80
  - lib/quickey_ruby_sdk/version.rb
80
81
  - quickey_ruby_sdk.gemspec
81
- homepage: https://github.com/efrizal-analisa/quickey_ruby_sdk
82
+ homepage: https://docs.getquickey.com/ruby-sdk
82
83
  licenses:
83
84
  - MIT
84
85
  metadata:
85
- homepage_uri: https://github.com/efrizal-analisa/quickey_ruby_sdk
86
+ homepage_uri: https://docs.getquickey.com/ruby-sdk
86
87
  post_install_message:
87
88
  rdoc_options: []
88
89
  require_paths:
data/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- quickey_ruby_sdk-*.gem
2
- Gemfile.lock