shopify_app 7.2.0 → 17.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. checksums.yaml +5 -5
  2. data/.babelrc +5 -0
  3. data/.github/CODEOWNERS +1 -0
  4. data/.github/ISSUE_TEMPLATE/bug-report.md +63 -0
  5. data/.github/ISSUE_TEMPLATE/config.yml +1 -0
  6. data/.github/ISSUE_TEMPLATE/feature-request.md +33 -0
  7. data/.github/PULL_REQUEST_TEMPLATE.md +22 -0
  8. data/.github/probots.yml +2 -0
  9. data/.github/workflows/build.yml +38 -0
  10. data/.github/workflows/release.yml +24 -0
  11. data/.github/workflows/rubocop.yml +22 -0
  12. data/.gitignore +4 -1
  13. data/.nvmrc +1 -0
  14. data/.rubocop.yml +18 -0
  15. data/.ruby-version +1 -0
  16. data/CHANGELOG.md +465 -0
  17. data/CONTRIBUTING.md +76 -0
  18. data/Gemfile +7 -0
  19. data/Gemfile.lock +256 -0
  20. data/README.md +73 -288
  21. data/Rakefile +1 -0
  22. data/SECURITY.md +59 -0
  23. data/app/assets/images/storage_access.svg +1 -0
  24. data/app/assets/javascripts/shopify_app/enable_cookies.js +3 -0
  25. data/app/assets/javascripts/shopify_app/itp_helper.js +40 -0
  26. data/app/assets/javascripts/shopify_app/partition_cookies.js +8 -0
  27. data/app/assets/javascripts/shopify_app/redirect.js +33 -0
  28. data/app/assets/javascripts/shopify_app/request_storage_access.js +3 -0
  29. data/app/assets/javascripts/shopify_app/storage_access.js +154 -0
  30. data/app/assets/javascripts/shopify_app/storage_access_redirect.js +17 -0
  31. data/app/assets/javascripts/shopify_app/top_level.js +2 -0
  32. data/app/assets/javascripts/shopify_app/top_level_interaction.js +11 -0
  33. data/app/controllers/concerns/shopify_app/authenticated.rb +16 -0
  34. data/app/controllers/concerns/shopify_app/ensure_authenticated_links.rb +26 -0
  35. data/app/controllers/concerns/shopify_app/require_known_shop.rb +39 -0
  36. data/app/controllers/concerns/shopify_app/shop_access_scopes_verification.rb +32 -0
  37. data/app/controllers/shopify_app/authenticated_controller.rb +5 -5
  38. data/app/controllers/shopify_app/callback_controller.rb +196 -0
  39. data/app/controllers/shopify_app/extension_verification_controller.rb +15 -0
  40. data/app/controllers/shopify_app/sessions_controller.rb +190 -2
  41. data/app/controllers/shopify_app/webhooks_controller.rb +16 -7
  42. data/app/views/shopify_app/partials/_button_styles.html.erb +109 -0
  43. data/app/views/shopify_app/partials/_card_styles.html.erb +33 -0
  44. data/app/views/shopify_app/partials/_empty_state_styles.html.erb +98 -0
  45. data/app/views/shopify_app/partials/_form_styles.html.erb +56 -0
  46. data/app/views/shopify_app/partials/_layout_styles.html.erb +182 -0
  47. data/app/views/shopify_app/partials/_typography_styles.html.erb +35 -0
  48. data/app/views/shopify_app/sessions/enable_cookies.html.erb +70 -0
  49. data/app/views/shopify_app/sessions/new.html.erb +39 -83
  50. data/app/views/shopify_app/sessions/request_storage_access.html.erb +68 -0
  51. data/app/views/shopify_app/sessions/top_level_interaction.html.erb +63 -0
  52. data/app/views/shopify_app/shared/redirect.html.erb +23 -0
  53. data/config/locales/cs.yml +23 -0
  54. data/config/locales/da.yml +20 -0
  55. data/config/locales/de.yml +22 -0
  56. data/config/locales/en.yml +12 -1
  57. data/config/locales/es.yml +21 -3
  58. data/config/locales/fi.yml +20 -0
  59. data/config/locales/fr.yml +23 -0
  60. data/config/locales/hi.yml +23 -0
  61. data/config/locales/it.yml +21 -0
  62. data/config/locales/ja.yml +17 -0
  63. data/config/locales/ko.yml +19 -0
  64. data/config/locales/ms.yml +22 -0
  65. data/config/locales/nb.yml +21 -0
  66. data/config/locales/nl.yml +21 -0
  67. data/config/locales/pl.yml +21 -0
  68. data/config/locales/pt-BR.yml +21 -0
  69. data/config/locales/pt-PT.yml +22 -0
  70. data/config/locales/sv.yml +21 -0
  71. data/config/locales/th.yml +20 -0
  72. data/config/locales/tr.yml +22 -0
  73. data/config/locales/vi.yml +22 -0
  74. data/config/locales/zh-CN.yml +16 -0
  75. data/config/locales/zh-TW.yml +16 -0
  76. data/config/routes.rb +12 -1
  77. data/docs/Quickstart.md +31 -0
  78. data/docs/Releasing.md +21 -0
  79. data/docs/Troubleshooting.md +16 -0
  80. data/docs/Upgrading.md +110 -0
  81. data/docs/shopify_app/authentication.md +124 -0
  82. data/docs/shopify_app/engine.md +82 -0
  83. data/docs/shopify_app/generators.md +127 -0
  84. data/docs/shopify_app/handling-access-scopes-changes.md +8 -0
  85. data/docs/shopify_app/script-tags.md +28 -0
  86. data/docs/shopify_app/session-repository.md +88 -0
  87. data/docs/shopify_app/testing.md +38 -0
  88. data/docs/shopify_app/webhooks.md +72 -0
  89. data/karma.conf.js +44 -0
  90. data/lib/generators/shopify_app/add_after_authenticate_job/add_after_authenticate_job_generator.rb +47 -0
  91. data/lib/generators/shopify_app/add_after_authenticate_job/templates/after_authenticate_job.rb +11 -0
  92. data/lib/generators/shopify_app/add_marketing_activity_extension/add_marketing_activity_extension_generator.rb +40 -0
  93. data/lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb +62 -0
  94. data/lib/generators/shopify_app/add_webhook/add_webhook_generator.rb +5 -4
  95. data/lib/generators/shopify_app/add_webhook/templates/{webhook_job.rb → webhook_job.rb.tt} +5 -0
  96. data/lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb +4 -3
  97. data/lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_controller.rb +3 -3
  98. data/lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_route.rb +10 -9
  99. data/lib/generators/shopify_app/app_proxy_controller/templates/index.html.erb +2 -2
  100. data/lib/generators/shopify_app/authenticated_controller/authenticated_controller_generator.rb +15 -0
  101. data/lib/generators/shopify_app/authenticated_controller/templates/authenticated_controller.rb +5 -0
  102. data/lib/generators/shopify_app/controllers/controllers_generator.rb +2 -1
  103. data/lib/generators/shopify_app/home_controller/home_controller_generator.rb +31 -9
  104. data/lib/generators/shopify_app/home_controller/templates/home_controller.rb +6 -1
  105. data/lib/generators/shopify_app/home_controller/templates/index.html.erb +70 -6
  106. data/lib/generators/shopify_app/home_controller/templates/unauthenticated_home_controller.rb +11 -0
  107. data/lib/generators/shopify_app/install/install_generator.rb +78 -27
  108. data/lib/generators/shopify_app/install/templates/_flash_messages.html.erb +1 -13
  109. data/lib/generators/shopify_app/install/templates/embedded_app.html.erb +12 -11
  110. data/lib/generators/shopify_app/install/templates/flash_messages.js +24 -0
  111. data/lib/generators/shopify_app/install/templates/omniauth.rb +3 -1
  112. data/lib/generators/shopify_app/install/templates/session_store.rb +4 -0
  113. data/lib/generators/shopify_app/install/templates/shopify_app.js +15 -0
  114. data/lib/generators/shopify_app/install/templates/shopify_app.rb.tt +25 -0
  115. data/lib/generators/shopify_app/install/templates/shopify_app_index.js +2 -0
  116. data/lib/generators/shopify_app/install/templates/shopify_provider.rb.tt +8 -0
  117. data/lib/generators/shopify_app/install/templates/user_agent.rb +6 -0
  118. data/lib/generators/shopify_app/products_controller/products_controller_generator.rb +19 -0
  119. data/lib/generators/shopify_app/products_controller/templates/products_controller.rb +8 -0
  120. data/lib/generators/shopify_app/rotate_shopify_token_job/rotate_shopify_token_job_generator.rb +16 -0
  121. data/lib/generators/shopify_app/rotate_shopify_token_job/templates/rotate_shopify_token.rake +17 -0
  122. data/lib/generators/shopify_app/rotate_shopify_token_job/templates/rotate_shopify_token_job.rb +42 -0
  123. data/lib/generators/shopify_app/routes/routes_generator.rb +1 -0
  124. data/lib/generators/shopify_app/routes/templates/routes.rb +10 -9
  125. data/lib/generators/shopify_app/shop_model/shop_model_generator.rb +42 -14
  126. data/lib/generators/shopify_app/shop_model/templates/db/migrate/add_shop_access_scopes_column.erb +5 -0
  127. data/lib/generators/shopify_app/shop_model/templates/db/migrate/{create_shops.rb → create_shops.erb} +1 -1
  128. data/lib/generators/shopify_app/shop_model/templates/shop.rb +6 -2
  129. data/lib/generators/shopify_app/shopify_app_generator.rb +5 -3
  130. data/lib/generators/shopify_app/user_model/templates/db/migrate/add_user_access_scopes_column.erb +5 -0
  131. data/lib/generators/shopify_app/user_model/templates/db/migrate/create_users.erb +16 -0
  132. data/lib/generators/shopify_app/user_model/templates/user.rb +8 -0
  133. data/lib/generators/shopify_app/user_model/templates/users.yml +4 -0
  134. data/lib/generators/shopify_app/user_model/user_model_generator.rb +70 -0
  135. data/lib/generators/shopify_app/views/views_generator.rb +2 -1
  136. data/lib/shopify_app/access_scopes/noop_strategy.rb +13 -0
  137. data/lib/shopify_app/access_scopes/shop_strategy.rb +24 -0
  138. data/lib/shopify_app/access_scopes/user_strategy.rb +41 -0
  139. data/lib/shopify_app/configuration.rb +69 -5
  140. data/lib/shopify_app/{app_proxy_verification.rb → controller_concerns/app_proxy_verification.rb} +4 -9
  141. data/lib/shopify_app/controller_concerns/csrf_protection.rb +15 -0
  142. data/lib/shopify_app/controller_concerns/embedded_app.rb +20 -0
  143. data/lib/shopify_app/controller_concerns/itp.rb +45 -0
  144. data/lib/shopify_app/controller_concerns/localization.rb +23 -0
  145. data/lib/shopify_app/controller_concerns/login_protection.rb +244 -0
  146. data/lib/shopify_app/controller_concerns/payload_verification.rb +24 -0
  147. data/lib/shopify_app/controller_concerns/webhook_verification.rb +23 -0
  148. data/lib/shopify_app/engine.rb +40 -0
  149. data/lib/shopify_app/jobs/scripttags_manager_job.rb +16 -0
  150. data/lib/shopify_app/{webhooks_manager_job.rb → jobs/webhooks_manager_job.rb} +3 -2
  151. data/lib/shopify_app/{scripttags_manager.rb → managers/scripttags_manager.rb} +25 -8
  152. data/lib/shopify_app/{webhooks_manager.rb → managers/webhooks_manager.rb} +6 -5
  153. data/lib/shopify_app/middleware/jwt_middleware.rb +42 -0
  154. data/lib/shopify_app/middleware/same_site_cookie_middleware.rb +34 -0
  155. data/lib/shopify_app/omniauth/omniauth_configuration.rb +64 -0
  156. data/lib/shopify_app/session/in_memory_session_store.rb +31 -0
  157. data/lib/shopify_app/session/in_memory_shop_session_store.rb +16 -0
  158. data/lib/shopify_app/session/in_memory_user_session_store.rb +16 -0
  159. data/lib/shopify_app/session/jwt.rb +63 -0
  160. data/lib/shopify_app/session/null_user_session_store.rb +22 -0
  161. data/lib/shopify_app/session/session_repository.rb +56 -0
  162. data/lib/shopify_app/session/session_storage.rb +20 -0
  163. data/lib/shopify_app/session/shop_session_storage.rb +42 -0
  164. data/lib/shopify_app/session/shop_session_storage_with_scopes.rb +58 -0
  165. data/lib/shopify_app/session/user_session_storage.rb +42 -0
  166. data/lib/shopify_app/session/user_session_storage_with_scopes.rb +58 -0
  167. data/lib/shopify_app/test_helpers/all.rb +2 -0
  168. data/lib/shopify_app/test_helpers/webhook_verification_helper.rb +17 -0
  169. data/lib/shopify_app/utils.rb +24 -4
  170. data/lib/shopify_app/version.rb +2 -1
  171. data/lib/shopify_app.rb +65 -24
  172. data/package.json +27 -0
  173. data/service.yml +7 -0
  174. data/shipit.rubygems.yml +3 -0
  175. data/shopify_app.gemspec +20 -9
  176. data/translation.yml +7 -0
  177. data/webpack.config.js +24 -0
  178. data/yarn.lock +5215 -0
  179. metadata +274 -43
  180. data/.travis.yml +0 -17
  181. data/Gemfile.rails50 +0 -5
  182. data/Gemfile.ruby22 +0 -6
  183. data/Gemfile.ruby22.rails50 +0 -9
  184. data/ISSUE_TEMPLATE.md +0 -14
  185. data/QUICKSTART.md +0 -72
  186. data/RELEASING +0 -13
  187. data/lib/generators/shopify_app/home_controller/templates/shopify_app_ready_script.html.erb +0 -11
  188. data/lib/generators/shopify_app/install/templates/shopify_app.rb +0 -9
  189. data/lib/generators/shopify_app/install/templates/shopify_provider.rb +0 -4
  190. data/lib/generators/shopify_app/install/templates/shopify_session_repository.rb +0 -23
  191. data/lib/generators/shopify_app/shop_model/templates/shopify_session_repository.rb +0 -7
  192. data/lib/shopify_app/in_memory_session_store.rb +0 -25
  193. data/lib/shopify_app/login_protection.rb +0 -103
  194. data/lib/shopify_app/scripttags_manager_job.rb +0 -15
  195. data/lib/shopify_app/session_storage.rb +0 -23
  196. data/lib/shopify_app/sessions_concern.rb +0 -101
  197. data/lib/shopify_app/shop.rb +0 -15
  198. data/lib/shopify_app/shopify_session_repository.rb +0 -34
  199. data/lib/shopify_app/webhook_verification.rb +0 -39
