disco_app 0.15.0 → 0.16.1.pre.sidekiq.pre.6.pre.release

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/app/.DS_Store +0 -0
  3. data/app/clients/disco_app/graphql_client.rb +85 -0
  4. data/app/controllers/disco_app/flow/actions_controller.rb +7 -0
  5. data/app/controllers/disco_app/flow/concerns/actions_controller.rb +47 -0
  6. data/app/jobs/disco_app/flow/process_action_job.rb +11 -0
  7. data/app/jobs/disco_app/flow/process_trigger_job.rb +11 -0
  8. data/app/jobs/disco_app/shop_job.rb +8 -9
  9. data/app/models/disco_app/concerns/renders_assets.rb +1 -1
  10. data/app/models/disco_app/concerns/shop.rb +4 -5
  11. data/app/models/disco_app/flow/action.rb +7 -0
  12. data/app/models/disco_app/flow/concerns/action.rb +24 -0
  13. data/app/models/disco_app/flow/concerns/trigger.rb +24 -0
  14. data/app/models/disco_app/flow/trigger.rb +7 -0
  15. data/app/services/disco_app/flow/create_action.rb +35 -0
  16. data/app/services/disco_app/flow/create_trigger.rb +34 -0
  17. data/app/services/disco_app/flow/process_action.rb +50 -0
  18. data/app/services/disco_app/flow/process_trigger.rb +52 -0
  19. data/config/routes.rb +7 -1
  20. data/db/migrate/20150525000000_create_shops_if_not_existent.rb +80 -80
  21. data/db/migrate/20170315062548_create_disco_app_sources.rb +2 -0
  22. data/db/migrate/20170315062629_add_sources_to_shop_subscriptions.rb +2 -0
  23. data/db/migrate/20170327214540_create_disco_app_users.rb +2 -1
  24. data/db/migrate/20170606160751_fix_disco_app_users_index.rb +2 -0
  25. data/db/migrate/20181229100327_create_flow_actions_and_triggers.rb +32 -0
  26. data/lib/.DS_Store +0 -0
  27. data/lib/disco_app/configuration.rb +4 -0
  28. data/lib/disco_app/version.rb +1 -1
  29. data/lib/generators/disco_app/disco_app_generator.rb +24 -8
  30. data/lib/generators/disco_app/templates/config/appsignal.yml +12 -0
  31. data/lib/generators/disco_app/templates/config/cable.yml.tt +11 -0
  32. data/lib/generators/disco_app/templates/config/database.yml.tt +6 -3
  33. data/lib/generators/disco_app/templates/config/environments/staging.rb +108 -0
  34. data/lib/generators/disco_app/templates/config/newrelic.yml +3 -0
  35. data/lib/generators/disco_app/templates/controllers/home_controller.rb +1 -0
  36. data/lib/generators/disco_app/templates/initializers/session_store.rb +1 -1
  37. data/lib/generators/disco_app/templates/root/.env +3 -0
  38. data/{.github → lib/generators/disco_app/templates/root/.github}/PULL_REQUEST_TEMPLATE.md +1 -1
  39. data/lib/generators/disco_app/templates/root/.rubocop.yml +223 -158
  40. data/test/dummy/config/database.yml +3 -0
  41. data/test/dummy/config/environments/staging.rb +85 -0
  42. data/test/dummy/config/secrets.yml +3 -0
  43. data/test/dummy/db/schema.rb +39 -11
  44. data/test/dummy/log/test.log +0 -0
  45. data/test/services/disco_app/flow/create_action_test.rb +51 -0
  46. data/test/services/disco_app/flow/create_trigger_test.rb +56 -0
  47. data/test/services/disco_app/flow/process_action_test.rb +68 -0
  48. data/test/services/disco_app/flow/process_trigger_test.rb +61 -0
  49. data/test/vcr/flow_trigger_invalid_title.yml +35 -0
  50. data/test/vcr/flow_trigger_valid.yml +38 -0
  51. metadata +194 -135
  52. data/app/clients/disco_app/rollbar_client.rb +0 -53
  53. data/app/clients/disco_app/rollbar_client_error.rb +0 -2
  54. data/lib/generators/disco_app/templates/initializers/rollbar.rb +0 -23
  55. data/lib/tasks/rollbar.rake +0 -24
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: disco_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.16.1.pre.sidekiq.pre.6.pre.release
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Ballard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-04 00:00:00.000000000 Z
11
+ date: 2022-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.1.0
19
+ version: 5.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 5.1.0
26
+ version: 5.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sass-rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -134,14 +134,14 @@ dependencies:
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '5.0'
137
+ version: '6.0'
138
138
  type: :runtime
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: '5.0'
144
+ version: '6.0'
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: pg
147
147
  requirement: !ruby/object:Gem::Requirement
@@ -325,19 +325,19 @@ dependencies:
325
325
  - !ruby/object:Gem::Version
326
326
  version: '1.7'
327
327
  - !ruby/object:Gem::Dependency
328
- name: rollbar
328
+ name: appsignal
329
329
  requirement: !ruby/object:Gem::Requirement
330
330
  requirements:
331
331
  - - "~>"
332
332
  - !ruby/object:Gem::Version
333
- version: '2.14'
333
+ version: '2.7'
334
334
  type: :runtime
335
335
  prerelease: false
336
336
  version_requirements: !ruby/object:Gem::Requirement
337
337
  requirements:
338
338
  - - "~>"
339
339
  - !ruby/object:Gem::Version
340
- version: '2.14'
340
+ version: '2.7'
341
341
  - !ruby/object:Gem::Dependency
342
342
  name: oj
343
343
  requirement: !ruby/object:Gem::Requirement
@@ -394,6 +394,34 @@ dependencies:
394
394
  - - "~>"
395
395
  - !ruby/object:Gem::Version
396
396
  version: '1.0'
397
+ - !ruby/object:Gem::Dependency
398
+ name: interactor
399
+ requirement: !ruby/object:Gem::Requirement
400
+ requirements:
401
+ - - ">="
402
+ - !ruby/object:Gem::Version
403
+ version: '0'
404
+ type: :runtime
405
+ prerelease: false
406
+ version_requirements: !ruby/object:Gem::Requirement
407
+ requirements:
408
+ - - ">="
409
+ - !ruby/object:Gem::Version
410
+ version: '0'
411
+ - !ruby/object:Gem::Dependency
412
+ name: interactor-rails
413
+ requirement: !ruby/object:Gem::Requirement
414
+ requirements:
415
+ - - ">="
416
+ - !ruby/object:Gem::Version
417
+ version: '0'
418
+ type: :runtime
419
+ prerelease: false
420
+ version_requirements: !ruby/object:Gem::Requirement
421
+ requirements:
422
+ - - ">="
423
+ - !ruby/object:Gem::Version
424
+ version: '0'
397
425
  - !ruby/object:Gem::Dependency
398
426
  name: dotenv-rails
399
427
  requirement: !ruby/object:Gem::Requirement
@@ -485,8 +513,8 @@ executables: []
485
513
  extensions: []
486
514
  extra_rdoc_files: []
487
515
  files:
488
- - ".github/PULL_REQUEST_TEMPLATE.md"
489
516
  - Rakefile
517
+ - app/.DS_Store
490
518
  - app/assets/components/disco_app/buttons/model-destroy-button.es6.jsx
491
519
  - app/assets/components/disco_app/forms/model-form.es6.jsx
492
520
  - app/assets/components/embedded_app/bar.es6.jsx
@@ -565,8 +593,7 @@ files:
565
593
  - app/assets/stylesheets/disco_app/ui-kit/_ui-type.scss
566
594
  - app/clients/disco_app/api_client.rb
567
595
  - app/clients/disco_app/disco_api_error.rb
568
- - app/clients/disco_app/rollbar_client.rb
569
- - app/clients/disco_app/rollbar_client_error.rb
596
+ - app/clients/disco_app/graphql_client.rb
570
597
  - app/controllers/disco_app/admin/app_settings_controller.rb
571
598
  - app/controllers/disco_app/admin/application_controller.rb
572
599
  - app/controllers/disco_app/admin/concerns/app_settings_controller.rb
@@ -586,6 +613,8 @@ files:
586
613
  - app/controllers/disco_app/concerns/carrier_request_controller.rb
587
614
  - app/controllers/disco_app/concerns/user_authenticated_controller.rb
588
615
  - app/controllers/disco_app/concerns/webhooks_controller.rb
616
+ - app/controllers/disco_app/flow/actions_controller.rb
617
+ - app/controllers/disco_app/flow/concerns/actions_controller.rb
589
618
  - app/controllers/disco_app/frame_controller.rb
590
619
  - app/controllers/disco_app/install_controller.rb
591
620
  - app/controllers/disco_app/subscriptions_controller.rb
@@ -605,6 +634,8 @@ files:
605
634
  - app/jobs/disco_app/concerns/synchronise_resources_job.rb
606
635
  - app/jobs/disco_app/concerns/synchronise_users_job.rb
607
636
  - app/jobs/disco_app/concerns/synchronise_webhooks_job.rb
637
+ - app/jobs/disco_app/flow/process_action_job.rb
638
+ - app/jobs/disco_app/flow/process_trigger_job.rb
608
639
  - app/jobs/disco_app/render_asset_group_job.rb
609
640
  - app/jobs/disco_app/send_subscription_job.rb
610
641
  - app/jobs/disco_app/shop_job.rb
@@ -629,6 +660,10 @@ files:
629
660
  - app/models/disco_app/concerns/synchronises.rb
630
661
  - app/models/disco_app/concerns/taggable.rb
631
662
  - app/models/disco_app/concerns/user.rb
663
+ - app/models/disco_app/flow/action.rb
664
+ - app/models/disco_app/flow/concerns/action.rb
665
+ - app/models/disco_app/flow/concerns/trigger.rb
666
+ - app/models/disco_app/flow/trigger.rb
632
667
  - app/models/disco_app/plan.rb
