disco_app 0.18.1 → 0.18.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/disco_app/charges_controller.rb +6 -1
  3. data/app/jobs/disco_app/concerns/synchronise_resources_job.rb +2 -6
  4. data/app/models/disco_app/concerns/has_metafields.rb +100 -43
  5. data/app/models/disco_app/concerns/synchronises.rb +1 -5
  6. data/app/models/disco_app/concerns/taggable.rb +1 -1
  7. data/app/services/disco_app/charges_service.rb +9 -11
  8. data/app/services/disco_app/synchronise_resources_service.rb +54 -0
  9. data/lib/disco_app/version.rb +1 -1
  10. data/lib/generators/disco_app/install/install_generator.rb +1 -1
  11. data/lib/generators/disco_app/install/templates/root/.gitignore +18 -2
  12. data/test/controllers/disco_app/charges_controller_test.rb +1 -2
  13. data/test/dummy/app/models/disco_app/shop.rb +3 -0
  14. data/test/dummy/package.json +4 -2
  15. data/test/dummy/yarn.lock +1989 -1955
  16. data/test/fixtures/api/widget_store/charges/{activate_application_charge_request.json → get_active_application_charge_response.json} +1 -1
  17. data/test/fixtures/api/widget_store/charges/{activate_recurring_application_charge_request.json → get_active_recurring_application_charge_response.json} +2 -2
  18. data/test/fixtures/api/widget_store/products/get_metafields_empty_response.json +3 -0
  19. data/test/fixtures/api/widget_store/products/get_metafields_with_existing_response.json +11 -0
  20. data/test/fixtures/api/widget_store/products/write_metafields_multiple_namespaces_request.json +4 -0
  21. data/test/fixtures/api/widget_store/products/write_metafields_single_namespace_request.json +2 -0
  22. data/test/fixtures/api/widget_store/products/write_metafields_with_existing_single_namespace_request.json +21 -0
  23. data/test/fixtures/api/widget_store/{charges/activate_application_charge_response.json → products/write_metafields_with_existing_single_namespace_response.json} +0 -0
  24. data/test/fixtures/api/widget_store/shops/get_metafields_with_existing_response.json +11 -0
  25. data/test/fixtures/api/widget_store/shops/write_metafields_with_existing_first_request.json +9 -0
  26. data/test/fixtures/api/widget_store/{charges/activate_recurring_application_charge_response.json → shops/write_metafields_with_existing_first_response.json} +0 -0
  27. data/test/fixtures/api/widget_store/shops/write_metafields_with_existing_second_request.json +9 -0
  28. data/test/fixtures/api/widget_store/shops/write_metafields_with_existing_second_response.json +1 -0
  29. data/test/models/disco_app/has_metafields_test.rb +72 -2
  30. data/test/services/disco_app/charges_service_test.rb +3 -6
  31. data/test/services/disco_app/synchronise_resources_service_test.rb +57 -0
  32. data/test/test_helper.rb +2 -0
  33. data/test/vcr/synchronise_products.yml +130 -0
  34. data/test/vcr/synchronise_products_paginated.yml +119 -0
  35. data/test/vcr/synchronise_products_since_id.yml +125 -0
  36. data/test/vcr/synchronise_products_with_params.yml +130 -0
  37. metadata +51 -16
  38. data/test/fixtures/api/widget_store/charges/get_accepted_application_charge_response.json +0 -16
  39. data/test/fixtures/api/widget_store/charges/get_accepted_recurring_application_charge_response.json +0 -20
@@ -4,7 +4,7 @@
4
4
  "name": "Lifetime",
5
5
  "api_client_id": 755357713,
6
6
  "price": "49.00",
7
- "status": "accepted",
7
+ "status": "active",
8
8
  "return_url": "https://test.example.com/subscriptions/304261385/charges/629961174/activate",
9
9
  "created_at": "2015-09-02T14:52:56-04:00",
10
10
  "updated_at": "2015-09-02T14:52:56-04:00",
@@ -4,13 +4,13 @@
4
4
  "name": "Basic",
5
5
  "api_client_id": 755357713,
6
6
  "price": "9.99",
7
- "status": "accepted",
7
+ "status": "active",
8
8
  "return_url": "https://test.example.com/subscriptions/304261385/charges/629961174/activate",
9
9
  "billing_on": null,
10
10
  "created_at": "2015-09-02T14:50:32-04:00",
11
11
  "updated_at": "2015-09-02T14:50:32-04:00",
12
12
  "test": true,
13
- "activated_on": null,
13
+ "activated_on": "2015-09-02T14:50:32-04:00",
14
14
  "trial_ends_on": null,
15
15
  "cancelled_on": null,
16
16
  "trial_days": 14,
@@ -0,0 +1,11 @@
1
+ {
2
+ "metafields": [
3
+ {
4
+ "id": 874857827343,
5
+ "namespace": "namespace1",
6
+ "key": "key1",
7
+ "value": "value9",
8
+ "value_type": "string"
9
+ }
10
+ ]
11
+ }
@@ -3,24 +3,28 @@
3
3
  "id": 632910393,
