opened yodlee up.
This commit is contained in:
@@ -1,17 +1,9 @@
|
||||
(ns auto-ap.graphql.yodlee2
|
||||
(:require [auto-ap.graphql.utils :refer [->graphql <-graphql assert-can-see-client assert-admin enum->keyword]]
|
||||
[auto-ap.datomic.yodlee2 :as d-yodlee2]
|
||||
[auto-ap.time :refer [parse iso-date]]
|
||||
[auto-ap.utils :refer [dollars=]]
|
||||
[datomic.api :as d]
|
||||
[auto-ap.datomic :refer [uri remove-nils audit-transact conn]]
|
||||
[clj-time.coerce :as coerce]
|
||||
[clj-time.core :as time]
|
||||
[clojure.set :as set]
|
||||
[clojure.tools.logging :as log]))
|
||||
(:require
|
||||
[auto-ap.datomic.yodlee2 :as d-yodlee2]
|
||||
[auto-ap.graphql.utils :refer [->graphql <-graphql assert-admin]]))
|
||||
|
||||
(defn get-yodlee-provider-account-page [context args value]
|
||||
(assert-admin (:id context))
|
||||
(let [args (assoc args :id (:id context))
|
||||
[yodlee-provider-accounts cnt] (d-yodlee2/get-graphql (<-graphql (assoc args :id (:id context))))]
|
||||
{:yodlee_provider_accounts (map ->graphql yodlee-provider-accounts)
|
||||
@@ -21,9 +13,9 @@
|
||||
:end (+ (:start args 0) (count yodlee-provider-accounts))}))
|
||||
|
||||
(defn get-all-yodlee-provider-accounts [context args value]
|
||||
(assert-admin (:id context))
|
||||
(map
|
||||
->graphql
|
||||
(first (d-yodlee2/get-graphql (assoc (<-graphql args)
|
||||
:count Integer/MAX_VALUE)))))
|
||||
(let [args (assoc args :id (:id context))]
|
||||
(map
|
||||
->graphql
|
||||
(first (d-yodlee2/get-graphql (assoc (<-graphql args)
|
||||
:count Integer/MAX_VALUE))))))
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
:headers {"Content-Type" "application/json"}
|
||||
:body "{}"})
|
||||
(POST "/event" request
|
||||
;; {"id" "bf3dcf5c-a68f-42d9-9084-049133e03d3d", "parent_type" "Caterer", "parent_id" "91541331-d7ae-4634-9e8b-ccbbcfb2ce70", "entity_type" "Order", "entity_id" "9ab05fee-a9c5-483b-a7f2-14debde4b7a8", "key" "accepted", "occurred_at" "2022-07-21T19:21:07.549Z"}
|
||||
(log/info (str "POST EVENT " (body-string request) request))
|
||||
{:status 200
|
||||
:headers {"Content-Type" "application/json"}
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
(ns auto-ap.routes.yodlee2
|
||||
(:require
|
||||
[auto-ap.yodlee.core2 :as yodlee]
|
||||
[auto-ap.graphql.utils :refer [assert-admin]]
|
||||
(:require
|
||||
[auto-ap.datomic :refer [conn]]
|
||||
[auto-ap.datomic.clients :as d-clients]
|
||||
[auto-ap.graphql.utils :refer [assert-admin assert-can-see-client]]
|
||||
[auto-ap.routes.utils :refer [wrap-secure]]
|
||||
[compojure.core :refer [GET POST context defroutes wrap-routes]]
|
||||
[config.core :refer [env]]
|
||||
[auto-ap.yodlee.core2 :as yodlee]
|
||||
[clojure.tools.logging :as log]
|
||||
[auto-ap.datomic.clients :as d-clients]))
|
||||
[compojure.core :refer [context defroutes GET POST wrap-routes]]
|
||||
[config.core :refer [env]]
|
||||
[datomic.api :as d]))
|
||||
|
||||
(defroutes routes
|
||||
(wrap-routes
|
||||
(context "/yodlee2" []
|
||||
(GET "/fastlink" {:keys [query-params identity] :as request}
|
||||
(assert-admin identity)
|
||||
(assert-can-see-client identity (d/pull (d/db conn) [:db/id] [:client/code (get query-params "client")]))
|
||||
|
||||
(let [token (if-let [client-id (get query-params "client-id")]
|
||||
(-> client-id
|
||||
|
||||
Reference in New Issue
Block a user