studio-engine 0.136.0 → 0.138.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -0
- data/README.md +29 -0
- data/app/assets/tailwind/studio_engine/engine.css +228 -0
- data/app/controllers/concerns/studio/connection_flow.rb +215 -0
- data/app/controllers/sessions_controller.rb +12 -3
- data/app/controllers/studio/connections_controller.rb +13 -0
- data/app/controllers/studio/integrations_controller.rb +43 -0
- data/app/controllers/studio/local_reviews_controller.rb +12 -0
- data/app/javascript/studio/carousel.js +66 -0
- data/app/javascript/studio/controllers/carousel_controller.js +203 -1
- data/app/models/concerns/studio/account.rb +143 -0
- data/app/models/concerns/studio/omniauth_user.rb +9 -17
- data/app/models/error_log.rb +14 -5
- data/app/models/studio/connection.rb +137 -0
- data/app/views/studio/_carousel.html.erb +58 -14
- data/app/views/studio/integrations/_card.html.erb +50 -0
- data/app/views/studio/integrations/index.html.erb +22 -0
- data/app/views/studio/integrations/show.html.erb +24 -0
- data/app/views/style/_tricks.html.erb +15 -0
- data/config/studio_tricks.yml +7 -0
- data/db/migrate/20261006120001_ensure_error_logs_table.rb +3 -1
- data/db/migrate/20261006120002_ensure_theme_settings_table.rb +3 -2
- data/db/migrate/20261108130000_create_studio_connections.rb +35 -0
- data/db/migrate/20261108160000_require_slugs_on_engine_tables.rb +119 -0
- data/db/migrate/20261108160001_add_engine_state_checks.rb +94 -0
- data/db/migrate/20261108170000_add_users_role_known_check.rb +69 -0
- data/lib/generators/studio/connections/connections_generator.rb +103 -0
- data/lib/studio/connections/stand_in.rb +89 -0
- data/lib/studio/connections.rb +524 -0
- data/lib/studio/engine.rb +8 -0
- data/lib/studio/integrations/egnyte.rb +69 -0
- data/lib/studio/integrations/microsoft_365.rb +63 -0
- data/lib/studio/integrations/quickbooks.rb +86 -0
- data/lib/studio/integrations.rb +265 -0
- data/lib/studio/node_tooling/README.md +9 -1
- data/lib/studio/node_tooling/e2e_helpers.js +93 -1
- data/lib/studio/node_tooling/playwright_base.js +51 -4
- data/lib/studio/roles.rb +17 -0
- data/lib/studio/version.rb +1 -1
- data/lib/studio.rb +118 -0
- metadata +22 -2
data/lib/studio.rb
CHANGED
|
@@ -12,6 +12,7 @@ require "active_support/core_ext/module/attribute_accessors"
|
|
|
12
12
|
require "active_support/core_ext/numeric/time"
|
|
13
13
|
require "active_support/core_ext/integer/time"
|
|
14
14
|
require "studio/version"
|
|
15
|
+
require "studio/roles"
|
|
15
16
|
require "studio/local_path"
|
|
16
17
|
require "studio/public_file_version"
|
|
17
18
|
require "studio/component_gallery"
|
|
@@ -75,6 +76,12 @@ require "studio/email_smoke"
|
|
|
75
76
|
require "studio/mail_transport"
|
|
76
77
|
require "studio/redis"
|
|
77
78
|
require "studio/cable"
|
|
79
|
+
require "studio/connections"
|
|
80
|
+
require "studio/connections/stand_in"
|
|
81
|
+
require "studio/integrations"
|
|
82
|
+
require "studio/integrations/quickbooks"
|
|
83
|
+
require "studio/integrations/egnyte"
|
|
84
|
+
require "studio/integrations/microsoft_365"
|
|
78
85
|
require "studio/survey"
|
|
79
86
|
require "studio/survey/breakdown"
|
|
80
87
|
require "studio/survey/export"
|
|
@@ -1199,6 +1206,117 @@ module Studio
|
|
|
1199
1206
|
# logged and swallowed — the respondent still lands on the thank-you screen.
|
|
1200
1207
|
mattr_accessor :on_survey_completed, default: ->(_response) {}
|
|
1201
1208
|
|
|
1209
|
+
# ---- Connections (docs/CONNECTIONS.md) ------------------------------------
|
|
1210
|
+
#
|
|
1211
|
+
# The generic OAuth 2.0 connection tooling. The tooling names no provider (the
|
|
1212
|
+
# engine's own definitions are Studio::Integrations, below): a
|
|
1213
|
+
# host declares each in an initializer and draws its routes.
|
|
1214
|
+
#
|
|
1215
|
+
# Studio.define_connection :files, label: "Acme Files", env: {...}, ...
|
|
1216
|
+
# # config/routes.rb
|
|
1217
|
+
# Studio.draw_connection_routes(self, :files, path: "admin/files", controller: "admin/files")
|
|
1218
|
+
#
|
|
1219
|
+
# Every option is documented on Studio::Connections::Provider#initialize.
|
|
1220
|
+
def self.define_connection(key, **options)
|
|
1221
|
+
Connections.define(key, **options)
|
|
1222
|
+
end
|
|
1223
|
+
|
|
1224
|
+
def self.connection(key)
|
|
1225
|
+
Connections.fetch(key)
|
|
1226
|
+
end
|
|
1227
|
+
|
|
1228
|
+
# Who may connect, call back and disconnect: a method name on the connection
|
|
1229
|
+
# controller (the host's ApplicationController, through Studio::ErrorHandling,
|
|
1230
|
+
# answers :require_admin), or a callable taking the controller.
|
|
1231
|
+
mattr_accessor :connection_admin_guard, default: :require_admin
|
|
1232
|
+
|
|
1233
|
+
# Draws one provider's connect, callback and disconnect into the host's
|
|
1234
|
+
# routes, and records them for the log filter and the callback URL:
|
|
1235
|
+
#
|
|
1236
|
+
# POST /<path>/connect <as>_connect (also GET when the provider takes no account at Connect)
|
|
1237
|
+
# GET /<path>/callback <as>_callback (the redirect URI to register)
|
|
1238
|
+
# DELETE /<path>/connections/:id <as>_disconnect
|
|
1239
|
+
# GET /<path> <as> (only with show: true)
|
|
1240
|
+
#
|
|
1241
|
+
# controller: the host's own controller including Studio::ConnectionFlow
|
|
1242
|
+
# (default: the engine's Studio::ConnectionsController). show: draws the
|
|
1243
|
+
# page itself at <path> (default: true when the host names its controller).
|
|
1244
|
+
# return_to: the allowlist return_to may name; its first path is the default
|
|
1245
|
+
# (default: ["/<path>"]).
|
|
1246
|
+
def self.draw_connection_routes(router, key, path: "admin/#{key}", controller: nil, as: nil, return_to: nil, show: nil)
|
|
1247
|
+
provider = Connections.fetch(key)
|
|
1248
|
+
path = path.to_s.delete_prefix("/").delete_suffix("/")
|
|
1249
|
+
controller = (controller || "studio/connections").to_s.delete_prefix("/")
|
|
1250
|
+
as = (as || path.tr("/-", "__")).to_s
|
|
1251
|
+
show = controller != "studio/connections" if show.nil?
|
|
1252
|
+
return_paths = Array(return_to || ["/#{path}"]).map(&:to_s)
|
|
1253
|
+
Connections.record_route(Connections::Route.new(provider: provider.key, path:, as:, controller:, return_paths:))
|
|
1254
|
+
|
|
1255
|
+
defaults = { studio_connection: provider.key }
|
|
1256
|
+
router.instance_exec do
|
|
1257
|
+
get "#{path}", to: "#{controller}#show", as: as, defaults: defaults if show
|
|
1258
|
+
# POST-only when the admin names the account at Connect: a GET would skip
|
|
1259
|
+
# the CSRF check, so a link carrying an attacker's account could start a
|
|
1260
|
+
# connection to it in a signed-in admin's session.
|
|
1261
|
+
connect_via = provider.account_source == :connect ? %i[post] : %i[get post]
|
|
1262
|
+
match "#{path}/connect", to: "#{controller}#connect", as: "#{as}_connect", via: connect_via, defaults: defaults
|
|
1263
|
+
get "#{path}/callback", to: "#{controller}#callback", as: "#{as}_callback", defaults: defaults
|
|
1264
|
+
delete "#{path}/connections/:id", to: "#{controller}#disconnect", as: "#{as}_disconnect", defaults: defaults
|
|
1265
|
+
end
|
|
1266
|
+
end
|
|
1267
|
+
|
|
1268
|
+
# ---- Integrations (docs/INTEGRATIONS.md) -----------------------------------
|
|
1269
|
+
#
|
|
1270
|
+
# The engine's own connection definitions (Studio::Integrations): QuickBooks,
|
|
1271
|
+
# Egnyte and Microsoft 365. Connection only; a host writes its readers.
|
|
1272
|
+
#
|
|
1273
|
+
# # config/initializers/studio_integrations.rb
|
|
1274
|
+
# Studio.enable_integration :quickbooks,
|
|
1275
|
+
# env: { client_id: "INTUIT_CLIENT_ID", client_secret: "INTUIT_CLIENT_SECRET", environment: "INTUIT_ENVIRONMENT" },
|
|
1276
|
+
# panel: "admin/integrations/quickbooks_panel"
|
|
1277
|
+
# # config/routes.rb
|
|
1278
|
+
# Studio.draw_integrations_routes(self)
|
|
1279
|
+
#
|
|
1280
|
+
# env: names the host's env vars (never values); the integration stays off
|
|
1281
|
+
# until its client id and secret are set. panel: a host partial rendered on
|
|
1282
|
+
# the integration's page with locals integration: and connections:.
|
|
1283
|
+
def self.enable_integration(key, env:, panel: nil, label: nil, scopes: nil)
|
|
1284
|
+
Integrations.enable(key, env:, panel:, label:, scopes:)
|
|
1285
|
+
end
|
|
1286
|
+
|
|
1287
|
+
def self.integration(key)
|
|
1288
|
+
Integrations.fetch(key)
|
|
1289
|
+
end
|
|
1290
|
+
|
|
1291
|
+
def self.integrations
|
|
1292
|
+
Integrations.all
|
|
1293
|
+
end
|
|
1294
|
+
|
|
1295
|
+
# Draws the admin integrations page and, for every enabled integration, its
|
|
1296
|
+
# page and connection routes (Studio.draw_connection_routes), all served by
|
|
1297
|
+
# Studio::IntegrationsController unless the host names its own:
|
|
1298
|
+
#
|
|
1299
|
+
# GET /<path> <as> the list
|
|
1300
|
+
# GET /<path>/<key> <as>_<key> one integration's page
|
|
1301
|
+
# POST /<path>/<key>/connect <as>_<key>_connect (also GET when it takes no account at Connect)
|
|
1302
|
+
# GET /<path>/<key>/callback <as>_<key>_callback the redirect URI to register
|
|
1303
|
+
# DELETE /<path>/<key>/connections/:id <as>_<key>_disconnect
|
|
1304
|
+
#
|
|
1305
|
+
# path: defaults to admin/integrations, so QuickBooks's redirect URI is
|
|
1306
|
+
# /admin/integrations/quickbooks/callback. Call it after every
|
|
1307
|
+
# enable_integration (an initializer runs before the routes load).
|
|
1308
|
+
def self.draw_integrations_routes(router, path: "admin/integrations", controller: "studio/integrations", as: nil)
|
|
1309
|
+
path = path.to_s.delete_prefix("/").delete_suffix("/")
|
|
1310
|
+
controller = controller.to_s.delete_prefix("/")
|
|
1311
|
+
as = (as || path.tr("/-", "__")).to_s
|
|
1312
|
+
Integrations.mount_path = path
|
|
1313
|
+
router.instance_exec { get path, to: "#{controller}#index", as: as }
|
|
1314
|
+
Integrations.all.each do |integration|
|
|
1315
|
+
draw_connection_routes(router, integration.key, path: "#{path}/#{integration.key}", controller:, as: "#{as}_#{integration.key}",
|
|
1316
|
+
show: true, return_to: ["/#{path}/#{integration.key}", "/#{path}"])
|
|
1317
|
+
end
|
|
1318
|
+
end
|
|
1319
|
+
|
|
1202
1320
|
# Define a survey in app code. See Studio::Survey for the DSL.
|
|
1203
1321
|
def self.define_survey(slug, &block)
|
|
1204
1322
|
Survey.define(slug, &block)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: studio-engine
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.138.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex McRitchie
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -444,6 +444,7 @@ files:
|
|
|
444
444
|
- app/controllers/concerns/solana/session_auth.rb
|
|
445
445
|
- app/controllers/concerns/studio/admin_models.rb
|
|
446
446
|
- app/controllers/concerns/studio/board/reorderable.rb
|
|
447
|
+
- app/controllers/concerns/studio/connection_flow.rb
|
|
447
448
|
- app/controllers/concerns/studio/error_handling.rb
|
|
448
449
|
- app/controllers/concerns/studio/geo_detection.rb
|
|
449
450
|
- app/controllers/concerns/studio/link_consumption.rb
|
|
@@ -462,10 +463,12 @@ files:
|
|
|
462
463
|
- app/controllers/studio/agent_chats_controller.rb
|
|
463
464
|
- app/controllers/studio/bookings_controller.rb
|
|
464
465
|
- app/controllers/studio/component_previews_controller.rb
|
|
466
|
+
- app/controllers/studio/connections_controller.rb
|
|
465
467
|
- app/controllers/studio/emails_controller.rb
|
|
466
468
|
- app/controllers/studio/geo_settings_controller.rb
|
|
467
469
|
- app/controllers/studio/google_setup_requests_controller.rb
|
|
468
470
|
- app/controllers/studio/health_reports_controller.rb
|
|
471
|
+
- app/controllers/studio/integrations_controller.rb
|
|
469
472
|
- app/controllers/studio/knowledge_docs_controller.rb
|
|
470
473
|
- app/controllers/studio/links_controller.rb
|
|
471
474
|
- app/controllers/studio/local_emails_controller.rb
|
|
@@ -594,12 +597,14 @@ files:
|
|
|
594
597
|
- app/mailers/studio/profile_mailer.rb
|
|
595
598
|
- app/mailers/user_mailer.rb
|
|
596
599
|
- app/models/concerns/sluggable.rb
|
|
600
|
+
- app/models/concerns/studio/account.rb
|
|
597
601
|
- app/models/concerns/studio/board/rankable.rb
|
|
598
602
|
- app/models/concerns/studio/omniauth_user.rb
|
|
599
603
|
- app/models/current.rb
|
|
600
604
|
- app/models/error_log.rb
|
|
601
605
|
- app/models/image_cache.rb
|
|
602
606
|
- app/models/session_context.rb
|
|
607
|
+
- app/models/studio/connection.rb
|
|
603
608
|
- app/models/studio/email_delivery.rb
|
|
604
609
|
- app/models/studio/email_setting.rb
|
|
605
610
|
- app/models/studio/enumeral.rb
|
|
@@ -713,6 +718,9 @@ files:
|
|
|
713
718
|
- app/views/studio/google_sign_in/_setup_modal.html.erb
|
|
714
719
|
- app/views/studio/health_report_mailer/daily.html.erb
|
|
715
720
|
- app/views/studio/health_report_mailer/daily.text.erb
|
|
721
|
+
- app/views/studio/integrations/_card.html.erb
|
|
722
|
+
- app/views/studio/integrations/index.html.erb
|
|
723
|
+
- app/views/studio/integrations/show.html.erb
|
|
716
724
|
- app/views/studio/knowledge_docs/_access_chips.html.erb
|
|
717
725
|
- app/views/studio/knowledge_docs/_browser.html.erb
|
|
718
726
|
- app/views/studio/knowledge_docs/_chip_styles.html.erb
|
|
@@ -878,9 +886,14 @@ files:
|
|
|
878
886
|
- db/migrate/20261029120000_add_voice_profile_to_users.rb
|
|
879
887
|
- db/migrate/20261103120000_create_studio_user_sessions.rb
|
|
880
888
|
- db/migrate/20261108120000_add_device_revocation_to_studio_user_sessions.rb
|
|
889
|
+
- db/migrate/20261108130000_create_studio_connections.rb
|
|
890
|
+
- db/migrate/20261108160000_require_slugs_on_engine_tables.rb
|
|
891
|
+
- db/migrate/20261108160001_add_engine_state_checks.rb
|
|
892
|
+
- db/migrate/20261108170000_add_users_role_known_check.rb
|
|
881
893
|
- docs/BOOKING.md
|
|
882
894
|
- docs/SITE_FOOTER.md
|
|
883
895
|
- lib/active_storage/service/studio_trash_s3_service.rb
|
|
896
|
+
- lib/generators/studio/connections/connections_generator.rb
|
|
884
897
|
- lib/generators/studio/site_identity/site_identity_generator.rb
|
|
885
898
|
- lib/studio-engine.rb
|
|
886
899
|
- lib/studio.rb
|
|
@@ -890,6 +903,8 @@ files:
|
|
|
890
903
|
- lib/studio/cable.rb
|
|
891
904
|
- lib/studio/color_scale.rb
|
|
892
905
|
- lib/studio/component_gallery.rb
|
|
906
|
+
- lib/studio/connections.rb
|
|
907
|
+
- lib/studio/connections/stand_in.rb
|
|
893
908
|
- lib/studio/crumbs.rb
|
|
894
909
|
- lib/studio/email.rb
|
|
895
910
|
- lib/studio/email_image_generator.rb
|
|
@@ -925,6 +940,10 @@ files:
|
|
|
925
940
|
- lib/studio/icons/lucide/rocket.svg
|
|
926
941
|
- lib/studio/icons/lucide/user.svg
|
|
927
942
|
- lib/studio/image_cache.rb
|
|
943
|
+
- lib/studio/integrations.rb
|
|
944
|
+
- lib/studio/integrations/egnyte.rb
|
|
945
|
+
- lib/studio/integrations/microsoft_365.rb
|
|
946
|
+
- lib/studio/integrations/quickbooks.rb
|
|
928
947
|
- lib/studio/ip_locations.rb
|
|
929
948
|
- lib/studio/js_identifier.rb
|
|
930
949
|
- lib/studio/js_literal.rb
|
|
@@ -968,6 +987,7 @@ files:
|
|
|
968
987
|
- lib/studio/public_file_version.rb
|
|
969
988
|
- lib/studio/public_user.rb
|
|
970
989
|
- lib/studio/redis.rb
|
|
990
|
+
- lib/studio/roles.rb
|
|
971
991
|
- lib/studio/s3.rb
|
|
972
992
|
- lib/studio/s3/multipart.rb
|
|
973
993
|
- lib/studio/s3/trash.rb
|