|
88 | 88 | :consumes ["application/json"] |
89 | 89 | :method :get}]) |
90 | 90 |
|
| 91 | +(def custom-user-server-routes |
| 92 | + [{:route-name :connect |
| 93 | + :path-parts ["/ViewDefinition"] |
| 94 | + :produces ["application/json"] |
| 95 | + :consumes ["application/json"] |
| 96 | + :headers-schema {(s/optional-key :Cookie) s/Str |
| 97 | + (s/optional-key :Authorization) s/Str} |
| 98 | + :method :get} |
| 99 | + |
| 100 | + {:route-name :get-view-definition |
| 101 | + :path-parts ["/ViewDefinition/" :vd-id] |
| 102 | + :path-schema {:vd-id s/Str} |
| 103 | + :headers-schema {(s/optional-key :Cookie) s/Str |
| 104 | + (s/optional-key :Authorization) s/Str} |
| 105 | + :produces ["application/json"] |
| 106 | + :consumes ["application/json"] |
| 107 | + :method :get} |
| 108 | + |
| 109 | + {:route-name :create-view-definition |
| 110 | + :path-parts ["/ViewDefinition"] |
| 111 | + :headers-schema {(s/optional-key :Cookie) s/Str |
| 112 | + (s/optional-key :Authorization) s/Str} |
| 113 | + :produces ["application/json"] |
| 114 | + :consumes ["application/json"] |
| 115 | + :method :post |
| 116 | + :body-schema {:body s/Any}} |
| 117 | + |
| 118 | + {:route-name :update-view-definition |
| 119 | + :path-parts ["/ViewDefinition/" :vd-id] |
| 120 | + :path-schema {:vd-id s/Str} |
| 121 | + :headers-schema {(s/optional-key :Cookie) s/Str |
| 122 | + (s/optional-key :Authorization) s/Str} |
| 123 | + :produces ["application/json"] |
| 124 | + :consumes ["application/json"] |
| 125 | + :method :put |
| 126 | + :body-schema {:body s/Any}} |
| 127 | + |
| 128 | + {:route-name :delete-view-definition |
| 129 | + :path-parts ["/ViewDefinition/" :vd-id] |
| 130 | + :path-schema {:vd-id s/Str} |
| 131 | + :headers-schema {(s/optional-key :Cookie) s/Str |
| 132 | + (s/optional-key :Authorization) s/Str} |
| 133 | + :produces ["application/json"] |
| 134 | + :consumes ["application/json"] |
| 135 | + :method :delete} |
| 136 | + |
| 137 | + {:route-name :view-definition-run |
| 138 | + :path-parts ["/ViewDefinition/$run"] |
| 139 | + :headers-schema {(s/optional-key :Cookie) s/Str |
| 140 | + (s/optional-key :Authorization) s/Str} |
| 141 | + :produces ["application/json"] |
| 142 | + :consumes ["application/json"] |
| 143 | + :method :post |
| 144 | + :body-schema {:body s/Any}} |
| 145 | + |
| 146 | + {:route-name :get-view-definition-sql |
| 147 | + :path-parts ["/ViewDefinition/$sql"] |
| 148 | + :headers-schema {(s/optional-key :Cookie) s/Str |
| 149 | + (s/optional-key :Authorization) s/Str} |
| 150 | + :produces ["application/json"] |
| 151 | + :consumes ["application/json"] |
| 152 | + :method :post |
| 153 | + :body-schema {:body s/Any}} |
| 154 | + |
| 155 | + {:route-name :rpc |
| 156 | + :path-parts ["/rpc"] |
| 157 | + :method :post |
| 158 | + ;; use middleware for this? |
| 159 | + :headers-schema {(s/optional-key :Cookie) s/Str |
| 160 | + (s/optional-key :Authorization) s/Str} |
| 161 | + :produces ["application/json"] |
| 162 | + :consumes ["application/json"] |
| 163 | + :body-schema {:body {:method s/Symbol |
| 164 | + (s/optional-key :params) s/Any}}} |
| 165 | + |
| 166 | + {:route-name :metadata |
| 167 | + :query-schema {:box-url s/Str} |
| 168 | + :path-parts ["/metadata"] |
| 169 | + :produces ["application/json"] |
| 170 | + :consumes ["application/json"] |
| 171 | + :method :get}]) |
| 172 | + |
91 | 173 | (defn- aidbox-client* [url title] |
92 | 174 | (martian/bootstrap |
93 | 175 | url |
94 | 176 | routes |
95 | 177 | {:interceptors (concat [(interceptors/observability title)] |
96 | 178 | martian-http/default-interceptors)})) |
97 | 179 |
|
| 180 | +(defn- custom-server-client* [url title] |
| 181 | + (martian/bootstrap |
| 182 | + url |
| 183 | + custom-user-server-routes |
| 184 | + {:interceptors (concat [(interceptors/observability title)] |
| 185 | + martian-http/default-interceptors)})) |
| 186 | + |
| 187 | + |
98 | 188 | (defn aidbox-portal-client [url] |
99 | 189 | (aidbox-client* url "portal")) |
100 | 190 |
|
101 | 191 | (defn custom-server-client [url] |
102 | | - (aidbox-client* url "custom-server")) |
| 192 | + (custom-server-client* url "custom-server")) |
103 | 193 |
|
104 | 194 | (defn aidbox-client [url] |
105 | 195 | (cond |
|
0 commit comments