@@ -1,4 +1,22 @@
1
+ ---
1
2
  es:
2
- logged_in: 'Has iniciado sesión'
3
- logged_out: 'Cerrar sesión'
4
- could_not_log_in: 'No se pudo iniciar sesión en tu tienda de Shopify'
3
+ logged_out: Cerrar sesión
4
+ could_not_log_in: No se pudo iniciar sesión en tu tienda Shopify
5
+ invalid_shop_url: Dominio de tienda inválido
6
+ enable_cookies_heading: Habilitar cookies de %{app}
7
+ enable_cookies_body: Debes habilitar manualmente las cookies en este navegador para
8
+ usar %{app} en Shopify.
9
+ enable_cookies_footer: Las cookies permiten que la aplicación te autentique almacenando
10
+ temporalmente tus preferencias y datos personales. Las cookies expiran al cabo
11
+ de 30 días.
12
+ enable_cookies_action: Habilitar cookies
13
+ top_level_interaction_heading: Tu navegador necesita autenticar %{app}
14
+ top_level_interaction_body: Tu navegador requiere aplicaciones como %{app} para
15
+ solicitarte acceso a cookies antes de que Shopify pueda abrirlo por ti.
16
+ top_level_interaction_action: Continuar
17
+ request_storage_access_heading: "%{app} necesita acceso a las cookies"
18
+ request_storage_access_body: Esto permite que la aplicación te autentique almacenando
19
+ temporalmente tus datos personales. Haz clic en continuar y permite que las cookies
20
+ utilicen la aplicación.
21
+ request_storage_access_footer: Las cookies expiran a los 30 días.
22
+ request_storage_access_action: Continuar
@@ -0,0 +1,20 @@
1
+ ---
2
+ fi:
3
+ logged_out: Olet kirjautunut ulos
4
+ could_not_log_in: Kirjautuminen Shopify-kauppaan ei onnistunut
5
+ invalid_shop_url: Virheellinen kaupan verkkotunnus
6
+ enable_cookies_heading: Ota käyttöön sovelluksen %{app} evästeet
7
+ enable_cookies_body: Sinun on otettava evästeet käyttöön manuaalisesti tässä selaimessa,
8
+ jotta voit käyttää sovellusta %{app} Shopifyssa.
9
+ enable_cookies_footer: Evästeiden avulla sovellus voi todentaa sinut tallentamalla
10
+ asetuksesi ja henkilötietosi tilapäisesti. Ne vanhenevat 30 päivän kuluttua.
11
+ enable_cookies_action: Ota evästeet käyttöön
12
+ top_level_interaction_heading: Selaimesi täytyy todentaa %{app}
13
+ top_level_interaction_body: Selaimesi vaatii sovelluksia, kuten %{app}, pyytämään
14
+ sinulta luvan evästeiden käyttöön, ennen kuin Shopify voi avata sovelluksen.
15
+ top_level_interaction_action: Jatka
16
+ request_storage_access_heading: "%{app} edellyttää evästeiden käyttöä"
17
+ request_storage_access_body: Näin sovellus voi todentaa sinut tallentamalla henkilötietosi
18
+ tilapäisesti. Klikkaa Jatka ja salli evästeet sovelluksen käyttämiseksi.
19
+ request_storage_access_footer: Evästeet vanhenevat 30 päivän kuluttua.
20
+ request_storage_access_action: Jatka
@@ -0,0 +1,23 @@
1
+ ---
2
+ fr:
3
+ logged_out: Vous êtes déconnecté(e)
4
+ could_not_log_in: Impossible de se connecter à la boutique Shopify
5
+ invalid_shop_url: Url invalide
6
+ enable_cookies_heading: Activer les cookies de %{app}
7
+ enable_cookies_body: Vous devez manuellement activer les cookies dans ce navigateur
8
+ pour utiliser %{app} dans Shopify.
9
+ enable_cookies_footer: Les cookies permettent à l'application de vous authentifier
10
+ en stockant temporairement vos préférences et informations personnelles. Celles-ci
11
+ expirent après 30 jours.
12
+ enable_cookies_action: Activer les cookies
13
+ top_level_interaction_heading: Votre navigateur doit s'authentifier %{app}
14
+ top_level_interaction_body: Votre navigateur nécessite des applications telles que
15
+ %{app} pour vous demander l'accès aux cookies avant que Shopify ne puisse l'ouvrir
16
+ pour vous.
17
+ top_level_interaction_action: Continuer
18
+ request_storage_access_heading: "%{app} a besoin d'accéder aux cookies"
19
+ request_storage_access_body: Cela permet à l'application de vous authentifier en
20
+ stockant temporairement vos informations personnelles. Cliquez pour continuer
21
+ et autorisez les cookies à utiliser l'application.
22
+ request_storage_access_footer: Les cookies expirent après 30 jours.
23
+ request_storage_access_action: Continuer
@@ -0,0 +1,23 @@
1
+ ---
2
+ hi:
3
+ logged_out: सफलतापूर्वक लॉग आउट कर दिया
4
+ could_not_log_in: Shopify स्टोर में लॉग इन नहीं किया जा सका
5
+ invalid_shop_url: अमान्य शॉप डोमेन
6
+ enable_cookies_heading: "%{app} के कुकीज़ सक्षम करें"
7
+ enable_cookies_body: आपको %{app} का उपयोग Shopify में करने के लिए इस ब्राउज़र में
8
+ कुकीज़ मैन्युअल रूप से सक्षम करने चाहिए.
9
+ enable_cookies_footer: कुकीज़ अस्थायी रूप से आपकी वरीयताएं और व्यक्तिगत जानकारी स्टोर
10
+ कर ऐप को आपको प्रमाणित करने देते हैं. इनकी समय-सीमा 30 दिनों बाद समाप्त हो जाती
11
+ है.
12
+ enable_cookies_action: कुकीज़ को सक्षम करें
13
+ top_level_interaction_heading: आपके ब्राउज़र को %{app} प्रमाणित करने की आवश्यकता
14
+ है
15
+ top_level_interaction_body: आपके ब्राउज़र को %{app} जैसे ऐप की ज़रूरत होती है, जो
16
+ Shopify द्वारा आपके लिए उसे खोलने से पहले कुकीज़ पर पहुंचने करने की अनुमति मांगे.
17
+ top_level_interaction_action: जारी रखें
18
+ request_storage_access_heading: "%{app} को कुकीज़ पर पहुंच करने की आवश्यकता है"
19
+ request_storage_access_body: यह आपकी व्यक्तिगत जानकारी अस्थायी रूप से स्टोर कर ऐप
20
+ को आपको प्रमाणित करने देता है. जारी रखें पर क्लिक करें और कुकीज़ को ऐप उपयोग करने
21
+ की अनुमति दें.
22
+ request_storage_access_footer: कुकीज़ की समय-सीमा 30 दिनों बाद समाप्त हो जाती है.
23
+ request_storage_access_action: जारी रखें
@@ -0,0 +1,21 @@
1
+ ---
2
+ it:
3
+ logged_out: Disconnessione effettuata correttamente
4
+ could_not_log_in: Impossibile accedere al negozio Shopify
5
+ invalid_shop_url: Dominio negozio non valido
6
+ enable_cookies_heading: Abilita i cookie di %{app}
7
+ enable_cookies_body: Devi abilitare manualmente i cookie in questo browser per poter
8
+ utilizzare %{app} da Shopify.
9
+ enable_cookies_footer: I cookie consentono all'app di autenticarti memorizzando
10
+ temporaneamente le tue preferenze e informazioni personali. Scadono dopo 30 giorni.
11
+ enable_cookies_action: Abilita i cookie
12
+ top_level_interaction_heading: Il tuo browser deve autenticare %{app}
13
+ top_level_interaction_body: Il tuo browser richiede che app come %{app} ti chiedano
14
+ l'accesso ai cookie prima dell'apertura automatica da parte di Shopify.
15
+ top_level_interaction_action: Continua
16
+ request_storage_access_heading: "%{app} deve accedere ai cookie"
17
+ request_storage_access_body: L'app potrà così autenticarti memorizzando temporaneamente
18
+ le tue informazioni personali. Clicca su Continua e consenti ai cookie di utilizzare
19
+ l'app.
20
+ request_storage_access_footer: I cookie scadono dopo 30 giorni.
21
+ request_storage_access_action: Continua
@@ -0,0 +1,17 @@
1
+ ---
2
+ ja:
3
+ logged_out: ログインに成功しました
4
+ could_not_log_in: Shopifyストアにログインできませんでした
5
+ invalid_shop_url: ショップのドメインが無効です
6
+ enable_cookies_heading: "%{app}からのCookieを有効にする"
7
+ enable_cookies_body: Shopifyで%{app}を使用できるようにするためには、このブラウザのCookieを手動で有効にする必要があります。
8
+ enable_cookies_footer: Cookieを使用すると、各種設定や個人情報を一時的に保存することで、アプリ認証を受けることができます。30日後に有効期限が切れます。
9
+ enable_cookies_action: Cookieを有効にする
10
+ top_level_interaction_heading: お使いのブラウザを更新する必要があります%{app}
11
+ top_level_interaction_body: Shopifyがアプリを開けるように、ブラウザーはCookieにアクセスするための%{app}のようなアプリが必要です。
12
+ top_level_interaction_action: 続ける
13
+ request_storage_access_heading: "%{app}クッキーにアクセスする必要がある"
14
+ request_storage_access_body: Cookieを使用すると、個人情報を一時的に保存することで、アプリ認証を受けることができます。[続行]
15
+ をクリックして、Cookieでアプリを使用できるようにします。
16
+ request_storage_access_footer: Cookieは30日後に有効期限が切れます。
17
+ request_storage_access_action: 続ける
@@ -0,0 +1,19 @@
1
+ ---
2
+ ko:
3
+ logged_out: 성공적으로 로그아웃 되었습니다.
4
+ could_not_log_in: Shopify 스토어에 로그인할 수 없습니다.
5
+ invalid_shop_url: 유효하지 않은 상점 도메인
6
+ enable_cookies_heading: "%{app}에서 쿠키를 사용 가능"
7
+ enable_cookies_body: Shopify 내에서 %{app} 을 사용하기 위해 이 브라우저에서 쿠키를 수동으로 사용할 수 있습니다.
8
+ enable_cookies_footer: 쿠키를 사용하면 개인의 선호나 정보를 임시로 저장하여 앱에서 사용자를 인증할 수 있습니다. 쿠키는 30일
9
+ 후에 만료됩니다.
10
+ enable_cookies_action: 쿠리 사용 가능
11
+ top_level_interaction_heading: 브라우저에서 %{app} 을 인증해야 합니다.
12
+ top_level_interaction_body: Shopify를 열기 전 쿠키에 엑세스하려면 %{app} 과 같은 앱 들이 브라우저에 설치되어야
13
+ 합니다.
14
+ top_level_interaction_action: 계속
15
+ request_storage_access_heading: "%{app}에서 쿠키에 접근해야 합니다."
16
+ request_storage_access_body: 이를 통해 개인 정보를 임시로 저장하여 앱에서 사용자를 인증할 수 있습니다. 계속 클릭하여
17
+ 쿠키로 앱을 사용하세요.
18
+ request_storage_access_footer: 쿠키는 30일 후에 만료됩니다.
19
+ request_storage_access_action: 계속
@@ -0,0 +1,22 @@
1
+ ---
2
+ ms:
3
+ logged_out: Berjaya log keluar
4
+ could_not_log_in: Tidak dapat log masuk ke kedai Shopify
5
+ invalid_shop_url: Domain kedai tidak sah
6
+ enable_cookies_heading: Dayakan kuki dari %{app}
7
+ enable_cookies_body: Anda mesti mengaktifkan kuki secara manual dalam pelayar ini
8
+ untuk %{app} digunakan dalam Shopify.
9
+ enable_cookies_footer: Kuki membenarkan aplikasi mengesahkan anda dengan menyimpan
10
+ keutamaan dan maklumat peribadi anda buat sementara waktu. Ia tamat tempoh selepas
11
+ 30 hari.
12
+ enable_cookies_action: Dayakan kuki
13
+ top_level_interaction_heading: Pelayar anda perlu mengesahkan %{app}
14
+ top_level_interaction_body: Pelayar anda memerlukan aplikasi seperti %{app} untuk
15
+ meminta anda akses kepada kuki sebelum Shopify boleh membukanya untuk anda.
16
+ top_level_interaction_action: Teruskan
17
+ request_storage_access_heading: "%{app} memerlukan akses kepada kuki"
18
+ request_storage_access_body: Ini membolehkan aplikasi mengesahkan anda dengan menyimpan
19
+ maklumat peribadi anda buat sementara waktu. Klik teruskan dan benarkan kuki untuk
20
+ menggunakan aplikasi.
21
+ request_storage_access_footer: Kuki akan tamat tempoh selepas 30 hari.
22
+ request_storage_access_action: Teruskan
@@ -0,0 +1,21 @@
1
+ ---
2
+ nb:
3
+ logged_out: Logget ut
4
+ could_not_log_in: Kunne ikke logge på Shopify-butikken
5
+ invalid_shop_url: Ugyldig butikkdomene
6
+ enable_cookies_heading: Aktiver informasjonskapsler fra %{app}
7
+ enable_cookies_body: Du kan manuelt aktivere informasjonskapsler i denne nettleseren
8
+ for å kunne bruke %{app} i Shopify.
9
+ enable_cookies_footer: Informasjonskapsler lar appen autentisere deg ved å midlertidig
10
+ lagre innstillingene og personopplysningene dine. De går ut etter 30 dager.
11
+ enable_cookies_action: Aktiver informasjonskapsler
12
+ top_level_interaction_heading: Nettleseren din må autentisere %{app}
13
+ top_level_interaction_body: Nettleseren din krever apper som %{app} for å spørre
14
+ deg om tilgang til informasjonskapsler før Shopify kan åpne den for deg.
15
+ top_level_interaction_action: Fortsett
16
+ request_storage_access_heading: "%{app} må ha tilgang til informasjonskapsler"
17
+ request_storage_access_body: Informasjonskapsler lar appen autentisere deg ved å
18
+ midlertidig lagre personopplysningene dine. Klikk på Fortsett og gi informasjonskapsler
19
+ tillatelse til å bruke appen.
20
+ request_storage_access_footer: Informasjonskapslene går ut etter 30 dager.
21
+ request_storage_access_action: Fortsett
@@ -0,0 +1,21 @@
1
+ ---
2
+ nl:
3
+ logged_out: Je bent afgemeld
4
+ could_not_log_in: Kon niet aanmelden bij Shopify-winkel
5
+ invalid_shop_url: Ongeldig winkeldomein
6
+ enable_cookies_heading: Schakel cookies in van %{app}
7
+ enable_cookies_body: Je moet cookies in deze browser handmatig inschakelen om %{app}
8
+ binnen Shopify te gebruiken.
9
+ enable_cookies_footer: Met cookies kan de app je verifiëren door je voorkeuren en
10
+ persoonlijke informatie tijdelijk op te slaan. Ze vervallen na 30 dagen.
11
+ enable_cookies_action: Schakel cookies in
12
+ top_level_interaction_heading: Je browser moet %{app} verifiëren
13
+ top_level_interaction_body: Je browser heeft apps nodig zoals %{app} om je toegang
14
+ te vragen tot cookies voordat Shopify het voor je kan openen.
15
+ top_level_interaction_action: Doorgaan
16
+ request_storage_access_heading: "%{app} heeft toegang tot cookies nodig"
17
+ request_storage_access_body: Hiermee kan de app je verifiëren door je persoonlijke
18
+ gegevens tijdelijk op te slaan. Klik op Doorgaan en sta cookies toe om de app
19
+ te gebruiken.
20
+ request_storage_access_footer: Cookies verlopen na 30 dagen.
21
+ request_storage_access_action: Doorgaan
@@ -0,0 +1,21 @@
1
+ ---
2
+ pl:
3
+ logged_out: Pomyślne wylogowanie
4
+ could_not_log_in: Nie można zalogować się do sklepu Shopify
5
+ invalid_shop_url: Nieprawidłowa domena sklepu
6
+ enable_cookies_heading: Włącz korzystanie z plików cookie z %{app}
7
+ enable_cookies_body: Aby móc korzystać z %{app} w Shopify, musisz ręcznie włączyć
8
+ korzystanie z plików cookie w tej przeglądarce.
9
+ enable_cookies_footer: Pliki cookie umożliwiają uwierzytelnianie aplikacji przez
10
+ tymczasowe przechowywanie preferencji i danych osobowych. Wygasają one po 30 dniach.
11
+ enable_cookies_action: Włącz korzystanie z plików cookie
12
+ top_level_interaction_heading: Twoja przeglądarka wymaga uwierzytelnienia %{app}
13
+ top_level_interaction_body: Twoja przeglądarka wymaga takich aplikacji jak %{app},
14
+ aby poprosić o dostęp do plików cookie, zanim Shopify będzie mógł ją otworzyć.
15
+ top_level_interaction_action: Kontynuuj
16
+ request_storage_access_heading: "%{app} potrzebuje dostępu do plików cookie"
17
+ request_storage_access_body: Dzięki temu aplikacja może Cię uwierzytelniać, tymczasowo,
18
+ przechowując Twoje dane osobowe. Kliknij przycisk Kontynuuj i zezwalaj na pliki
19
+ cookie, aby korzystać z aplikacji.
20
+ request_storage_access_footer: Pliki cookie wygasają po 30 dniach.
21
+ request_storage_access_action: Kontynuuj
@@ -0,0 +1,21 @@
1
+ ---
2
+ pt-BR:
3
+ logged_out: Você saiu.
4
+ could_not_log_in: Não foi possível fazer login na Shopify store
5
+ invalid_shop_url: Domínio de loja inválido
6
+ enable_cookies_heading: Habilitar cookies de %{app}
7
+ enable_cookies_body: Você precisa habilitar manualmente os cookies neste navegador
8
+ para usar %{app} dentro da Shopify.
9
+ enable_cookies_footer: Os cookies permitem que o app o autentique armazenando temporariamente
10
+ suas preferências e dados pessoais. Eles expiram depois de 30 dias.
11
+ enable_cookies_action: Habilitar cookies
12
+ top_level_interaction_heading: Seu navegador precisa autenticar %{app}
13
+ top_level_interaction_body: Seu navegador exige que apps como o %{app} consultem
14
+ você sobre o acesso a cookies antes que a Shopify os abra.
15
+ top_level_interaction_action: Continuar
16
+ request_storage_access_heading: "%{app} precisa acessar cookies"
17
+ request_storage_access_body: Isso permite que o app autentique você armazenando
18
+ temporariamente seus dados pessoais. Clique em continuar e permita os cookies
19
+ para usar o app.
20
+ request_storage_access_footer: Os cookies expiram depois de 30 dias.
21
+ request_storage_access_action: Continuar
@@ -0,0 +1,22 @@
1
+ ---
2
+ pt-PT:
3
+ logged_out: Terminou a sessão com sucesso
4
+ could_not_log_in: Não foi possível iniciar sessão na loja da Shopify
5
+ invalid_shop_url: Domínio de loja inválido
6
+ enable_cookies_heading: Ativar cookies de %{app}
7
+ enable_cookies_body: Tem de ativar manualmente os cookies neste navegador para utilizar
8
+ %{app} dentro da Shopify.
9
+ enable_cookies_footer: Os cookies permitem que a aplicação o autentique armazenando
10
+ temporariamente as suas preferências e informações pessoais. Expiram ao fim de
11
+ 30 dias.
12
+ enable_cookies_action: Ativar cookies
13
+ top_level_interaction_heading: O seu navegador tem de autenticar %{app}
14
+ top_level_interaction_body: O seu navegador exige que aplicações como %{app} lhe
15
+ solicitem o acesso de cookies, antes que a Shopify as possa abrir.
16
+ top_level_interaction_action: Continuar
17
+ request_storage_access_heading: "%{app} tem de aceder a cookies"
18
+ request_storage_access_body: Isto permite que a aplicação o autentique armazenando
19
+ temporariamente as suas informações pessoais. Clique em continuar e permita os
20
+ cookies para utilizar a aplicação.
21
+ request_storage_access_footer: Os cookies expiram ao fim de 30 dias.
22
+ request_storage_access_action: Continuar
@@ -0,0 +1,21 @@
1
+ ---
2
+ sv:
3
+ logged_out: Har loggats ut
4
+ could_not_log_in: Det gick inte att logga in i Shopify-butiken
5
+ invalid_shop_url: Ogiltig butiksdomän
6
+ enable_cookies_heading: Aktivera cookies från %{app}
7
+ enable_cookies_body: Du måste aktivera cookies manuellt i den här webbläsaren för
8
+ att kunna använda %{app} inom Shopify.
9
+ enable_cookies_footer: Cookies låter appen autentisera dig genom att tillfälligt
10
+ lagra dina inställningar och personuppgifter. De upphör efter 30 dagar.
11
+ enable_cookies_action: Aktivera cookies
12
+ top_level_interaction_heading: Din webbläsare måste verifiera %{app}
13
+ top_level_interaction_body: Din webbläsare kräver att appar som %{app} frågar dig
14
+ om tillgång till cookies innan Shopify kan öppna den för dig.
15
+ top_level_interaction_action: Fortsätt
16
+ request_storage_access_heading: "%{app} behöver tillgång till cookies"
17
+ request_storage_access_body: Detta gör det möjligt för appen att autentisera dig
18
+ genom att tillfälligt lagra din personliga information. Klicka på fortsätt och
19
+ tillåta cookies att använda appen.
20
+ request_storage_access_footer: Cookies upphör efter 30 dagar.
21
+ request_storage_access_action: Fortsätt
@@ -0,0 +1,20 @@
1
+ ---
2
+ th:
3
+ logged_out: ออกจากระบบสำเร็จ
4
+ could_not_log_in: ไม่สามารถเข้าสู่ระบบร้านค้า Shopify ได้
5
+ invalid_shop_url: โดเมนร้านค้าไม่ถูกต้อง
6
+ enable_cookies_heading: เปิดใช้คุกกี้จาก %{app}
7
+ enable_cookies_body: คุณต้องเปิดใช้คุกกี้ด้วยตนเองในเบราว์เซอร์นี้เพื่อใช้งาน %{app}
8
+ ภายใน Shopify
9
+ enable_cookies_footer: คุกกี้ช่วยให้แอปตรวจสอบความถูกต้องของคุณด้วยการจัดเก็บความชื่นชอบและข้อมูลส่วนตัวของคุณชั่วคราว
10
+ คุกกี้จะหมดอายุหลังจาก 30 วัน
11
+ enable_cookies_action: เปิดใช้คุกกี้
12
+ top_level_interaction_heading: เบราว์เซอร์ของคุณต้องรับรองความถูกต้องของ %{app}
13
+ top_level_interaction_body: เบราว์เซอร์ของคุณต้องการแอปอย่าง %{app} เพื่อขอให้คุณเข้าถึงคุกกี้ก่อนที่
14
+ Shopify จะสามารถเปิดมันให้คุณได้
15
+ top_level_interaction_action: ดำเนินการต่อ
16
+ request_storage_access_heading: "%{app} ต้องการสิทธิ์การเข้าถึงคุกกี้"
17
+ request_storage_access_body: สิ่งนี้ช่วยให้แอปตรวจสอบความถูกต้องของคุณด้วยการจัดเก็บข้อมูลส่วนตัวของคุณชั่วคราว
18
+ คลิกดำเนินการต่อและอนุญาตให้คุกกี้ใช้แอป
19
+ request_storage_access_footer: คุกกี้จะหมดอายุหลังจาก 30 วัน
20
+ request_storage_access_action: ดำเนินการต่อ
@@ -0,0 +1,22 @@
1
+ ---
2
+ tr:
3
+ logged_out: Oturum başarıyla kapatıldı
4
+ could_not_log_in: Shopify mağazasında oturum açılamadı
5
+ invalid_shop_url: Geçersiz mağaza alan adı
6
+ enable_cookies_heading: "%{app} uygulamasından çerezleri etkinleştir"
7
+ enable_cookies_body: "%{app} uygulamasını Shopify içinde kullanabilmek için bu tarayıcıda
8
+ çerezleri manuel olarak etkinleştirmelisiniz."
9
+ enable_cookies_footer: Çerezler, tercihlerinizi ve kişisel bilgilerinizi geçici
10
+ olarak saklayıp uygulamanın kimliğinizi doğrulamasına imkan tanır. Çerezlerin
11
+ süresi 30 gün sonra sonra sona erer.
12
+ enable_cookies_action: Çerezleri etkinleştir
13
+ top_level_interaction_heading: Tarayıcınızın %{app} kimliğini doğrulaması gerekiyor
14
+ top_level_interaction_body: Tarayıcınız, Shopify tarafından açılmadan önce %{app}
15
+ gibi uygulamaların sizden çerezlere erişim izni istemesini zorunlu tutuyor.
16
+ top_level_interaction_action: Devam
17
+ request_storage_access_heading: "%{app} uygulamasının çerezlere erişmesi gerekiyor"
18
+ request_storage_access_body: Böylece uygulama, kişisel bilgilerinizi geçici olarak
19
+ saklayıp kimliğinizi doğrulayabilir. Devam et'e tıklayın ve çerezlerin uygulamayı
20
+ kullanmasına izin verin.
21
+ request_storage_access_footer: Çerezlerin süresi 30 gün sonra sonra sona erer.
22
+ request_storage_access_action: Devam
@@ -0,0 +1,22 @@
1
+ ---
2
+ vi:
3
+ logged_out: Đã đăng xuất thành công
4
+ could_not_log_in: Không thể đăng nhập vào cửa hàng trên Shopify
5
+ invalid_shop_url: Miền cửa hàng không hợp lệ
6
+ enable_cookies_heading: Bật cookie từ %{app}
7
+ enable_cookies_body: Bạn phải bật cookie trong trình duyệt này theo cách thủ công
8
+ để sử dụng %{app} trong Shopify.
9
+ enable_cookies_footer: Cookie cho phép ứng dụng xác thực bạn bằng cách tạm thời
10
+ lưu trữ tùy chọn và thông tin cá nhân của bạn. Những thông tin này sẽ hết hạn
11
+ sau 30 ngày.
12
+ enable_cookies_action: Bật cookie
13
+ top_level_interaction_heading: Trình duyệt của bạn cần xác thực %{app}
14
+ top_level_interaction_body: Trình duyệt của bạn cần các ứng dụng như %{app} để yêu
15
+ cầu quyền truy cập vào cookie thì Shopify mới có thể mở giúp bạn.
16
+ top_level_interaction_action: Tiếp tục
17
+ request_storage_access_heading: "%{app} cần quyền truy cập cookie"
18
+ request_storage_access_body: Nhờ vậy, ứng dụng có thể xác thực bạn bằng cách tạm
19
+ thời lưu trữ thông tin cá nhân của bạn. Nhấp vào tiếp tục và cho phép cookie sử
20
+ dụng ứng dụng.
21
+ request_storage_access_footer: Cookie sẽ hết hạn sau 30 ngày.
22
+ request_storage_access_action: Tiếp tục
@@ -0,0 +1,16 @@
1
+ ---
2
+ zh-CN:
3
+ logged_out: 已成功退出
4
+ could_not_log_in: 无法登录到 Shopify 商店
5
+ invalid_shop_url: 商店域名无效
6
+ enable_cookies_heading: 从 %{app} 启用 Cookie
7
+ enable_cookies_body: 您必须在此浏览器中手动启用 Cookie 才能在 Shopify 中使用 %{app}。
8
+ enable_cookies_footer: Cookie 使此应用能够通过暂时存储您的偏好设置和个人信息来验证您的身份。这些信息将在 30 天后过期。
9
+ enable_cookies_action: 启用 Cookie
10
+ top_level_interaction_heading: 您的浏览器需要对 %{app} 进行验证
11
+ top_level_interaction_body: 您的浏览器要求类似 %{app} 的应用向您申请访问 Cookie,之后 Shopify 才能为您打开它。
12
+ top_level_interaction_action: 继续
13
+ request_storage_access_heading: "%{app} 需要访问 Cookie"
14
+ request_storage_access_body: 这使此应用能够通过暂时存储您的个人信息来验证您的身份。单击继续并启用 Cookie 以使用此应用。
15
+ request_storage_access_footer: Cookie 将在 30 天后过期。
16
+ request_storage_access_action: 继续
@@ -0,0 +1,16 @@
1
+ ---
2
+ zh-TW:
3
+ logged_out: 登出成功
4
+ could_not_log_in: 無法登入 Shopify 商店
5
+ invalid_shop_url: 商店網域無效
6
+ enable_cookies_heading: 啟用 %{app} 的 Cookie
7
+ enable_cookies_body: 您必須在此瀏覽器中手動啟用 Cookie,才能夠在 Shopify 使用 %{app}。
8
+ enable_cookies_footer: Cookie 可讓應用程式暫時儲存您的偏好設定和個人資訊,藉此驗證您的身分,這些資料會在 30 天後失效。
9
+ enable_cookies_action: 啟用 Cookie
10
+ top_level_interaction_heading: 您的瀏覽器需要驗證 %{app}
11
+ top_level_interaction_body: 您的瀏覽器要求 %{app} 等應用程式向您請求 Cookie 的存取權限,才能讓 Shopify 為您開啟該應用程式。
12
+ top_level_interaction_action: 繼續
13
+ request_storage_access_heading: "%{app} 需要 Cookie 存取權限"
14
+ request_storage_access_body: Cookie 可讓應用程式暫時儲存您的個人資訊,藉此驗證您的身分。按一下繼續並允許 Cookie 使用此應用程式。
15
+ request_storage_access_footer: Cookie 將於 30 天後失效。
16
+ request_storage_access_action: 繼續
data/config/routes.rb CHANGED
@@ -1,11 +1,22 @@
1
+ # frozen_string_literal: true
1
2
  ShopifyApp::Engine.routes.draw do
2
3
  controller :sessions do
3
4
  get 'login' => :new, :as => :login
4
5
  post 'login' => :create, :as => :authenticate
5
- get 'auth/shopify/callback' => :callback
6
+ get 'enable_cookies' => :enable_cookies, :as => :enable_cookies
7
+ get 'top_level_interaction' =>
8
+ :top_level_interaction,
9
+ :as => :top_level_interaction
10
+ get 'granted_storage_access' =>
11
+ :granted_storage_access,
12
+ :as => :granted_storage_access
6
13
  get 'logout' => :destroy, :as => :logout
7
14
  end
8
15
 
16
+ controller :callback do
17
+ get 'auth/shopify/callback' => :callback
18
+ end
19
+
9
20
  namespace :webhooks do
10
21
  post ':type' => :receive
11
22
  end
@@ -0,0 +1,31 @@
1
+ # Quickstart
2
+
3
+ This guide assumes you have completed the steps to create a new Rails app using the Shopify App gem found in the [*Usage*](/README.md#usage) section of the project's [*README*](/README.md).
4
+
5
+ #### Table of contents
6
+
7
+ [Make your app available to the internet](#make-your-app-available-to-the-internet)
8
+
9
+ [Use Shopify App Bridge to embed your app in the Shopify Admin](#use-shopify-app-bridge-to-embed-your-app-in-the-shopify-admin)
10
+
11
+ ## Make your app available to the internet
12
+
13
+ Your local app needs to be accessible from the public Internet in order to install it on a Shopify store, to use the [App Proxy Controller](/lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_controller.rb) or receive [webhooks](/docs/shopify_app/webhooks.md).
14
+
15
+ Use a tunneling service like [ngrok](https://ngrok.com/), [Beeceptor](https://beeceptor.com/), [Mockbin](http://mockbin.org/), or [Hookbin](https://hookbin.com/) to make your development environment accessible to the internet.
16
+
17
+ For example with [ngrok](https://ngrok.com/), run this command to set up a tunnel proxy to Rails' default port:
18
+
19
+ ```sh
20
+ ngrok http 3000
21
+ ```
22
+
23
+ See the [*Embed the app in Shopify*](https://shopify.dev/tutorials/build-rails-react-app-that-uses-app-bridge-authentication#embed-the-app-in-shopify) section of [*Build a Shopify app with Rails, React, and App Bridge*](https://shopify.dev/tutorials/build-rails-react-app-that-uses-app-bridge-authentication) to learn more.
24
+
25
+ ## Use Shopify App Bridge to embed your app in the Shopify Admin
26
+
27
+ A basic example of using [*Shopify App Bridge*](https://shopify.dev/tools/app-bridge) is included in the install generator. An instance Shopify App Bridge is automatically initialized in [shopify_app.js](https://github.com/Shopify/shopify_app/blob/master/lib/generators/shopify_app/install/templates/shopify_app.js).
28
+
29
+ The [flash_messages.js](https://github.com/Shopify/shopify_app/blob/master/lib/generators/shopify_app/install/templates/flash_messages.js) file converts Rails [flash messages](https://api.rubyonrails.org/classes/ActionDispatch/Flash.html) to App Bridge Toast actions automatically. By default, this library is included via [unpkg in the embedded_app layout](https://github.com/Shopify/shopify_app/blob/master/lib/generators/shopify_app/install/templates/embedded_app.html.erb#L27).
30
+
31
+ For more advanced uses it is recommended to [install App Bridge via npm or yarn](https://help.shopify.com/en/api/embedded-apps/app-bridge/getting-started#set-up-shopify-app-bridge-in-your-app).
data/docs/Releasing.md ADDED
@@ -0,0 +1,21 @@
1
+ # Releasing ShopifyApp
2
+
3
+ 1. Make the code changes in a separate PR that doesn't modify the version.
4
+ 1. After that is merged, check the Semantic Versioning page for info on how to version the new release: http://semver.org
5
+ 1. Create a pull request with the following changes:
6
+ - Update the version of ShopifyApp in lib/shopify_app/version.rb
7
+ - Update the version of shopify_app in package.json
8
+ - Run `bundle` to update `Gemfile.lock`
9
+ - Add a CHANGELOG entry for the new release with the date
10
+ - Change the title of the PR to something like: "Packaging for release X.Y.Z"
11
+ 1. Merge your pull request
12
+ 1. Checkout and pull from master so you have the latest version of the shopify_app
13
+ 1. Tag the HEAD with the version
14
+ ```bash
15
+ $ git tag -f vX.Y.Z && git push --tags --force
16
+ ```
17
+ 1. Check that Create Release workflow successfully runs
18
+ 1. Use Shipit to build and push the gem
19
+
20
+ If you see an error like 'You need to create the vX.Y.X tag first', clear git
21
+ cache in Shipit settings
@@ -0,0 +1,16 @@
1
+ Troubleshooting Shopify App
2
+ ===========
3
+
4
+ ### Generator shopify_app:install hangs
5
+
6
+ Rails uses spring by default to speed up development. To run the generator, spring has to be stopped:
7
+
8
+ ```sh
9
+ $ bundle exec spring stop
10
+ ```
11
+
12
+ Run shopify_app generator again.
13
+
14
+ ### App installation fails with 'The page you’re looking for could not be found' if the app was installed before
15
+
16
+ This issue can occur when the session (the model you set as `ShopifyApp::SessionRepository.storage`) isn't deleted when the user uninstalls your app. A possible fix for this is listening to the `app/uninstalled` webhook and deleting the corresponding session in the webhook handler.
data/docs/Upgrading.md ADDED
@@ -0,0 +1,110 @@
1
+ # Upgrading
2
+
3
+ This file documents important changes needed to upgrade your app's Shopify App version to a new major version.
4
+
5
+ #### Table of contents
6
+
7
+ [Upgrading to `v13.0.0`](#upgrading-to-v1300)
8
+
9
+ [Upgrading to `v11.7.0`](#upgrading-to-v1170)
10
+
11
+ [Upgrading from `v8.6` to `v9.0.0`](#upgrading-from-v86-to-v900)
12
+
13
+ ## Upgrading to `v13.0.0`
14
+
15
+ Version 13.0.0 adds the ability to use both user and shop sessions, concurrently. This however involved a large
16
+ change to how session stores work. Here are the steps to migrate to 13.x
17
+
18
+ ### Changes to `config/initializers/shopify_app.rb`
19
+
20
+ - *REMOVE* `config.per_user_tokens = [true|false]` this is no longer needed
21
+ - *CHANGE* `config.session_repository = 'Shop'` To `config.shop_session_repository = 'Shop'`
22
+ - *ADD (optional)* User Session Storage `config.user_session_repository = 'User'`
23
+
24
+ ### Shop Model Changes (normally `app/models/shop.rb`)
25
+
26
+ - *CHANGE* `include ShopifyApp::SessionStorage` to `include ShopifyApp::ShopSessionStorage`
27
+
28
+ ### Changes to the @shop_session instance variable (normally in `app/controllers/*.rb`)
29
+
30
+ - *CHANGE* if you are using shop sessions, `@shop_session` will need to be changed to `@current_shopify_session`.
31
+
32
+ ### Changes to Rails `session`
33
+
34
+ - *CHANGE* `session[:shopify]` is no longer set. Use `session[:user_id]` if your app uses user based tokens, or `session[:shop_id]` if your app uses shop based tokens.
35
+
36
+ ### Changes to `ShopifyApp::LoginProtection`
37
+
38
+ `ShopifyApp::LoginProtection`
39
+
40
+ - CHANGE if you are using `ShopifyApp::LoginProtection#shopify_session` in your code, it will need to be
41
+ changed to `ShopifyApp::LoginProtection#activate_shopify_session`
42
+ - CHANGE if you are using `ShopifyApp::LoginProtection#clear_shop_session` in your code, it will need to be
43
+ changed to `ShopifyApp::LoginProtection#clear_shopify_session`
44
+
45
+ ### Notes
46
+ You do not need a user model; a shop session is fine for most applications.
47
+
48
+ ---
49
+
50
+ ## Upgrading to `v11.7.0`
51
+
52
+ ### Session storage method signature breaking change
53
+ If you override `def self.store(auth_session)` method in your session storage model (e.g. Shop), the method signature has changed to `def self.store(auth_session, *args)` in order to support user-based token storage. Please update your method signature to include the second argument.
54
+
55
+ ---
56
+
57
+ ## Upgrading from `v8.6` to `v9.0.0`
58
+
59
+ ### Configuration change
60
+
61
+ Add an API version configuration in `config/initializers/shopify_app.rb`
62
+ Set this to the version you want to run against by default. See [Shopify API docs](https://help.shopify.com/en/api/versioning) for versions available.
63
+ ```ruby
64
+ config.api_version = '2019-04'
65
+ ```
66
+
67
+ ### Session storage change
68
+
69
+ You will need to add an `api_version` method to your session storage object. The default implementation for this is.
70
+ ```ruby
71
+ def api_version
72
+ ShopifyApp.configuration.api_version
73
+ end
74
+ ```
75
+
76
+ ### Generated file change
77
+
78
+ `embedded_app.html.erb` the usage of `shop_session.url` needs to be changed to `shop_session.domain`
79
+ ```erb
80
+ <script type="text/javascript">
81
+ ShopifyApp.init({
82
+ apiKey: "<%= ShopifyApp.configuration.api_key %>",
83
+
84
+ shopOrigin: "<%= "https://#{ @shop_session.url }" if @shop_session %>",
85
+
86
+ debug: false,
87
+ forceRedirect: true
88
+ });
89
+ </script>
90
+ ```
91
+ is changed to
92
+ ```erb
93
+ <script type="text/javascript">
94
+ ShopifyApp.init({
95
+ apiKey: "<%= ShopifyApp.configuration.api_key %>",
96
+
97
+ shopOrigin: "<%= "https://#{ @shop_session.domain }" if @shop_session %>",
98
+
99
+ debug: false,
100
+ forceRedirect: true
101
+ });
102
+ </script>
103
+ ```
104
+
105
+ ### ShopifyAPI changes
106
+
107
+ You will need to also follow the ShopifyAPI [upgrade guide](https://github.com/Shopify/shopify_api/blob/master/README.md#-breaking-change-notice-for-version-700-) to ensure your app is ready to work with API versioning.
108
+
109
+ [dashboard]:https://partners.shopify.com
110
+ [app-bridge]:https://help.shopify.com/en/api/embedded-apps/app-bridge