bianchi 0.1.3 → 0.1.4

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: 9d0a4841767acc10455e325dee277cf81119914192754b2da010b99626850986
4
- data.tar.gz: 544c49afaa014e0163d86730b5338ead295ddd1f02bf6364aaa480d4a1da38f2
3
+ metadata.gz: 429f7f70f248bb25d6ad69ed931623d67d5041ade758356951e05f79436a9a59
4
+ data.tar.gz: 7cba89ec8cf0f3dd82570b3c64fdd023b882b58e3dd6a589b4a4facd53a087a7
5
5
  SHA512:
6
- metadata.gz: 993ad14fd38daaf4ee9cf0d55f2450111675195d778c92c4663edff75f8f657cbcb816837bb41ec3ad75b7256e0a6e800b051808c46a0224f3d54cfea16f22e7
7
- data.tar.gz: 183c4fbd9c4113c4bf6fcc399e119f1e4f54f5a39b24a220dca9ce8c8fdec81195f0c802e002b36f2e2998b3fd1bfe8b0aa081ac3e88b30d823d5f78a2037e3e
6
+ metadata.gz: 0a8790142cea8af2e540bc125b09971e6012c76361d563990057a1841bd00085d5838bf16184aa9ff3e05bef943c3cbeacdbe005432245816a69213ee5176b22
7
+ data.tar.gz: a4a9bae9dc8f6c5c7de0ce019d81654c4e13190c3851bdf52858cae9bb7c503d0f4671df9e2c73b41e0b0e7a34eb4af6c431741fb574e343a573bf25aa30015c
@@ -1,5 +1,7 @@
1
1
  {
2
2
  "cSpell.words": [
3
- "appsnmobile"
3
+ "appsnmobile",
4
+ "Arkesel",
5
+ "msisdn"
4
6
  ]
5
7
  }
@@ -28,7 +28,7 @@ module Bianchi
28
28
  method_option :provider, aliases: "-p", type: :string, desc: "Set up ussd project for provider"
29
29
  def setup
30
30
  @provider = options[:provider]
31
- unless %w[africastalking none appsnmobile].include? @provider
31
+ unless %w[africastalking none appsnmobile arkesel].include? @provider
32
32
  say("Error: provider #{@provider} is not yet configured.", :yellow)
33
33
  exit(1)
34
34
  end
@@ -5,12 +5,14 @@ module Bianchi
5
5
  module ProviderConfigurations
6
6
  include ProviderParsers::Africastalking
7
7
  include ProviderParsers::Appsnmobile
8
+ include ProviderParsers::Arkesel
8
9
 
9
10
  def parse_params(params)
10
11
  provider_parsers = {
11
12
  none: proc { params },
12
13
  africastalking: proc { africastalking_params_parser(params) },
13
- appsnmobile: proc { appsnmobile_params_parser(params) }
14
+ appsnmobile: proc { appsnmobile_params_parser(params) },
15
+ arkesel: proc { arkesel_params_parser(params) }
14
16
  }.with_indifferent_access
15
17
 
16
18
  parser = provider_parsers[@provider]
@@ -24,7 +26,8 @@ module Bianchi
24
26
  provider_parsers = {
25
27
  none: proc { prompt_data },
26
28
  africastalking: proc { africastalking_prompt_data_parser(prompt_data) },
27
- appsnmobile: proc { appsnmobile_prompt_data_parser(prompt_data) }
29
+ appsnmobile: proc { appsnmobile_prompt_data_parser(prompt_data) },
30
+ arkesel: proc { arkesel_prompt_data_parser(prompt_data) }
28
31
  }.with_indifferent_access
29
32
 
30
33
  parser = provider_parsers[@provider]
@@ -0,0 +1,27 @@
1
+ module Bianchi
2
+ module USSD
3
+ module ProviderParsers
4
+ module Arkesel
5
+ def arkesel_params_parser(params)
6
+ {
7
+ session_id: params["sessionID"],
8
+ mobile_number: params["msisdn"],
9
+ activity_state: params["newSession"] ? "initial" : "subsequent",
10
+ input_body: params["userData"],
11
+ service_code: params["userID"]
12
+ }
13
+ end
14
+
15
+ def arkesel_prompt_data_parser(prompt_data)
16
+ {
17
+ sessionID: prompt_data["session_id"],
18
+ userID: prompt_data["service_code"],
19
+ msisdn: prompt_data["mobile_number"],
20
+ message: prompt_data["body"],
21
+ continueSession: prompt_data["activity_state"] == :await ? "true" : "false"
22
+ }
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bianchi
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
data/lib/bianchi.rb CHANGED
@@ -8,6 +8,7 @@ require "thor"
8
8
  require_relative "bianchi/version"
9
9
  require_relative "bianchi/ussd/provider_parsers/africastalking"
10
10
  require_relative "bianchi/ussd/provider_parsers/appsnmobile"
11
+ require_relative "bianchi/ussd/provider_parsers/arkesel"
11
12
  require_relative "bianchi/ussd/provider_configurations"
12
13
  require_relative "bianchi/ussd/engine"
13
14
  require_relative "bianchi/ussd/menu"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bianchi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dapilah Sydney
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-08 00:00:00.000000000 Z
11
+ date: 2025-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -102,6 +102,7 @@ files:
102
102
  - lib/bianchi/ussd/provider_configurations.rb
103
103
  - lib/bianchi/ussd/provider_parsers/africastalking.rb
104
104
  - lib/bianchi/ussd/provider_parsers/appsnmobile.rb
105
+ - lib/bianchi/ussd/provider_parsers/arkesel.rb
105
106
  - lib/bianchi/ussd/session.rb
106
107
  - lib/bianchi/ussd/store.rb
107
108
  - lib/bianchi/version.rb
@@ -131,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
132
  - !ruby/object:Gem::Version
132
133
  version: '0'
133
134
  requirements: []
134
- rubygems_version: 3.2.3
135
+ rubygems_version: 3.5.3
135
136
  signing_key:
136
137
  specification_version: 4
137
138
  summary: A DSL (Domain-Specific Language) and a minimalist framework in Ruby, tailored