Skip to content

Commit d30cbfc

Browse files
committed
shopify has slowly been deprecating the rest api, lets move it to its own repo
1 parent 52420a1 commit d30cbfc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+24
-3583
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Unreleased
22

3+
- BREAKING: Moving REST client to its own repo. Check the new REST entry in the [README](./#REST)
4+
If the REST client is used you must include the new REST client repo:
5+
`{:shopify_api_rest, github: "orbit-apps/elixir-shopifyapi-rest", tag: "v0.1.0"}`
36
- BREAKING: AppServer now defaults to a single app instance, this is a compile env if you want to use the old multi app config add `config :shopify_api, :app_server, :multi_app` to your `config/config.exs`
47
- New: Single app mode for AppServer, is API compatible with the multi app setup. This greatly simplifies the most common setup, one app <> one phoenix setup.
58
- New: Add handle and raw app config to the App struct

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [AuthTokens](#AuthTokens)
1313
- [Webhooks](#Webhooks)
1414
- [GraphQL](#GraphQL)
15+
- [REST](#REST)
1516
- [Telemetry](#Telemetry)
1617

1718
## Installation
@@ -205,6 +206,17 @@ Failed response:
205206
{:error, %HTTPoison.Response{}}
206207
```
207208

209+
## REST
210+
211+
The REST client has been moved to its [own repo](https://github.com/orbit-apps/elixir-shopifyapi-rest)
212+
213+
Using:
214+
215+
- include the new dependency `{:shopify_api, github: "pixelunion/elixir-shopifyapi-rest", tag: "v0.1.0"}`
216+
- make clean and compile `mix clean && mix compile`, as there is an optional endpoint `ShopifyAPI.request/2`
217+
that is not compiled in unless the REST client is included.
218+
- make a REST call `iex> ShopifyAPI.REST.Product.all(token)`
219+
208220
## Telemetry
209221

210222
The `shopify_api` library will emit events using the [`:telemetry`](https://github.com/beam-telemetry/telemetry) library. Consumers of `shopify_api` can then use these events for customized metrics aggregation and more.

lib/shopify_api.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
defmodule ShopifyAPI do
2-
alias ShopifyAPI.RateLimiting
32
alias ShopifyAPI.Throttled
43

54
@shopify_admin_uri URI.new!("https://admin.shopify.com")
@@ -26,7 +25,10 @@ defmodule ShopifyAPI do
2625
Throttled.graphql_request(func, scope, estimated_cost)
2726
end
2827

29-
def request(token, func), do: Throttled.request(func, token, RateLimiting.RESTTracker)
28+
if function_exported?(ShopifyAPI.RateLiting.RESTTracker, :init, 0) do
29+
def request(token, func),
30+
do: ShopifyAPIThrottled.request(func, token, ShopifyAPI.RateLimiting.RESTTracker)
31+
end
3032

3133
@doc false
3234
# Accessor for API transport layer, defaults to `https://`.

lib/shopify_api/application.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ defmodule ShopifyAPI.Application do
66
# See https://hexdocs.pm/elixir/Application.html
77
# for more information on OTP Applications
88
def start(_type, _args) do
9-
RateLimiting.RESTTracker.init()
109
RateLimiting.GraphQLTracker.init()
1110

1211
# Define workers and child supervisors to be supervised

lib/shopify_api/rate_limiting/rest.ex

Lines changed: 0 additions & 16 deletions
This file was deleted.

lib/shopify_api/rate_limiting/rest_call_limits.ex

Lines changed: 0 additions & 57 deletions
This file was deleted.

lib/shopify_api/rate_limiting/rest_tracker.ex

Lines changed: 0 additions & 70 deletions
This file was deleted.

lib/shopify_api/rest.ex

Lines changed: 0 additions & 90 deletions
This file was deleted.

lib/shopify_api/rest/access_scope.ex

Lines changed: 0 additions & 25 deletions
This file was deleted.

lib/shopify_api/rest/application_charge.ex

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)