633
668
  - app/models/disco_app/plan_code.rb
634
669
  - app/models/disco_app/recurring_application_charge.rb
@@ -641,6 +676,10 @@ files:
641
676
  - app/resources/disco_app/admin/resources/shop_resource.rb
642
677
  - app/services/disco_app/carrier_request_service.rb
643
678
  - app/services/disco_app/charges_service.rb
679
+ - app/services/disco_app/flow/create_action.rb
680
+ - app/services/disco_app/flow/create_trigger.rb
681
+ - app/services/disco_app/flow/process_action.rb
682
+ - app/services/disco_app/flow/process_trigger.rb
644
683
  - app/services/disco_app/partner_app_service.rb
645
684
  - app/services/disco_app/proxy_service.rb
646
685
  - app/services/disco_app/request_validation_service.rb
@@ -682,6 +721,8 @@ files:
682
721
  - db/migrate/20170315062629_add_sources_to_shop_subscriptions.rb
683
722
  - db/migrate/20170327214540_create_disco_app_users.rb
684
723
  - db/migrate/20170606160751_fix_disco_app_users_index.rb
724
+ - db/migrate/20181229100327_create_flow_actions_and_triggers.rb
725
+ - lib/.DS_Store
685
726
  - lib/disco_app.rb
686
727
  - lib/disco_app/configuration.rb
687
728
  - lib/disco_app/constants.rb
@@ -695,12 +736,14 @@ files:
695
736
  - lib/generators/disco_app/templates/assets/javascripts/application.js
696
737
  - lib/generators/disco_app/templates/assets/javascripts/components.js
697
738
  - lib/generators/disco_app/templates/assets/stylesheets/application.scss
739
+ - lib/generators/disco_app/templates/config/appsignal.yml
740
+ - lib/generators/disco_app/templates/config/cable.yml.tt
698
741
  - lib/generators/disco_app/templates/config/database.yml.tt
742
+ - lib/generators/disco_app/templates/config/environments/staging.rb
699
743
  - lib/generators/disco_app/templates/config/newrelic.yml
700
744
  - lib/generators/disco_app/templates/config/puma.rb
701
745
  - lib/generators/disco_app/templates/controllers/home_controller.rb
702
746
  - lib/generators/disco_app/templates/initializers/disco_app.rb
703
- - lib/generators/disco_app/templates/initializers/rollbar.rb
704
747
  - lib/generators/disco_app/templates/initializers/session_store.rb
705
748
  - lib/generators/disco_app/templates/initializers/shopify_app.rb
706
749
  - lib/generators/disco_app/templates/initializers/shopify_session_repository.rb
@@ -708,6 +751,7 @@ files:
708
751
  - lib/generators/disco_app/templates/root/.editorconfig
709
752
  - lib/generators/disco_app/templates/root/.env
710
753
  - lib/generators/disco_app/templates/root/.env.local
754
+ - lib/generators/disco_app/templates/root/.github/PULL_REQUEST_TEMPLATE.md
711
755
  - lib/generators/disco_app/templates/root/.gitignore
712
756
  - lib/generators/disco_app/templates/root/.rubocop.yml
713
757
  - lib/generators/disco_app/templates/root/.ruby-version
@@ -719,7 +763,6 @@ files:
719
763
  - lib/tasks/carrier_service.rake
720
764
  - lib/tasks/database.rake
721
765
  - lib/tasks/partner_app.rake
722
- - lib/tasks/rollbar.rake
723
766
  - lib/tasks/sessions.rake
724
767
  - lib/tasks/shops.rake
725
768
  - lib/tasks/start.rake
@@ -774,6 +817,7 @@ files:
774
817
  - test/dummy/config/environment.rb
775
818
  - test/dummy/config/environments/development.rb
776
819
  - test/dummy/config/environments/production.rb
820
+ - test/dummy/config/environments/staging.rb
777
821
  - test/dummy/config/environments/test.rb
778
822
  - test/dummy/config/initializers/assets.rb
779
823
  - test/dummy/config/initializers/backtrace_silencers.rb
@@ -794,6 +838,7 @@ files:
794
838
  - test/dummy/db/migrate/20160530160739_create_asset_models.rb
795
839
  - test/dummy/db/migrate/20161105054746_create_carts.rb
796
840
  - test/dummy/db/schema.rb
841
+ - test/dummy/log/test.log
797
842
  - test/dummy/public/404.html
798
843
  - test/dummy/public/422.html
799
844
  - test/dummy/public/500.html
@@ -876,10 +921,16 @@ files:
876
921
  - test/models/disco_app/shop_test.rb
877
922
  - test/models/disco_app/subscription_test.rb
878
923
  - test/services/disco_app/charges_service_test.rb
