model_driven_api 3.5.8 → 3.5.10

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: f9f41789e4969e40d7ea928d17463c69b067109d104f4c5c14d2d8885670c08d
4
- data.tar.gz: df3716c785822a97d1a17374d64193eb40408735bfc93982f1d12f9ec044a2fe
3
+ metadata.gz: 480b526a7ad2eb29d72fde29103828c4d40828f8191159ead5c5e6c963576b44
4
+ data.tar.gz: e0d6cb01b2712a55ebb45dc0489731e13811ff3330e02dce98b208bc2617db4c
5
5
  SHA512:
6
- metadata.gz: 0d6a4d31ecdb991590f78fdafca0b955f833e01abce3796cc69b70626d65201023fe2582b610941aab91834a621849f37fead2241cec4b497a3c758fb3f5b376
7
- data.tar.gz: de120a2d0bfbe673d69695a44e2105fe8f16c13b422cefefa6f97ad93a8e40e04fa376e06242fd6b6005b796d0e3e00580fb3b77da2fe7d44d34eeb576a9ac82
6
+ metadata.gz: f55b360c3768fbb9ec7e43cff3626ddea0f299e32e3c97f92270dba1d535eb2994b9eabbff4fb8fc20f92b74f88a32ab103bfd56b59f50bc878aaa7243303acb
7
+ data.tar.gz: 5c92387cb385739839db471b2e95cc5ffde332bb33ea903fc608f16f3294383db370f49ca4e4dd93d1d4b8c35db875cacf1671df6e4695b823ac3afca97040fd
@@ -1305,15 +1305,11 @@ const handleUpdate = async () => {
1305
1305
 
1306
1306
  ```
1307
1307
 
1308
- Here is the addition to the documentation showing the raw HTTP requests.
1309
-
1310
- ---
1311
-
1312
- ## 4. Bare Metal HTTP Requests
1308
+ ### 4. Bare Metal HTTP Requests
1313
1309
 
1314
1310
  If you were to inspect the network traffic or manually construct the request (e.g., using raw sockets or a tool like Postman/Insomnia), this is exactly what the payload looks like "over the wire."
1315
1311
 
1316
- ### A. POST Request (Upload)
1312
+ #### A. POST Request (Upload)
1317
1313
 
1318
1314
  Notice how `multipart/form-data` uses a **boundary** string (randomly generated by the client) to separate different fields.
1319
1315
 
@@ -1340,7 +1336,7 @@ Content-Type: image/png
1340
1336
 
1341
1337
  ```
1342
1338
 
1343
- ### B. PATCH Request (Deletion via IDs)
1339
+ #### B. PATCH Request (Deletion via IDs)
1344
1340
 
1345
1341
  When sending the `remove_assets` array via `FormData`, the key is repeated for every ID. This is how HTTP handles arrays in form data.
1346
1342
 
data/config/routes.rb CHANGED
@@ -1,71 +1,73 @@
1
1
  # require 'ransack'
2
2
 
3
3
  Rails.application.routes.draw do
4
- scope ENV.fetch("RAILS_RELATIVE_URL_ROOT", "/") do
4
+ scope ENV.fetch("RAILS_RELATIVE_URL_ROOT", "/") do
5
+ if ThecoreAuthCommons.oauth_vars?
6
+ # OmniAuth callbacks need these top-level paths:
7
+ match "/auth/:provider/callback", to: redirect("/api/v2/auth/%{provider}/callback"), via: [:get, :post]
8
+ match "/auth/failure", to: redirect("/api/v2/auth/failure"), via: [:get, :post]
9
+ end
10
+ namespace :api, constraints: { format: :json } do
11
+ namespace :v2 do
12
+ # Authentication via Oauth2 only if the environment variable is set
5
13
  if ThecoreAuthCommons.oauth_vars?
6
- # OmniAuth callbacks need these top-level paths:
7
- match '/auth/:provider/callback', to: redirect('/api/v2/auth/%{provider}/callback'), via: [:get, :post]
8
- match '/auth/failure', to: redirect('/api/v2/auth/failure'), via: [:get, :post]
14
+ namespace :auth do
15
+ # Omniauth routes for OAuth2 authentication
16
+ match ":provider/callback", to: "oauth#callback", via: [:get, :post]
17
+ get :failure, to: "oauth#failure"
18
+ get ":provider", to: redirect("/auth/%{provider}") # triggers OmniAuth middleware
19
+ post :jwt, to: "oauth#exchange_token" # Optional endpoint to allow frontends to send the OAuth token
20
+ end
9
21
  end
10
- namespace :api, constraints: { format: :json } do
11
- namespace :v2 do
12
- # Authentication via Oauth2 only if the environment variable is set
13
- if ThecoreAuthCommons.oauth_vars?
14
- namespace :auth do
15
- # Omniauth routes for OAuth2 authentication
16
- match ':provider/callback', to: 'oauth#callback', via: [:get, :post]
17
- get :failure, to: 'oauth#failure'
18
- get ':provider', to: redirect('/auth/%{provider}') # triggers OmniAuth middleware
19
- post :jwt, to: 'oauth#exchange_token' # Optional endpoint to allow frontends to send the OAuth token
20
- end
21
- end
22
22
 
23
- resources :users
23
+ resources :users
24
24
 
25
- namespace :info do
26
- get :version
27
- get :roles
28
- get :translations
29
- get :schema
30
- get :dsl
31
- get :heartbeat
32
- get :settings
33
- get :swagger
34
- get :openapi
35
- end
25
+ namespace :info do
26
+ get :version
27
+ get :roles
28
+ get :translations
29
+ get :schema
30
+ get :dsl
31
+ get :heartbeat
32
+ get :settings
33
+ get :swagger
34
+ get :openapi
35
+ end
36
36
 
37
- namespace :raw do
38
- post :sql
39
- end
37
+ namespace :raw do
38
+ # both post and get for raw queries, the query is sent in the body as JSON with a "query" key
39
+ post "query", to: "raw#query"
40
+ get "query", to: "raw#query"
41
+ end
40
42
 
41
- post "authenticate" => "authentication#authenticate"
42
- post ":ctrl/search" => 'application#index'
43
+ post "authenticate" => "authentication#authenticate"
44
+ post ":ctrl/search" => "application#index"
43
45
 
44
- # Add a route with placeholders for custom actions, the custom actions routes have a form like: :ctrl/custom_action/:action_name or :ctrl/custom_action/:action_name/:id
45
- # Can have all the verbs, but the most common are: get, post, put, delete
46
- get ":ctrl/custom_action/:action_name", to: 'application#index'
47
- get ":ctrl/custom_action/:action_name/:id", to: 'application#show'
48
- post ":ctrl/custom_action/:action_name", to: 'application#create'
49
- put ":ctrl/custom_action/:action_name/:id", to: 'application#update'
50
- patch ":ctrl/custom_action/:action_name/:id", to: 'application#update'
51
- delete ":ctrl/custom_action/:action_name/:id", to: 'application#destroy'
52
- # Catchall routes
53
- # # CRUD Show
54
- get '*path/:id', to: 'application#show'
55
- # # CRUD Index
56
- get '*path', to: 'application#index'
57
- # # CRUD Create
58
- post '*path', to: 'application#create'
59
- # CRUD Update
60
- put '*path/:id/multi', to: 'application#update_multi'
61
- patch '*path/:id/multi', to: 'application#update_multi'
62
- put '*path/:id', to: 'application#update'
63
- patch '*path/:id', to: 'application#patch'
46
+ # Add a route with placeholders for custom actions, the custom actions routes have a form like: :ctrl/custom_action/:action_name or :ctrl/custom_action/:action_name/:id
47
+ # Can have all the verbs, but the most common are: get, post, put, delete
48
+ get ":ctrl/custom_action/:action_name", to: "application#index"
49
+ get ":ctrl/custom_action/:action_name/:id", to: "application#show"
50
+ post ":ctrl/custom_action/:action_name", to: "application#create"
51
+ put ":ctrl/custom_action/:action_name/:id", to: "application#update"
52
+ patch ":ctrl/custom_action/:action_name/:id", to: "application#update"
53
+ delete ":ctrl/custom_action/:action_name/:id", to: "application#destroy"
54
+ # Catchall routes
55
+ # # CRUD Show
56
+ get "*path/:id", to: "application#show"
57
+ # # CRUD Index
58
+ get "*path", to: "application#index"
59
+ # # CRUD Create
60
+ post "*path", to: "application#create"
61
+ # CRUD Update
62
+ put "*path/:id/multi", to: "application#update_multi"
63
+ patch "*path/:id/multi", to: "application#update_multi"
64
+ put "*path/:id", to: "application#update"
65
+ patch "*path/:id", to: "application#patch"
64
66
 
65
- # # CRUD Delete
66
- delete '*path/:id/multi', to: 'application#destroy_multi'
67
- delete '*path/:id', to: 'application#destroy'
68
- end
69
- end
67
+ # # CRUD Delete
68
+ delete "*path/:id/multi", to: "application#destroy_multi"
69
+ delete "*path/:id", to: "application#destroy"
70
+ end
70
71
  end
72
+ end
71
73
  end
@@ -1,3 +1,3 @@
1
1
  module ModelDrivenApi
2
- VERSION = "3.5.8".freeze
2
+ VERSION = "3.5.10".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_driven_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.8
4
+ version: 3.5.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni