Espone API JSON e MCP HTTP per far lavorare gli agenti sul CRM.
Gli agenti autenticati con token Bearer possono leggere today/pipeline e annotare attività, con host MCP allineati a quelli di produzione. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
class CreateApiTokens < ActiveRecord::Migration[8.1]
|
||||
def change
|
||||
create_table :api_tokens do |t|
|
||||
t.references :user, null: false, foreign_key: true
|
||||
t.string :name, null: false
|
||||
t.string :token_digest, null: false
|
||||
t.string :token_prefix, null: false
|
||||
t.datetime :last_used_at
|
||||
t.datetime :revoked_at
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :api_tokens, :token_digest, unique: true
|
||||
add_index :api_tokens, :revoked_at
|
||||
end
|
||||
end
|
||||
Generated
+16
-1
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.1].define(version: 2026_08_24_190000) do
|
||||
ActiveRecord::Schema[8.1].define(version: 2026_09_02_220000) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_catalog.plpgsql"
|
||||
|
||||
@@ -64,6 +64,20 @@ ActiveRecord::Schema[8.1].define(version: 2026_08_24_190000) do
|
||||
t.index ["user_id"], name: "index_activities_on_user_id"
|
||||
end
|
||||
|
||||
create_table "api_tokens", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "last_used_at"
|
||||
t.string "name", null: false
|
||||
t.datetime "revoked_at"
|
||||
t.string "token_digest", null: false
|
||||
t.string "token_prefix", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.bigint "user_id", null: false
|
||||
t.index ["revoked_at"], name: "index_api_tokens_on_revoked_at"
|
||||
t.index ["token_digest"], name: "index_api_tokens_on_token_digest", unique: true
|
||||
t.index ["user_id"], name: "index_api_tokens_on_user_id"
|
||||
end
|
||||
|
||||
create_table "contacts", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.bigint "created_by_id"
|
||||
@@ -384,6 +398,7 @@ ActiveRecord::Schema[8.1].define(version: 2026_08_24_190000) do
|
||||
add_foreign_key "activities", "opportunities"
|
||||
add_foreign_key "activities", "organizations"
|
||||
add_foreign_key "activities", "users"
|
||||
add_foreign_key "api_tokens", "users"
|
||||
add_foreign_key "contacts", "organizations"
|
||||
add_foreign_key "mail_templates", "projects"
|
||||
add_foreign_key "mailing_recipients", "contacts"
|
||||
|
||||
Reference in New Issue
Block a user