924
+ - test/services/disco_app/flow/create_action_test.rb
925
+ - test/services/disco_app/flow/create_trigger_test.rb
926
+ - test/services/disco_app/flow/process_action_test.rb
927
+ - test/services/disco_app/flow/process_trigger_test.rb
879
928
  - test/services/disco_app/subscription_service_test.rb
880
929
  - test/support/test_file_fixtures.rb
881
930
  - test/support/test_shopify_api.rb
882
931
  - test/test_helper.rb
932
+ - test/vcr/flow_trigger_invalid_title.yml
933
+ - test/vcr/flow_trigger_valid.yml
883
934
  - test/vcr/webhook_failure.yml
884
935
  homepage: https://github.com/discolabs/disco_app/
885
936
  licenses:
@@ -896,169 +947,177 @@ required_ruby_version: !ruby/object:Gem::Requirement
896
947
  version: '0'
897
948
  required_rubygems_version: !ruby/object:Gem::Requirement
898
949
  requirements:
899
- - - ">="
950
+ - - ">"
900
951
  - !ruby/object:Gem::Version
901
- version: '0'
952
+ version: 1.3.1
902
953
  requirements: []
903
954
  rubyforge_project:
904
- rubygems_version: 2.7.7
955
+ rubygems_version: 2.7.3
905
956
  signing_key:
906
957
  specification_version: 4
907
958
  summary: Rails engine for Shopify applications.
908
959
  test_files:
909
- - test/dummy/public/500.html
910
- - test/dummy/public/favicon.ico
911
- - test/dummy/public/422.html
912
- - test/dummy/public/404.html
913
- - test/dummy/bin/rake
914
- - test/dummy/bin/rails
915
- - test/dummy/bin/setup
916
- - test/dummy/bin/bundle
917
- - test/dummy/Rakefile
918
- - test/dummy/config.ru
919
- - test/dummy/app/assets/stylesheets/application.scss
920
- - test/dummy/app/assets/javascripts/application.js
921
- - test/dummy/app/jobs/products_create_job.rb
922
- - test/dummy/app/jobs/products_update_job.rb
960
+ - test/clients/disco_app/api_client_test.rb
961
+ - test/dummy/app/models/disco_app/shop.rb
962
+ - test/dummy/app/models/product.rb
963
+ - test/dummy/app/models/js_configuration.rb
964
+ - test/dummy/app/models/widget_configuration.rb
965
+ - test/dummy/app/models/application_record.rb
966
+ - test/dummy/app/models/cart.rb
923
967
  - test/dummy/app/jobs/disco_app/app_installed_job.rb
924
968
  - test/dummy/app/jobs/disco_app/app_uninstalled_job.rb
925
- - test/dummy/app/jobs/application_job.rb
926
969
  - test/dummy/app/jobs/products_delete_job.rb
970
+ - test/dummy/app/jobs/products_update_job.rb
971
+ - test/dummy/app/jobs/products_create_job.rb
927
972
  - test/dummy/app/jobs/carts_update_job.rb
928
- - test/dummy/app/controllers/home_controller.rb
929
- - test/dummy/app/controllers/disco_app/admin/shops_controller.rb
973
+ - test/dummy/app/jobs/application_job.rb
974
+ - test/dummy/app/controllers/application_controller.rb
930
975
  - test/dummy/app/controllers/carrier_request_controller.rb
976
+ - test/dummy/app/controllers/disco_app/admin/shops_controller.rb
931
977
  - test/dummy/app/controllers/proxy_controller.rb
932
- - test/dummy/app/controllers/application_controller.rb
933
- - test/dummy/app/helpers/application_helper.rb
934
- - test/dummy/app/models/disco_app/shop.rb
935
- - test/dummy/app/models/product.rb
936
- - test/dummy/app/models/widget_configuration.rb
937
- - test/dummy/app/models/js_configuration.rb
938
- - test/dummy/app/models/application_record.rb
939
- - test/dummy/app/models/cart.rb
940
- - test/dummy/app/views/assets/script_tag.js.erb
941
- - test/dummy/app/views/assets/widget.scss.erb
942
- - test/dummy/app/views/assets/test.js.erb
943
- - test/dummy/app/views/assets/widget.js.erb
978
+ - test/dummy/app/controllers/home_controller.rb
944
979
  - test/dummy/app/views/snippets/widget.liquid.erb
945
980
  - test/dummy/app/views/home/index.html.erb
