hub_kernel-mcp 0.9.0 → 0.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8534b1719040ee0fe7abd7dbf92ab23f559c488830a708197ee1b2180c10ef8
4
- data.tar.gz: c9786d5f6a3f119b0764d13f89388c0f79af29c61a61a5474ccb0c416e787be5
3
+ metadata.gz: 8a4a7cf0c87e5403e239b9c3432078e4b391a5153f8c0edabfcfb5bae6a8a9ca
4
+ data.tar.gz: c336f3f495ba4c8a2402522d5c3768cc23471addc056d97ae9ef7cffaf8f7485
5
5
  SHA512:
6
- metadata.gz: cf5665cfff0c4fa70f333d33da2f44d0bf1ad4ea61d36963c072c0c1111092b6b49ad81c6602d397bb5554dc1870acf7077afe64c3ea5514e8f564fa1f23a318
7
- data.tar.gz: 679fde439d3736ba3ad2237dd50588cef2ca1c5692758791461b639bab6273fc133266f18492d96d30dedfd38ec5edbd8f85af496cd070493affea4dab342be9
6
+ metadata.gz: 5792da54acd52f1edb3a0f2cb9046f5cae84a0e62e4b209bdd4ed15350db93de185c7e0738778ad4a5d02c35799927c13f92c55bc7488242bf17e7e96fb3f519
7
+ data.tar.gz: ffdb145c72ac5217d476db265dc4bad024410161de50e156410d709b93ab627387a078f4295cc2fec6f6135c35675045e6fc48885c0e726fc6cbb9a2ad247b54
data/README.md CHANGED
@@ -15,6 +15,11 @@ HubKernel::Mcp.person_method = :current_person
15
15
  HubKernel::Mcp.account_method = :current_account
16
16
  ```
17
17
 
18
+ When `HubKernel::Mcp.person_method` or `HubKernel::Mcp.account_method` is not set, MCP uses
19
+ `HubKernel::Interface.person_method` or `HubKernel::Interface.account_method`, so a host that
20
+ also serves hub_kernel-api can name the caller once in hub_kernel-interface. MCP's own setting
21
+ is used when it is set.
22
+
18
23
  The hubs served are the host's one list in hub_kernel-interface, which every interface gem
19
24
  serves:
20
25
 
@@ -76,9 +76,9 @@ module HubKernel
76
76
 
77
77
  def description(served_name, exposure) = exposure.writes ? "Changes data in the #{served_name} hub." : "Reads data from the #{served_name} hub."
78
78
 
79
- def caller_person = send(HubKernel::Mcp.person_method)
79
+ def caller_person = send(HubKernel::Mcp.person_method || HubKernel::Interface.person_method)
80
80
 
81
- def caller_account = send(HubKernel::Mcp.account_method)
81
+ def caller_account = send(HubKernel::Mcp.account_method || HubKernel::Interface.account_method)
82
82
  end
83
83
  end
84
84
  end
@@ -1,15 +1,10 @@
1
- <ul>
2
- <% HubKernel::Mcp::Connection.of(person).includes(:client).order(:created_at).each do |connection| %>
3
- <li>
4
- <%= ui_section(title: connection.client.name, subtitle: "Connected #{l(connection.created_at, format: :long)}") do %>
5
- <%= ui_panel do %>
6
- <span><%= connection.last_used_at ? "Last used #{l(connection.last_used_at, format: :long)}" : "Never used" %></span>
7
- <%= ui_form(action: submit_url, method: :patch) do %>
8
- <%= hidden_field_tag :connection_id, connection.id %>
9
- <%= ui_button(label: "Disconnect", variant: :danger) %>
10
- <% end %>
11
- <% end %>
12
- <% end %>
13
- </li>
1
+ <% connections = HubKernel::Mcp::Connection.of(person).includes(:client).order(:created_at).map do |connection|
2
+ { id: connection.id, app: connection.client.name, connected: l(connection.created_at, format: :long), last_used: connection.last_used_at ? l(connection.last_used_at, format: :long) : "Never" }
3
+ end %>
4
+ <%= ui_section(title: "Connected apps") do %>
5
+ <%= ui_data_table(items: connections, columns: [ { app: "App" }, { connected: "Connected" }, { last_used: "Last used" } ], empty_message: "No apps are connected.") do |table| %>
6
+ <% table.actions do |connection| %>
7
+ <%= ui_action_menu_item(label: "Disconnect", href: "#{submit_url}?#{{ connection_id: connection[:id] }.to_query}", method: :patch) %>
8
+ <% end %>
14
9
  <% end %>
15
- </ul>
10
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  module HubKernel
2
2
  module Mcp
3
- VERSION = "0.9.0"
3
+ VERSION = "0.10.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hub_kernel-mcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider
@@ -29,14 +29,14 @@ dependencies:
29
29
  requirements:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: '0.6'
32
+ version: '0.9'
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.6'
39
+ version: '0.9'
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: keystone_ui
42
42
  requirement: !ruby/object:Gem::Requirement