4
4
  "metafields": [
5
5
  {
6
+ "id": null,
6
7
  "namespace": "namespace1",
7
8
  "key": "n1key1",
8
9
  "value": "value1",
9
10
  "value_type": "string"
10
11
  },
11
12
  {
13
+ "id": null,
12
14
  "namespace": "namespace1",
13
15
  "key": "n1key2",
14
16
  "value": 2,
15
17
  "value_type": "integer"
16
18
  },
17
19
  {
20
+ "id": null,
18
21
  "namespace": "namespace2",
19
22
  "key": "n2key3",
20
23
  "value": "value3",
21
24
  "value_type": "string"
22
25
  },
23
26
  {
27
+ "id": null,
24
28
  "namespace": "namespace2",
25
29
  "key": "n2key4",
26
30
  "value": 2,
@@ -3,12 +3,14 @@
3
3
  "id": 632910393,
4
4
  "metafields": [
5
5
  {
6
+ "id": null,
6
7
  "namespace": "namespace1",
7
8
  "key": "key1",
8
9
  "value": "value1",
9
10
  "value_type": "string"
10
11
  },
11
12
  {
13
+ "id": null,
12
14
  "namespace": "namespace1",
13
15
  "key": "key2",
14
16
  "value": 2,
@@ -0,0 +1,21 @@
1
+ {
2
+ "product": {
3
+ "id": 632910393,
4
+ "metafields": [
5
+ {
6
+ "id": 874857827343,
7
+ "namespace": "namespace1",
8
+ "key": "key1",
9
+ "value": "value1",
10
+ "value_type": "string"
11
+ },
12
+ {
13
+ "id": null,
14
+ "namespace": "namespace1",
15
+ "key": "key2",
16
+ "value": "{\"json_key\":\"json_value\"}",
17
+ "value_type": "json_string"
18
+ }
19
+ ]
20
+ }
21
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "metafields": [
3
+ {
4
+ "id": 874857827343,
5
+ "namespace": "namespace1",
6
+ "key": "key1",
7
+ "value": "value9",
8
+ "value_type": "string"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "metafield": {
3
+ "id": 874857827343,
4
+ "namespace": "namespace1",
5
+ "key": "key1",
6
+ "value": "value1",
7
+ "value_type": "string"
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "metafield": {
3
+ "id": null,
4
+ "namespace": "namespace1",
5
+ "key": "key2",
6
+ "value": 2,
7
+ "value_type": "integer"
8
+ }
9
+ }
@@ -14,7 +14,13 @@ class DiscoApp::HasMetafieldsTest < ActiveSupport::TestCase
14
14
  @shop = nil
15
15
  end
16
16
 
17
- test 'can write metafields with a single namespace' do
17
+ test 'can write product metafields with a single namespace with no existing metafields' do
18
+ stub_api_request(
19
+ :get,
20
+ "#{@shop.admin_url}/products/#{@product.id}/metafields.json",
21
+ 'widget_store/products/get_metafields_empty'
22
+ )
23
+
18
24
  stub_api_request(
19
25
  :put,
20
26
  "#{@shop.admin_url}/products/#{@product.id}.json",
@@ -33,7 +39,40 @@ class DiscoApp::HasMetafieldsTest < ActiveSupport::TestCase
33
39
  )
34
40
  end
35
41
 
36
- test 'can write metafields with multiple namespaces' do
42
+ test 'can write product metafields, including json string type, with a single namespace with one existing metafield' do
43
+ stub_api_request(
44
+ :get,
45
+ "#{@shop.admin_url}/products/#{@product.id}/metafields.json",
46
+ 'widget_store/products/get_metafields_with_existing'
47
+ )
48
+
49
+ stub_api_request(
50
+ :put,
51
+ "#{@shop.admin_url}/products/#{@product.id}.json",
52
+ 'widget_store/products/write_metafields_with_existing_single_namespace'
53
+ )
54
+
55
+ assert(
56
+ @shop.with_api_context do
57
+ @product.write_metafields(
58
+ namespace1: {
59
+ key1: 'value1',
60
+ key2: {
61
+ 'json_key' => 'json_value'
62
+ }
63
+ }
64
+ )
65
+ end
66
+ )
67
+ end
68
+
69
+ test 'can write product metafields with multiple namespaces with no existing metafields' do
70
+ stub_api_request(
71
+ :get,
72
+ "#{@shop.admin_url}/products/#{@product.id}/metafields.json",
73
+ 'widget_store/products/get_metafields_empty'
74
+ )
75
+
37
76
  stub_api_request(
38
77
  :put,
39
78
  "#{@shop.admin_url}/products/#{@product.id}.json",
@@ -56,4 +95,35 @@ class DiscoApp::HasMetafieldsTest < ActiveSupport::TestCase
56
95
  )
57
96
  end
58
97
 
98
+ test 'can write shop metafields with one existing metafield' do
99
+ stub_api_request(
100
+ :get,
101
+ "#{@shop.admin_url}/metafields.json",
102
+ 'widget_store/shops/get_metafields_with_existing'
103
+ )
104
+
105
+ stub_api_request(
106
+ :put,
107
+ "#{@shop.admin_url}/metafields/874857827343.json",
108
+ 'widget_store/shops/write_metafields_with_existing_first'
109
+ )
110
+
111
+ stub_api_request(
112
+ :post,
113
+ "#{@shop.admin_url}/metafields.json",
114
+ 'widget_store/shops/write_metafields_with_existing_second'
115
+ )
116
+
117
+ assert(
118
+ @shop.with_api_context do
119
+ @shop.write_metafields(
120
+ namespace1: {
121
+ key1: 'value1',
122
+ key2: 2
123
+ }
124
+ )
125
+ end
126
+ )
127
+ end
128
+
59
129
  end
@@ -57,8 +57,7 @@ class DiscoApp::ChargesServiceTest < ActiveSupport::TestCase
57
57
  end
58
58
 
59
59
  test 'activating an accepted recurring charge is successful and cancels any existing recurring charges' do
60
- stub_api_request(:get, "#{@shop.admin_url}/recurring_application_charges/654381179.json", 'widget_store/charges/get_accepted_recurring_application_charge')
61
- stub_api_request(:post, "#{@shop.admin_url}/recurring_application_charges/654381179/activate.json", 'widget_store/charges/activate_recurring_application_charge')
60
+ stub_api_request(:get, "#{@shop.admin_url}/recurring_application_charges/654381179.json", 'widget_store/charges/get_active_recurring_application_charge')
62
61
 
63
62
  old_charge = @subscription.active_charge
64
63
  assert old_charge.active?
@@ -71,8 +70,7 @@ class DiscoApp::ChargesServiceTest < ActiveSupport::TestCase
71
70
  end
72
71
 
73
72
  test 'activating an accepted recurring charge cancels other recurring charges' do
74
- stub_api_request(:get, "#{@shop.admin_url}/recurring_application_charges/654381179.json", 'widget_store/charges/get_accepted_recurring_application_charge')
75
- stub_api_request(:post, "#{@shop.admin_url}/recurring_application_charges/654381179/activate.json", 'widget_store/charges/activate_recurring_application_charge')
73
+ stub_api_request(:get, "#{@shop.admin_url}/recurring_application_charges/654381179.json", 'widget_store/charges/get_active_recurring_application_charge')
76
74
 
77
75
  assert DiscoApp::ChargesService.activate(@shop, @new_charge)
78
76
  assert @new_charge.active?
@@ -101,8 +99,7 @@ class DiscoApp::ChargesServiceTest < ActiveSupport::TestCase
101
99
  end
102
100
 
103
101
  test 'activating an accepted one-time charge is successful' do
104
- stub_api_request(:get, "#{@dev_shop.admin_url}/application_charges/1012637323.json", 'widget_store/charges/get_accepted_application_charge')
105
- stub_api_request(:post, "#{@dev_shop.admin_url}/application_charges/1012637323/activate.json", 'widget_store/charges/activate_application_charge')
102
+ stub_api_request(:get, "#{@dev_shop.admin_url}/application_charges/1012637323.json", 'widget_store/charges/get_active_application_charge')
106
103
 
107
104
  assert DiscoApp::ChargesService.activate(@dev_shop, @dev_new_charge)
108
105
  assert @dev_new_charge.active?
@@ -0,0 +1,57 @@
1
+ require 'test_helper'
2
+
3
+ module DiscoApp
4
+ class SynchroniseResourcesServiceTest < ActiveSupport::TestCase
5
+
6
+ include ActiveJob::TestHelper
7
+
8
+ def setup
9
+ @shop = disco_app_shops(:widget_store)
10
+ end
11
+
12
+ def teardown
13
+ @shop = nil
14
+ end
15
+
16
+ test 'synchronising all Products' do
17
+ assert_difference 'Product.count', 4 do
18
+ VCR.use_cassette('synchronise_products') do
19
+ DiscoApp::SynchroniseResourcesService.synchronise_all(@shop, 'Product', {})
20
+ end
21
+ end
22
+ end
23
+
24
+ test 'synchronising all Products from since_id' do
25
+ assert_difference 'Product.count', 2 do
26
+ VCR.use_cassette('synchronise_products_since_id') do
27
+ DiscoApp::SynchroniseResourcesService.synchronise_all(@shop, 'Product', {}, 95476870)
28
+ end
29
+ end
30
+ end
31
+
32
+ test 'synchronising all Products with params' do
33
+ assert_difference 'Product.count', 4 do
34
+ VCR.use_cassette('synchronise_products_with_params') do
35
+ params = { status: :any, product_type: :fruit }
36
+
37
+ DiscoApp::SynchroniseResourcesService.synchronise_all(@shop, 'Product', params)
38
+ end
39
+ end
40
+ end
41
+
42
+ test 'synchronising all Products with pagination enques job with since id' do
43
+ assert_difference 'Product.count', 2 do
44
+ VCR.use_cassette('synchronise_products_paginated') do
45
+ DiscoApp::SynchroniseResourcesService.stub_const(:PAGE_LIMIT, 2) do
46
+ DiscoApp::SynchroniseResourcesService.synchronise_all(@shop, 'Product', {})
47
+ end
48
+ end
49
+ end
50
+
51
+ assert_enqueued_with(
52
+ job: DiscoApp::SynchroniseResourcesJob, args: [@shop, 'Product', {}, 5476870]
53
+ )
54
+ end
55
+
56
+ end
57
+ end
data/test/test_helper.rb CHANGED
@@ -25,6 +25,8 @@ require 'support/test_shopify_api'
25
25
  # Require WebMock
26
26
  require 'webmock/minitest'
27
27
 
28
+ require "minitest/stub_const"
29
+
28
30
  # Filter out Minitest backtrace while allowing backtrace from other libraries
29
31
  # to be shown.
30
32
  Minitest.backtrace_filter = Minitest::BacktraceFilter.new
@@ -0,0 +1,130 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://widgets.myshopify.com/admin/api/2019-10/products.json?limit=250&since_id=0
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ User-Agent:
13
+ - ShopifyAPI/9.0.4 ActiveResource/5.1.1 Ruby/2.6.5
14
+ X-Shopify-Access-Token:
15
+ - <REDACTED>
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Thu, 01 Jul 2021 01:55:13 GMT
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ X-Sorting-Hat-Podid:
32
+ - '133'
33
+ X-Sorting-Hat-Shopid:
34
+ - '27703115910'
35
+ Vary:
36
+ - Accept-Encoding
37
+ Referrer-Policy:
38
+ - origin-when-cross-origin
39
+ X-Frame-Options:
40
+ - DENY
41
+ X-Shopid:
42
+ - '27703115910'
43
+ X-Shardid:
44
+ - '133'
45
+ X-Stats-Userid:
46
+ - ''
47
+ X-Stats-Apiclientid:
48
+ - '3674689'
49
+ X-Stats-Apipermissionid:
50
+ - '309989277830'
51
+ Http-X-Shopify-Shop-Api-Call-Limit:
52
+ - 1/80
53
+ X-Shopify-Shop-Api-Call-Limit:
54
+ - 1/80
55
+ X-Shopify-Api-Version:
56
+ - 2020-04
57
+ X-Shopify-Api-Version-Warning:
58
+ - https://shopify.dev/concepts/about-apis/versioning
59
+ Link:
60
+ - <https://widgets.myshopify.com/admin/api/2019-10/products.json?limit=250&page_info=eyJvcmRlciI6ImlkIGFzYyIsImxhc3RfaWQiOjY1Njk3NDE3NDYzMTAsImxhc3RfdmFsdWUiOiI2NTY5NzQxNzQ2MzEwIiwiZGlyZWN0aW9uIjoicHJldiJ9>;
61
+ rel="previous"
62
+ Strict-Transport-Security:
63
+ - max-age=7889238
64
+ X-Shopify-Stage:
65
+ - production
66
+ Content-Security-Policy:
67
+ - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://*
68
+ shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*;
69
+ connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src
70
+ ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net
71
+ https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com
72
+ https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com
73
+ https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com
74
+ https://v.shopify.com https://widget.intercom.io https://js.intercomcdn.com
75
+ ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; report-uri
76
+ /csp-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=f8937b72-b66d-4892-afba-e8bbc801093b'
77
+ X-Content-Type-Options:
78
+ - nosniff
79
+ X-Download-Options:
80
+ - noopen
81
+ X-Permitted-Cross-Domain-Policies:
82
+ - none
83
+ X-Xss-Protection:
84
+ - 1; mode=block; report=/xss-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=f8937b72-b66d-4892-afba-e8bbc801093b
85
+ X-Dc:
86
+ - gcp-australia-southeast1,gcp-us-central1,gcp-us-central1
87
+ Nel:
88
+ - '{"report_to":"network-errors","max_age":2592000,"success_fraction":0.0001}'
89
+ - '{"report_to":"network-errors","max_age":2592000,"success_fraction":0.0001}'
90
+ Report-To:
91
+ - '{"group":"network-errors","max_age":2592000,"endpoints":[{"url":"https://monorail-edge.shopifysvc.com/v1/reports/nel/20190325/shopify"}]}'
92
+ - '{"group":"network-errors","max_age":2592000,"endpoints":[{"url":"https://monorail-edge.shopifysvc.com/v1/reports/nel/20190325/shopify"}]}'
93
+ X-Request-Id:
94
+ - f8937b72-b66d-4892-afba-e8bbc801093b
95
+ Cf-Cache-Status:
96
+ - DYNAMIC
97
+ Cf-Request-Id:
98
+ - 0b0160101c0000377523bdf000000001
99
+ Expect-Ct:
100
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
101
+ Server:
102
+ - cloudflare
103
+ Cf-Ray:
104
+ - 667c02c69d453775-MEL
105
+ Alt-Svc:
106
+ - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443";
107
+ ma=86400
108
+ body:
109
+ encoding: ASCII-8BIT
110
+ string: '{"products":[{"id":65697417,"title":"Banana","body_html":"1 banana","vendor":"Simon
111
+ Sandbox","product_type":"","created_at":"2021-05-26T23:00:10-04:00","handle":"banana","updated_at":"2021-06-24T02:25:57-04:00","published_at":"2021-05-26T23:00:12-04:00","template_suffix":"","published_scope":"global","tags":"","admin_graphql_api_id":"gid:\/\/shopify\/Product\/65697417","variants":[{"product_id":65697417,"id":39367680491654,"title":"small","price":"2.00","sku":"BANANASM","position":1,"inventory_policy":"deny","compare_at_price":null,"fulfillment_service":"manual","inventory_management":null,"option1":"small","option2":null,"option3":null,"created_at":"2021-05-26T23:00:11-04:00","updated_at":"2021-06-24T03:00:42-04:00","taxable":true,"barcode":"","grams":0,"image_id":null,"weight":0.0,"weight_unit":"kg","inventory_item_id":41461801058438,"inventory_quantity":-28,"old_inventory_quantity":-28,"tax_code":"","requires_shipping":true,"admin_graphql_api_id":"gid:\/\/shopify\/ProductVariant\/39367680491654"},{"product_id":65697417,"id":39367680524422,"title":"large","price":"4.00","sku":"BANANALG","position":2,"inventory_policy":"deny","compare_at_price":null,"fulfillment_service":"manual","inventory_management":null,"option1":"large","option2":null,"option3":null,"created_at":"2021-05-26T23:00:11-04:00","updated_at":"2021-06-24T02:20:20-04:00","taxable":true,"barcode":"","grams":0,"image_id":null,"weight":0.0,"weight_unit":"kg","inventory_item_id":41461801091206,"inventory_quantity":-7,"old_inventory_quantity":-7,"tax_code":"","requires_shipping":true,"admin_graphql_api_id":"gid:\/\/shopify\/ProductVariant\/39367680524422"}],"options":[{"product_id":65697417,"id":8452847566982,"name":"Size","position":1,"values":["small","large"]}],"images":[{"product_id":65697417,"id":28384342278278,"position":1,"created_at":"2021-05-26T23:00:12-04:00","updated_at":"2021-05-26T23:00:12-04:00","alt":null,"width":1216,"height":852,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0277\/0311\/5910\/products\/ScreenShot2021-05-27at12.59.34pm.png?v=1622084412","variant_ids":[],"admin_graphql_api_id":"gid:\/\/shopify\/ProductImage\/28384342278278"}],"image":{"product_id":65697417,"id":28384342278278,"position":1,"created_at":"2021-05-26T23:00:12-04:00","updated_at":"2021-05-26T23:00:12-04:00","alt":null,"width":1216,"height":852,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0277\/0311\/5910\/products\/ScreenShot2021-05-27at12.59.34pm.png?v=1622084412","variant_ids":[],"admin_graphql_api_id":"gid:\/\/shopify\/ProductImage\/28384342278278"}},{"id":782895,"title":"Bananaman
112
+ figurine","body_html":"","vendor":"Simon Sandbox","product_type":"","created_at":"2021-06-30T21:26:18-04:00","handle":"bananaman-figurine","updated_at":"2021-06-30T21:30:29-04:00","published_at":"2021-06-30T21:26:21-04:00","template_suffix":"","published_scope":"global","tags":"","admin_graphql_api_id":"gid:\/\/shopify\/Product\/782895","variants":[{"product_id":782895,"id":39403405967494,"title":"Default
113
+ Title","price":"140.00","sku":"","position":1,"inventory_policy":"continue","compare_at_price":null,"fulfillment_service":"manual","inventory_management":null,"option1":"Default
114
+ Title","option2":null,"option3":null,"created_at":"2021-06-30T21:26:19-04:00","updated_at":"2021-06-30T21:30:29-04:00","taxable":true,"barcode":"","grams":500,"image_id":null,"weight":0.5,"weight_unit":"kg","inventory_item_id":41497910280326,"inventory_quantity":0,"old_inventory_quantity":0,"tax_code":"","requires_shipping":true,"admin_graphql_api_id":"gid:\/\/shopify\/ProductVariant\/39403405967494"}],"options":[{"product_id":782895,"id":8471613964422,"name":"Title","position":1,"values":["Default
115
+ Title"]}],"images":[{"product_id":782895,"id":28577474740358,"position":1,"created_at":"2021-06-30T21:26:22-04:00","updated_at":"2021-06-30T21:26:22-04:00","alt":null,"width":564,"height":784,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0277\/0311\/5910\/products\/ScreenShot2021-07-01at11.25.19am.png?v=1625102782","variant_ids":[],"admin_graphql_api_id":"gid:\/\/shopify\/ProductImage\/28577474740358"}],"image":{"product_id":782895,"id":28577474740358,"position":1,"created_at":"2021-06-30T21:26:22-04:00","updated_at":"2021-06-30T21:26:22-04:00","alt":null,"width":564,"height":784,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0277\/0311\/5910\/products\/ScreenShot2021-07-01at11.25.19am.png?v=1625102782","variant_ids":[],"admin_graphql_api_id":"gid:\/\/shopify\/ProductImage\/28577474740358"}},{"id":992895,"title":"Plantain","body_html":"","vendor":"Simon
116
+ Sandbox","product_type":"","created_at":"2021-06-30T21:28:30-04:00","handle":"plantain","updated_at":"2021-06-30T21:30:15-04:00","published_at":"2021-06-30T21:28:32-04:00","template_suffix":"","published_scope":"global","tags":"","admin_graphql_api_id":"gid:\/\/shopify\/Product\/882895","variants":[{"product_id":882895,"id":39403406590086,"title":"bunch
117
+ of 3","price":"2.00","sku":"","position":1,"inventory_policy":"continue","compare_at_price":null,"fulfillment_service":"manual","inventory_management":null,"option1":"bunch
118
+ of 3","option2":null,"option3":null,"created_at":"2021-06-30T21:28:30-04:00","updated_at":"2021-06-30T21:30:15-04:00","taxable":true,"barcode":"","grams":300,"image_id":null,"weight":0.3,"weight_unit":"kg","inventory_item_id":41497910902918,"inventory_quantity":0,"old_inventory_quantity":0,"tax_code":"","requires_shipping":true,"admin_graphql_api_id":"gid:\/\/shopify\/ProductVariant\/39403406590086"},{"product_id":992895,"id":39403406622854,"title":"bunch
119
+ of 6","price":"4.00","sku":"","position":2,"inventory_policy":"continue","compare_at_price":null,"fulfillment_service":"manual","inventory_management":null,"option1":"bunch
120
+ of 6","option2":null,"option3":null,"created_at":"2021-06-30T21:28:30-04:00","updated_at":"2021-06-30T21:30:15-04:00","taxable":true,"barcode":"","grams":300,"image_id":null,"weight":0.3,"weight_unit":"kg","inventory_item_id":41497910935686,"inventory_quantity":0,"old_inventory_quantity":0,"tax_code":"","requires_shipping":true,"admin_graphql_api_id":"gid:\/\/shopify\/ProductVariant\/39403406622854"},{"product_id":992895,"id":39403406655622,"title":"bunch
121
+ of 9","price":"6.00","sku":"","position":3,"inventory_policy":"continue","compare_at_price":null,"fulfillment_service":"manual","inventory_management":null,"option1":"bunch
122
+ of 9","option2":null,"option3":null,"created_at":"2021-06-30T21:28:30-04:00","updated_at":"2021-06-30T21:30:15-04:00","taxable":true,"barcode":"","grams":300,"image_id":null,"weight":0.3,"weight_unit":"kg","inventory_item_id":41497910968454,"inventory_quantity":0,"old_inventory_quantity":0,"tax_code":"","requires_shipping":true,"admin_graphql_api_id":"gid:\/\/shopify\/ProductVariant\/39403406655622"}],"options":[{"product_id":992895,"id":8471614357638,"name":"Size","position":1,"values":["bunch
123
+ of 3","bunch of 6","bunch of 9"]}],"images":[{"product_id":882895,"id":28577485160582,"position":1,"created_at":"2021-06-30T21:28:33-04:00","updated_at":"2021-06-30T21:28:33-04:00","alt":null,"width":1806,"height":1044,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0277\/0311\/5910\/products\/ScreenShot2021-07-01at11.27.33am.png?v=1625102913","variant_ids":[],"admin_graphql_api_id":"gid:\/\/shopify\/ProductImage\/28577485160582"}],"image":{"product_id":882895,"id":28577485160582,"position":1,"created_at":"2021-06-30T21:28:33-04:00","updated_at":"2021-06-30T21:28:33-04:00","alt":null,"width":1806,"height":1044,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0277\/0311\/5910\/products\/ScreenShot2021-07-01at11.27.33am.png?v=1625102913","variant_ids":[],"admin_graphql_api_id":"gid:\/\/shopify\/ProductImage\/28577485160582"}},{"id":8828959,"title":"Banana
124
+ palm","body_html":"","vendor":"Simon Sandbox","product_type":"","created_at":"2021-06-30T21:29:54-04:00","handle":"banana-palm","updated_at":"2021-06-30T21:29:55-04:00","published_at":"2021-06-30T21:29:55-04:00","template_suffix":"","published_scope":"global","tags":"","admin_graphql_api_id":"gid:\/\/shopify\/Product\/8828959","variants":[{"product_id":8828959,"id":39403407016070,"title":"Default
125
+ Title","price":"50.00","sku":"","position":1,"inventory_policy":"deny","compare_at_price":null,"fulfillment_service":"manual","inventory_management":"shopify","option1":"Default
126
+ Title","option2":null,"option3":null,"created_at":"2021-06-30T21:29:54-04:00","updated_at":"2021-06-30T21:29:54-04:00","taxable":true,"barcode":"","grams":0,"image_id":null,"weight":0.0,"weight_unit":"kg","inventory_item_id":41497911328902,"inventory_quantity":0,"old_inventory_quantity":0,"tax_code":"","requires_shipping":true,"admin_graphql_api_id":"gid:\/\/shopify\/ProductVariant\/39403407016070"}],"options":[{"product_id":8828959,"id":8471614554246,"name":"Title","position":1,"values":["Default
127
+ Title"]}],"images":[{"product_id":8828959,"id":28577490665606,"position":1,"created_at":"2021-06-30T21:29:55-04:00","updated_at":"2021-06-30T21:29:55-04:00","alt":null,"width":706,"height":640,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0277\/0311\/5910\/products\/ScreenShot2021-07-01at11.29.31am.png?v=1625102995","variant_ids":[],"admin_graphql_api_id":"gid:\/\/shopify\/ProductImage\/28577490665606"}],"image":{"product_id":8828959,"id":28577490665606,"position":1,"created_at":"2021-06-30T21:29:55-04:00","updated_at":"2021-06-30T21:29:55-04:00","alt":null,"width":706,"height":640,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0277\/0311\/5910\/products\/ScreenShot2021-07-01at11.29.31am.png?v=1625102995","variant_ids":[],"admin_graphql_api_id":"gid:\/\/shopify\/ProductImage\/28577490665606"}}]}'
128
+ http_version:
129
+ recorded_at: Thu, 01 Jul 2021 01:55:13 GMT
130
+ recorded_with: VCR 5.1.0
@@ -0,0 +1,119 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://widgets.myshopify.com/admin/api/2019-10/products.json?limit=2&since_id=0
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ User-Agent:
13
+ - ShopifyAPI/9.0.4 ActiveResource/5.1.1 Ruby/2.6.5
14
+ X-Shopify-Access-Token:
15
+ - <REDACTED>
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Thu, 01 Jul 2021 05:02:03 GMT
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ X-Sorting-Hat-Podid:
32
+ - '133'
33
+ X-Sorting-Hat-Shopid:
34
+ - '27703115910'
35
+ Vary:
36
+ - Accept-Encoding
37
+ Referrer-Policy:
38
+ - origin-when-cross-origin
39
+ X-Frame-Options:
40
+ - DENY
41
+ X-Shopid:
42
+ - '27703115910'
43
+ X-Shardid:
44
+ - '133'
45
+ X-Stats-Userid:
46
+ - ''
47
+ X-Stats-Apiclientid:
48
+ - '3674689'
49
+ X-Stats-Apipermissionid:
50
+ - '309989277830'
51
+ Http-X-Shopify-Shop-Api-Call-Limit:
52
+ - 1/80
53
+ X-Shopify-Shop-Api-Call-Limit:
54
+ - 1/80
55
+ X-Shopify-Api-Version:
56
+ - 2020-04
57
+ X-Shopify-Api-Version-Warning:
58
+ - https://shopify.dev/concepts/about-apis/versioning
59
+ Link:
60
+ - <https://widgets.myshopify.com/admin/api/2019-10/products.json?limit=2&page_info=eyJvcmRlciI6ImlkIGFzYyIsImxhc3RfaWQiOjY1Njk3NDE3NDYzMTAsImxhc3RfdmFsdWUiOiI2NTY5NzQxNzQ2MzEwIiwiZGlyZWN0aW9uIjoicHJldiJ9>;
61
+ rel="previous", <https://widgets.myshopify.com/admin/api/2019-10/products.json?limit=2&page_info=eyJvcmRlciI6ImlkIGFzYyIsImxhc3RfaWQiOjY1ODI4OTU0NzY4NzAsImxhc3RfdmFsdWUiOiI2NTgyODk1NDc2ODcwIiwiZGlyZWN0aW9uIjoibmV4dCJ9>;
62
+ rel="next"
63
+ Strict-Transport-Security:
64
+ - max-age=7889238
65
+ X-Shopify-Stage:
66
+ - production
67
+ Content-Security-Policy:
68
+ - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://*
69
+ shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*;
70
+ connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src
71
+ ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net
72
+ https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com
73
+ https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com
74
+ https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com
75
+ https://v.shopify.com https://widget.intercom.io https://js.intercomcdn.com
76
+ ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; report-uri
77
+ /csp-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=f995f8c9-854f-4183-b8e8-ef2d15d3973a'
78
+ X-Content-Type-Options:
79
+ - nosniff
80
+ X-Download-Options:
81
+ - noopen
82
+ X-Permitted-Cross-Domain-Policies:
83
+ - none
84
+ X-Xss-Protection:
85
+ - 1; mode=block; report=/xss-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=f995f8c9-854f-4183-b8e8-ef2d15d3973a
86
+ X-Dc:
87
+ - gcp-australia-southeast1,gcp-us-central1,gcp-us-central1
88
+ Nel:
89
+ - '{"report_to":"network-errors","max_age":2592000,"success_fraction":0.0001}'
90
+ - '{"report_to":"network-errors","max_age":2592000,"success_fraction":0.0001}'
91
+ Report-To:
92
+ - '{"group":"network-errors","max_age":2592000,"endpoints":[{"url":"https://monorail-edge.shopifysvc.com/v1/reports/nel/20190325/shopify"}]}'
93
+ - '{"group":"network-errors","max_age":2592000,"endpoints":[{"url":"https://monorail-edge.shopifysvc.com/v1/reports/nel/20190325/shopify"}]}'
94
+ X-Request-Id:
95
+ - f995f8c9-854f-4183-b8e8-ef2d15d3973a
96
+ Cf-Cache-Status:
97
+ - DYNAMIC
98
+ Cf-Request-Id:
99
+ - 0b020b1d580000fe99bb04d000000001
100
+ Expect-Ct:
101
+ - max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
102
+ Server:
103
+ - cloudflare
104
+ Cf-Ray:
105
+ - 667d14755f98fe99-MEL
106
+ Alt-Svc:
107
+ - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443";
108
+ ma=86400
109
+ body:
110
+ encoding: ASCII-8BIT
111
+ string: '{"products":[{"id":1746310,"title":"Banana","body_html":"1 banana","vendor":"Simon
112
+ Sandbox","product_type":"","created_at":"2021-05-26T23:00:10-04:00","handle":"banana","updated_at":"2021-06-24T02:25:57-04:00","published_at":"2021-05-26T23:00:12-04:00","template_suffix":"","published_scope":"global","tags":"","admin_graphql_api_id":"gid:\/\/shopify\/Product\/1746310","variants":[{"product_id":1746310,"id":39367680491654,"title":"small","price":"2.00","sku":"BANANASM","position":1,"inventory_policy":"deny","compare_at_price":null,"fulfillment_service":"manual","inventory_management":null,"option1":"small","option2":null,"option3":null,"created_at":"2021-05-26T23:00:11-04:00","updated_at":"2021-06-24T03:00:42-04:00","taxable":true,"barcode":"","grams":0,"image_id":null,"weight":0.0,"weight_unit":"kg","inventory_item_id":41461801058438,"inventory_quantity":-28,"old_inventory_quantity":-28,"tax_code":"","requires_shipping":true,"admin_graphql_api_id":"gid:\/\/shopify\/ProductVariant\/39367680491654"},{"product_id":1746310,"id":39367680524422,"title":"large","price":"4.00","sku":"BANANALG","position":2,"inventory_policy":"deny","compare_at_price":null,"fulfillment_service":"manual","inventory_management":null,"option1":"large","option2":null,"option3":null,"created_at":"2021-05-26T23:00:11-04:00","updated_at":"2021-06-24T02:20:20-04:00","taxable":true,"barcode":"","grams":0,"image_id":null,"weight":0.0,"weight_unit":"kg","inventory_item_id":41461801091206,"inventory_quantity":-7,"old_inventory_quantity":-7,"tax_code":"","requires_shipping":true,"admin_graphql_api_id":"gid:\/\/shopify\/ProductVariant\/39367680524422"}],"options":[{"product_id":1746310,"id":8452847566982,"name":"Size","position":1,"values":["small","large"]}],"images":[{"product_id":1746310,"id":28384342278278,"position":1,"created_at":"2021-05-26T23:00:12-04:00","updated_at":"2021-05-26T23:00:12-04:00","alt":null,"width":1216,"height":852,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0277\/0311\/5910\/products\/ScreenShot2021-05-27at12.59.34pm.png?v=1622084412","variant_ids":[],"admin_graphql_api_id":"gid:\/\/shopify\/ProductImage\/28384342278278"}],"image":{"product_id":1746310,"id":28384342278278,"position":1,"created_at":"2021-05-26T23:00:12-04:00","updated_at":"2021-05-26T23:00:12-04:00","alt":null,"width":1216,"height":852,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0277\/0311\/5910\/products\/ScreenShot2021-05-27at12.59.34pm.png?v=1622084412","variant_ids":[],"admin_graphql_api_id":"gid:\/\/shopify\/ProductImage\/28384342278278"}},{"id":5476870,"title":"Bananaman
113
+ figurine","body_html":"","vendor":"Simon Sandbox","product_type":"","created_at":"2021-06-30T21:26:18-04:00","handle":"bananaman-figurine","updated_at":"2021-06-30T21:30:29-04:00","published_at":"2021-06-30T21:26:21-04:00","template_suffix":"","published_scope":"global","tags":"","admin_graphql_api_id":"gid:\/\/shopify\/Product\/5476870","variants":[{"product_id":5476870,"id":39403405967494,"title":"Default
114
+ Title","price":"140.00","sku":"","position":1,"inventory_policy":"continue","compare_at_price":null,"fulfillment_service":"manual","inventory_management":null,"option1":"Default
115
+ Title","option2":null,"option3":null,"created_at":"2021-06-30T21:26:19-04:00","updated_at":"2021-06-30T21:30:29-04:00","taxable":true,"barcode":"","grams":500,"image_id":null,"weight":0.5,"weight_unit":"kg","inventory_item_id":41497910280326,"inventory_quantity":0,"old_inventory_quantity":0,"tax_code":"","requires_shipping":true,"admin_graphql_api_id":"gid:\/\/shopify\/ProductVariant\/39403405967494"}],"options":[{"product_id":5476870,"id":8471613964422,"name":"Title","position":1,"values":["Default
116
+ Title"]}],"images":[{"product_id":5476870,"id":28577474740358,"position":1,"created_at":"2021-06-30T21:26:22-04:00","updated_at":"2021-06-30T21:26:22-04:00","alt":null,"width":564,"height":784,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0277\/0311\/5910\/products\/ScreenShot2021-07-01at11.25.19am.png?v=1625102782","variant_ids":[],"admin_graphql_api_id":"gid:\/\/shopify\/ProductImage\/28577474740358"}],"image":{"product_id":5476870,"id":28577474740358,"position":1,"created_at":"2021-06-30T21:26:22-04:00","updated_at":"2021-06-30T21:26:22-04:00","alt":null,"width":564,"height":784,"src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0277\/0311\/5910\/products\/ScreenShot2021-07-01at11.25.19am.png?v=1625102782","variant_ids":[],"admin_graphql_api_id":"gid:\/\/shopify\/ProductImage\/28577474740358"}}]}'
117
+ http_version:
118
+ recorded_at: Thu, 01 Jul 2021 05:02:03 GMT
119
+ recorded_with: VCR 5.1.0