946
- - test/dummy/db/migrate/20161105054746_create_carts.rb
947
- - test/dummy/db/migrate/20160530160739_create_asset_models.rb
948
- - test/dummy/db/migrate/20160307182229_create_products.rb
949
- - test/dummy/db/schema.rb
950
- - test/dummy/config/locales/en.yml
951
- - test/dummy/config/initializers/filter_parameter_logging.rb
952
- - test/dummy/config/initializers/assets.rb
953
- - test/dummy/config/initializers/session_store.rb
954
- - test/dummy/config/initializers/inflections.rb
955
- - test/dummy/config/initializers/mime_types.rb
956
- - test/dummy/config/initializers/wrap_parameters.rb
957
- - test/dummy/config/initializers/disco_app.rb
958
- - test/dummy/config/initializers/shopify_app.rb
959
- - test/dummy/config/initializers/shopify_session_repository.rb
960
- - test/dummy/config/initializers/backtrace_silencers.rb
961
- - test/dummy/config/initializers/omniauth.rb
962
- - test/dummy/config/initializers/cookies_serializer.rb
981
+ - test/dummy/app/views/assets/widget.scss.erb
982
+ - test/dummy/app/views/assets/widget.js.erb
983
+ - test/dummy/app/views/assets/test.js.erb
984
+ - test/dummy/app/views/assets/script_tag.js.erb
985
+ - test/dummy/app/assets/javascripts/application.js
986
+ - test/dummy/app/assets/stylesheets/application.scss
987
+ - test/dummy/app/helpers/application_helper.rb
988
+ - test/dummy/bin/rake
989
+ - test/dummy/bin/setup
990
+ - test/dummy/bin/bundle
991
+ - test/dummy/bin/rails
963
992
  - test/dummy/config/secrets.yml
964
993
  - test/dummy/config/routes.rb
965
- - test/dummy/config/database.codeship.yml
994
+ - test/dummy/config/locales/en.yml
966
995
  - test/dummy/config/environments/production.rb
967
- - test/dummy/config/environments/test.rb
996
+ - test/dummy/config/environments/staging.rb
968
997
  - test/dummy/config/environments/development.rb
998
+ - test/dummy/config/environments/test.rb
969
999
  - test/dummy/config/environment.rb
970
- - test/dummy/config/boot.rb
971
- - test/dummy/config/database.yml
972
1000
  - test/dummy/config/application.rb
1001
+ - test/dummy/config/database.yml
1002
+ - test/dummy/config/database.codeship.yml
1003
+ - test/dummy/config/boot.rb
1004
+ - test/dummy/config/initializers/shopify_app.rb
1005
+ - test/dummy/config/initializers/backtrace_silencers.rb
1006
+ - test/dummy/config/initializers/mime_types.rb
1007
+ - test/dummy/config/initializers/filter_parameter_logging.rb
1008
+ - test/dummy/config/initializers/shopify_session_repository.rb
1009
+ - test/dummy/config/initializers/session_store.rb
1010
+ - test/dummy/config/initializers/wrap_parameters.rb
1011
+ - test/dummy/config/initializers/assets.rb
1012
+ - test/dummy/config/initializers/cookies_serializer.rb
1013
+ - test/dummy/config/initializers/disco_app.rb
1014
+ - test/dummy/config/initializers/omniauth.rb
1015
+ - test/dummy/config/initializers/inflections.rb
1016
+ - test/dummy/config.ru
1017
+ - test/dummy/Rakefile
1018
+ - test/dummy/public/favicon.ico
1019
+ - test/dummy/public/422.html
1020
+ - test/dummy/public/500.html
1021
+ - test/dummy/public/404.html
1022
+ - test/dummy/db/schema.rb
1023
+ - test/dummy/db/migrate/20161105054746_create_carts.rb
1024
+ - test/dummy/db/migrate/20160530160739_create_asset_models.rb
1025
+ - test/dummy/db/migrate/20160307182229_create_products.rb
1026
+ - test/dummy/log/test.log
1027
+ - test/integration/synchronises_test.rb
1028
+ - test/models/disco_app/session_test.rb
1029
+ - test/models/disco_app/renders_assets_test.rb
1030
+ - test/models/disco_app/has_metafields_test.rb
1031
+ - test/models/disco_app/plan_test.rb
1032
+ - test/models/disco_app/shop_test.rb
1033
+ - test/models/disco_app/can_be_liquified_test.rb
1034
+ - test/models/disco_app/subscription_test.rb
1035
+ - test/disco_app_test.rb
1036
+ - test/vcr/flow_trigger_valid.yml
1037
+ - test/vcr/webhook_failure.yml
1038
+ - test/vcr/flow_trigger_invalid_title.yml
1039
+ - test/support/test_shopify_api.rb
1040
+ - test/support/test_file_fixtures.rb
1041
+ - test/fixtures/products.yml
1042
+ - test/fixtures/disco_app/application_charges.yml
1043
+ - test/fixtures/disco_app/shops.yml
1044
+ - test/fixtures/disco_app/plan_codes.yml
1045
+ - test/fixtures/disco_app/subscriptions.yml
1046
+ - test/fixtures/disco_app/sources.yml
1047
+ - test/fixtures/disco_app/recurring_application_charges.yml
1048
+ - test/fixtures/disco_app/plans.yml
1049
+ - test/fixtures/widget_configurations.yml
973
1050
  - test/fixtures/liquid/model.liquid
974
- - test/fixtures/api/subscriptions/valid_request.json
975
- - test/fixtures/api/widget_store/users.json
976
1051
  - test/fixtures/api/widget_store/carrier_services.json
977
- - test/fixtures/api/widget_store/assets/create_test_js_response.json
978
- - test/fixtures/api/widget_store/assets/create_widget_js_response.json
979
- - test/fixtures/api/widget_store/assets/create_test_js_request.json
980
- - test/fixtures/api/widget_store/assets/update_script_tag_request.json
981
- - test/fixtures/api/widget_store/assets/create_script_tag_response.json
982
- - test/fixtures/api/widget_store/assets/create_script_tag_js_response.json
983
- - test/fixtures/api/widget_store/assets/create_widget_scss_request.json
984
- - test/fixtures/api/widget_store/assets/update_script_tag_response.json
985
- - test/fixtures/api/widget_store/assets/create_widget_liquid_request.json
986
- - test/fixtures/api/widget_store/assets/create_script_tag_js_request.json
987
- - test/fixtures/api/widget_store/assets/create_script_tag_request.json
988
- - test/fixtures/api/widget_store/assets/get_script_tags_preexisting_response.json
989
- - test/fixtures/api/widget_store/assets/create_widget_scss_response.json
990
- - test/fixtures/api/widget_store/assets/create_widget_liquid_response.json
991
- - test/fixtures/api/widget_store/assets/get_script_tags_preexisting_request.json
992
- - test/fixtures/api/widget_store/assets/get_script_tags_empty_response.json
993
- - test/fixtures/api/widget_store/assets/get_script_tags_empty_request.json
994
- - test/fixtures/api/widget_store/assets/create_widget_js_request.json
1052
+ - test/fixtures/api/widget_store/webhooks.json
995
1053
  - test/fixtures/api/widget_store/products/write_metafields_single_namespace_response.json
996
- - test/fixtures/api/widget_store/products/write_metafields_multiple_namespaces_request.json
997
1054
  - test/fixtures/api/widget_store/products/write_metafields_multiple_namespaces_response.json
998
1055
  - test/fixtures/api/widget_store/products/write_metafields_single_namespace_request.json
999
- - test/fixtures/api/widget_store/webhooks.json
1000
- - test/fixtures/api/widget_store/charges/create_application_charge_response.json
1001
- - test/fixtures/api/widget_store/charges/create_second_recurring_application_charge_response.json
1002
- - test/fixtures/api/widget_store/charges/activate_application_charge_response.json
1003
- - test/fixtures/api/widget_store/charges/create_application_charge_request.json
1004
- - test/fixtures/api/widget_store/charges/create_recurring_application_charge_response.json
1005
- - test/fixtures/api/widget_store/charges/get_pending_recurring_application_charge_response.json
1006
- - test/fixtures/api/widget_store/charges/get_declined_recurring_application_charge_response.json
1056
+ - test/fixtures/api/widget_store/products/write_metafields_multiple_namespaces_request.json
1057
+ - test/fixtures/api/widget_store/charges/activate_recurring_application_charge_request.json
1058
+ - test/fixtures/api/widget_store/charges/activate_application_charge_request.json
1007
1059
  - test/fixtures/api/widget_store/charges/get_pending_application_charge_response.json
1008
1060
  - test/fixtures/api/widget_store/charges/activate_recurring_application_charge_response.json
1009
- - test/fixtures/api/widget_store/charges/get_accepted_recurring_application_charge_response.json
1010
- - test/fixtures/api/widget_store/charges/activate_recurring_application_charge_request.json
1011
- - test/fixtures/api/widget_store/charges/get_accepted_application_charge_response.json
1061
+ - test/fixtures/api/widget_store/charges/create_application_charge_request.json
1062
+ - test/fixtures/api/widget_store/charges/create_application_charge_response.json
1063
+ - test/fixtures/api/widget_store/charges/activate_application_charge_response.json
1012
1064
  - test/fixtures/api/widget_store/charges/create_recurring_application_charge_request.json
1013
1065
  - test/fixtures/api/widget_store/charges/get_declined_application_charge_response.json
1066
+ - test/fixtures/api/widget_store/charges/get_declined_recurring_application_charge_response.json
1067
+ - test/fixtures/api/widget_store/charges/get_pending_recurring_application_charge_response.json
1068
+ - test/fixtures/api/widget_store/charges/get_accepted_recurring_application_charge_response.json
1014
1069
  - test/fixtures/api/widget_store/charges/create_second_recurring_application_charge_request.json
1015
- - test/fixtures/api/widget_store/charges/activate_application_charge_request.json
1016
- - test/fixtures/api/widget_store/carrier_services_create.json
1070
+ - test/fixtures/api/widget_store/charges/create_second_recurring_application_charge_response.json
1071
+ - test/fixtures/api/widget_store/charges/get_accepted_application_charge_response.json
1072
+ - test/fixtures/api/widget_store/charges/create_recurring_application_charge_response.json
1073
+ - test/fixtures/api/widget_store/users.json
1017
1074
  - test/fixtures/api/widget_store/shop.json
