Coder Social home page Coder Social logo

language-smpp's Introduction

⚠️ MOVED TO OpenFn/adaptors! ⚠️

N.B.: New versions are available at: https://github.com/OpenFn/adaptors/tree/main/packages/smpp

Language SMPP (Archived)

=============

Language Pack for building expressions and operations to make calls to an OpenFn SMPP client API.

Documentation

sample configuration

{
  "systemId": "some_smpp_client_name",
  "password": "password",
  "clientHost": "http://localhost:4000",
  "inboxId": "1c908151-8273-431c-b1d4-blah"
}

sample send expression

send({
  text: dataValue("text"),
  smsId: dataValue("messageId"),
  recipient: dataValue("to"),
  sender: dataValue("from")
});

Docs

Development

Clone the repo, run npm install.

Run tests using npm test or npm test watch

Build the project using make.

language-smpp's People

Contributors

elias-ba avatar mtuchi avatar taylordowns2000 avatar

Watchers

 avatar  avatar  avatar

language-smpp's Issues

create post function

The first exported function in language-smpp should be post().

It should use basic auth and an http post to generate a payload that matches the following:

============================

%Plug.Conn{adapter: {Plug.Adapters.Cowboy.Conn, :...}, assigns: %{},
 before_send: [#Function<1.54385806/1 in Plug.Logger.call/2>,
  #Function<0.18961230/1 in Phoenix.LiveReloader.before_send_inject_reloader/1>],
 body_params: %{"esme" => "lwr_orange_burkina_faso",
   "inbox_uuid" => "4833976e-84bf-43b9-83f9-ae8e4608511c",
   "message_uuid" => "007", "recipient" => "alexis", "sender" => "taylor",
   "text" => "hi mom!"}, cookies: %Plug.Conn.Unfetched{aspect: :cookies},
 halted: false, host: "localhost", method: "POST", owner: #PID<0.496.0>,
 params: %{"esme" => "lwr_orange_burkina_faso",
   "inbox_uuid" => "4833976e-84bf-43b9-83f9-ae8e4608511c",
   "message_uuid" => "007",
   "openfn__inbox_uuid" => "4833976e-84bf-43b9-83f9-ae8e4608511c",
   "recipient" => "alexis", "sender" => "taylor", "text" => "hi mom!"},
 path_info: ["smpp", "4833976e-84bf-43b9-83f9-ae8e4608511c", "send"],
 path_params: %{}, peer: {{127, 0, 0, 1}, 45132}, port: 4000,
 private: %{OpenFn.Router => {[], %{}}, :phoenix_action => :send,
   :phoenix_controller => OpenFn.SMPPController,
   :phoenix_endpoint => OpenFn.Endpoint,
   :phoenix_layout => {OpenFn.LayoutView, :app}, :phoenix_pipelines => [],
   :phoenix_route => #Function<67.39742813/1 in OpenFn.Router.match_route/4>,
   :phoenix_router => OpenFn.Router, :phoenix_view => OpenFn.SMPPView,
   :plug_session_fetch => #Function<1.131660147/1 in Plug.Session.fetch_session/1>},
 query_params: %{}, query_string: "", remote_ip: {127, 0, 0, 1},
 req_cookies: %Plug.Conn.Unfetched{aspect: :cookies},
 req_headers: [{"host", "localhost:4000"}, {"connection", "keep-alive"},
  {"content-length", "178"},
  {"user-agent",
   "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36"},
  {"cache-control", "no-cache"},
  {"origin", "chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop"},
  {"content-type", "application/json"},
  {"authorization", "Basic YWRtaW46YWJjMTIz"},
  {"postman-token", "7be1c79d-f3ac-4095-0b8e-db02649dd2a7"}, {"accept", "*/*"},
  {"accept-encoding", "gzip, deflate, br"},
  {"accept-language", "en-US,en;q=0.8,es;q=0.6"}],
 request_path: "/smpp/4833976e-84bf-43b9-83f9-ae8e4608511c/send",
 resp_body: nil, resp_cookies: %{},
 resp_headers: [{"access-control-allow-origin", "*"},
  {"access-control-expose-headers", []},
  {"access-control-allow-credentials", "true"}], scheme: :http, script_name: [],
 secret_key_base: "J+Z7Ny9pWvr0hoKY3vzgL7LLpg6tarNxWB9FcWeaKJiYzsUvlBBMBQS90j9sBgnA",
 state: :unset, status: nil}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.