1018
- - test/fixtures/assets/test.js
1019
- - test/fixtures/assets/test.min.js
1020
- - test/fixtures/widget_configurations.yml
1021
- - test/fixtures/js_configurations.yml
1022
- - test/fixtures/disco_app/sources.yml
1023
- - test/fixtures/disco_app/plan_codes.yml
1024
- - test/fixtures/disco_app/shops.yml
1025
- - test/fixtures/disco_app/application_charges.yml
1026
- - test/fixtures/disco_app/subscriptions.yml
1027
- - test/fixtures/disco_app/plans.yml
1028
- - test/fixtures/disco_app/recurring_application_charges.yml
1029
- - test/fixtures/carts.yml
1075
+ - test/fixtures/api/widget_store/carrier_services_create.json
1076
+ - test/fixtures/api/widget_store/assets/create_widget_liquid_request.json
1077
+ - test/fixtures/api/widget_store/assets/create_test_js_response.json
1078
+ - test/fixtures/api/widget_store/assets/create_widget_js_request.json
1079
+ - test/fixtures/api/widget_store/assets/update_script_tag_response.json
1080
+ - test/fixtures/api/widget_store/assets/create_script_tag_js_response.json
1081
+ - test/fixtures/api/widget_store/assets/create_script_tag_response.json
1082
+ - test/fixtures/api/widget_store/assets/create_widget_scss_request.json
1083
+ - test/fixtures/api/widget_store/assets/get_script_tags_preexisting_response.json
1084
+ - test/fixtures/api/widget_store/assets/create_widget_liquid_response.json
1085
+ - test/fixtures/api/widget_store/assets/get_script_tags_preexisting_request.json
1086
+ - test/fixtures/api/widget_store/assets/create_widget_scss_response.json
1087
+ - test/fixtures/api/widget_store/assets/create_script_tag_request.json
1088
+ - test/fixtures/api/widget_store/assets/create_widget_js_response.json
1089
+ - test/fixtures/api/widget_store/assets/get_script_tags_empty_request.json
1090
+ - test/fixtures/api/widget_store/assets/update_script_tag_request.json
1091
+ - test/fixtures/api/widget_store/assets/create_script_tag_js_request.json
1092
+ - test/fixtures/api/widget_store/assets/create_test_js_request.json
1093
+ - test/fixtures/api/widget_store/assets/get_script_tags_empty_response.json
1094
+ - test/fixtures/api/subscriptions/valid_request.json
1095
+ - test/fixtures/webhooks/product_deleted.json
1030
1096
  - test/fixtures/webhooks/cart_updated.json
1031
- - test/fixtures/webhooks/app_uninstalled.json
1032
1097
  - test/fixtures/webhooks/product_updated.json
1033
1098
  - test/fixtures/webhooks/product_created.json
1034
- - test/fixtures/webhooks/product_deleted.json
1035
- - test/fixtures/products.yml
1036
- - test/support/test_file_fixtures.rb
1037
- - test/support/test_shopify_api.rb
1099
+ - test/fixtures/webhooks/app_uninstalled.json
1100
+ - test/fixtures/assets/test.js
1101
+ - test/fixtures/assets/test.min.js
1102
+ - test/fixtures/carts.yml
1103
+ - test/fixtures/js_configurations.yml
1038
1104
  - test/test_helper.rb
1039
- - test/disco_app_test.rb
1105
+ - test/jobs/disco_app/synchronise_users_job_test.rb
1106
+ - test/jobs/disco_app/synchronise_webhooks_job_test.rb
1040
1107
  - test/jobs/disco_app/app_uninstalled_job_test.rb
1041
1108
  - test/jobs/disco_app/synchronise_carrier_service_job_test.rb
1042
- - test/jobs/disco_app/synchronise_users_job_test.rb
1043
1109
  - test/jobs/disco_app/send_subscription_job_test.rb
1044
- - test/jobs/disco_app/synchronise_webhooks_job_test.rb
1045
1110
  - test/jobs/disco_app/app_installed_job_test.rb
1046
- - test/vcr/webhook_failure.yml
1111
+ - test/controllers/proxy_controller_test.rb
1047
1112
  - test/controllers/disco_app/install_controller_test.rb
1048
- - test/controllers/disco_app/webhooks_controller_test.rb
1113
+ - test/controllers/disco_app/charges_controller_test.rb
1049
1114
  - test/controllers/disco_app/admin/shops_controller_test.rb
1050
1115
  - test/controllers/disco_app/subscriptions_controller_test.rb
1051
- - test/controllers/disco_app/charges_controller_test.rb
1052
- - test/controllers/proxy_controller_test.rb
1116
+ - test/controllers/disco_app/webhooks_controller_test.rb
1053
1117
  - test/controllers/home_controller_test.rb
1054
- - test/integration/synchronises_test.rb
1055
- - test/clients/disco_app/api_client_test.rb
1056
- - test/models/disco_app/plan_test.rb
1057
- - test/models/disco_app/has_metafields_test.rb
1058
- - test/models/disco_app/shop_test.rb
1059
- - test/models/disco_app/session_test.rb
1060
- - test/models/disco_app/subscription_test.rb
1061
- - test/models/disco_app/can_be_liquified_test.rb
1062
- - test/models/disco_app/renders_assets_test.rb
1063
- - test/services/disco_app/charges_service_test.rb
1064
1118
  - test/services/disco_app/subscription_service_test.rb
1119
+ - test/services/disco_app/charges_service_test.rb
1120
+ - test/services/disco_app/flow/process_trigger_test.rb
1121
+ - test/services/disco_app/flow/process_action_test.rb
1122
+ - test/services/disco_app/flow/create_trigger_test.rb
1123
+ - test/services/disco_app/flow/create_action_test.rb
@@ -1,53 +0,0 @@
1
- require 'rest-client'
2
-
3
- class DiscoApp::RollbarClient
4
-
5
- API_URL = 'https://api.rollbar.com/api/1'
6
- CREATE_PROJECT_ENDPOINT = '/projects'
7
- ACCESS_TOKEN_ENDPOINT = '/project'
8
- ACCESS_TOKEN_SCOPE = 'post_server_item'
9
-
10
- def initialize(params)
11
- @write_access_token = params[:write_account_access_token]
12
- @read_access_token = params[:read_account_access_token]
13
- end
14
-
15
- # Create project on Rollbar, returns it new post server side access token
16
- def create_project(name)
17
- begin
18
- response = RestClient::Request.execute(
19
- method: :post,
20
- headers: { content_type: :json },
21
- url: create_api_url,
22
- payload: { name: name.parameterize }.to_json
23
- )
24
- request_access_token(ActiveSupport::JSON.decode(response).dig('result', 'id'))
25
- rescue RestClient::BadRequest => e
26
- raise RollbarClientError.new(e.message)
27
- end
28
- end
29
-
30
- private
31
-
32
- def request_access_token(project_id)
33
- begin
34
- response = RestClient.get(access_tokens_api_url(project_id))
35
- # Only return post_server_item server side access token
36
- post_server_access_token(ActiveSupport::JSON.decode(response)['result'])
37
- rescue RestClient::BadRequest => e
38
- raise RollbarClientError.new(e.message)
39
- end
40
- end
41
-
42
- def create_api_url
43
- API_URL + CREATE_PROJECT_ENDPOINT + "?access_token=#{@write_access_token}"
44
- end
45
-
46
- def access_tokens_api_url(project_id)
47
- API_URL + ACCESS_TOKEN_ENDPOINT + "/#{project_id}/access_tokens?access_token=#{@read_access_token}"
48
- end
49
-
50
- def post_server_access_token(results)
51
- results.select { |x| x['name'] == ACCESS_TOKEN_SCOPE }.first['access_token']
52
- end
53
- end
@@ -1,2 +0,0 @@
1
- class RollbarClientError < StandardError
2
- end
@@ -1,23 +0,0 @@
1
- Rollbar.configure do |config|
2
- # Fetch the access token from the environment.
3
- config.access_token = ENV['ROLLBAR_ACCESS_TOKEN']
4
-
5
- # Only use Rollbar in production when there's a token configured.
6
- unless config.access_token and Rails.env.production?
7
- config.enabled = false
8
- end
9
-
10
- # Enable delayed reporting (using Sidekiq)
11
- config.use_sidekiq
12
-
13
- # Enable "Person" feature of Rollbar in the context of a "Shop"
14
- config.person_method = 'current_shop'
15
- config.person_username_method = 'shopify_domain'
16
-
17
- # Add custom handlers.
18
- config.before_process << proc do |options|
19
- if options[:exception].is_a?(ActiveResource::ClientError) and options[:exception].message.include?('Too Many Requests')
20
- raise Rollbar::Ignore
21
- end
22
- end
23
- end
@@ -1,24 +0,0 @@
1
- require 'yaml'
2
-
3
- namespace :generate do
4
- desc "Create Rollbar project for current shopify app, and return the ROLLBAR API TOKEN"
5
- task rollbar_project: :environment do
6
- begin
7
- config_path = File.join(ENV['HOME'], '.disco_app.yml')
8
- config = YAML.load_file(config_path)
9
- rescue StandardError
10
- abort("Could not load configuration file from #{config_path}, aborting.")
11
- end
12
-
13
- params = {
14
- write_account_access_token: config['params']['ROLLBAR_ACCOUNT_ACCESS_TOKEN_WRITE'].to_s,
15
- read_account_access_token: config['params']['ROLLBAR_ACCOUNT_ACCESS_TOKEN_READ'].to_s
16
- }
17
-
18
- project_access_token = DiscoApp::RollbarClient.new(params).create_project(ENV['APP_NAME'].blank? ? ENV['SHOPIFY_APP_NAME'] : ENV['APP_NAME'])
19
- puts '#' * 80
20
- puts 'New Rollbar project successfully created!'
21
- puts "ROLLBAR_ACCESS_TOKEN = #{project_access_token}"
22
- puts '#' * 80
23
- end
24
- end