bullet_train-api 1.2.27 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45134d698bbcd0ba4d11ee47fc1b6f47d9c73230dfefebd6256900c478c6ca48
4
- data.tar.gz: 5fa310cfd48d7ec513da2c75e8c459873182e778d8ec2c8d275d7bcff08147f4
3
+ metadata.gz: ff783d524b793e584b3889ab0582b296c9440f658f1f2f07020c9b19ed75c8a7
4
+ data.tar.gz: 5875c34a336aa87e5a2a6aad6cbc938667fee235105ba8fccdf98809f498460e
5
5
  SHA512:
6
- metadata.gz: 4736cf493e57c8364997d468ad194e9acb950df4d9b156c79e2064a9d15a9fc1a2ee4de01ba269227abcc8766743edaab018912a02875339999e1a0f7cf0a4c4
7
- data.tar.gz: c7cd01b6fdb8c54d4009ff7b53106db505fe60c9fa8ef2f6ecd53dc52c55c14a59e7ec5aaf16dfeb1019c0b4ade3d98612e74d69bb4e9cae5f6fa7be86adf604
6
+ metadata.gz: 54e1eaf5f5ffad5e0b3f684d886b6fa01f52a228e630a4f27be0e63b9ac60194766a6cf1edcad7d6b5115ff8d6abae37c07a597ce1fd078cecb4f20796e415b1
7
+ data.tar.gz: 885cd2ab86c63f15a4c283eda6949efdbd1ca5592267092ed5ac4847c4e2512f179e764d30636f61ae2f178b73d7fdb8a6f91c0373335b80618dd7b99acb0dc5
@@ -72,7 +72,6 @@ module Api::Controllers::Base
72
72
  end
73
73
 
74
74
  # TODO Remove this rescue once workspace clusters can write to this column on the identity server.
75
- # TODO Make this logic configurable so that downstream developers can write different methods for this column getting updated.
76
75
  if doorkeeper_token
77
76
  begin
78
77
  doorkeeper_token.update(last_used_at: Time.zone.now)
@@ -14,7 +14,10 @@ module Api::V1::Users::ControllerBase
14
14
  :first_name,
15
15
  :last_name,
16
16
  :time_zone,
17
- :locale
17
+ :locale,
18
+ :profile_photo_id, # For Cloudinary
19
+ :profile_photo, # For ActiveStorage
20
+ :profile_photo_removal
18
21
  ]
19
22
 
20
23
  selected_fields = if params.is_a?(BulletTrain::Api::StrongParametersReporter)
@@ -38,7 +38,7 @@ module Api
38
38
  output += render(custom_actions_file_path) if lookup_context.exists?(custom_actions_file_path, [], true)
39
39
 
40
40
  # There are some placeholders specific to this method that we still need to transform.
41
- model_symbol = model.name.underscore.tr("/", "_")
41
+ model_symbol = model.name.underscore.tr("/", "_").to_sym
42
42
 
43
43
  if (get_example = FactoryBot.get_example(model_symbol, version: @version))
44
44
  output.gsub!("🚅 get_example", get_example)
@@ -1,4 +1,4 @@
1
- class Platform::AccessToken < ApplicationRecord
1
+ class Platform::AccessToken < BulletTrain::Api.base_class.constantize
2
2
  self.table_name = "oauth_access_tokens"
3
3
 
4
4
  include Doorkeeper::Orm::ActiveRecord::Mixins::AccessToken
@@ -1,4 +1,4 @@
1
- class Platform::Application < ApplicationRecord
1
+ class Platform::Application < BulletTrain::Api.base_class.constantize
2
2
  self.table_name = "oauth_applications"
3
3
 
4
4
  include Doorkeeper::Orm::ActiveRecord::Mixins::Application
@@ -8,7 +8,7 @@
8
8
  <% pagy, access_tokens = pagy(access_tokens, page_param: :access_tokens_page) %>
9
9
 
10
10
  <%= action_model_select_controller do %>
11
- <%= updates_for context, collection do %>
11
+ <%= cable_ready_updates_for context, collection do %>
12
12
  <%= render 'account/shared/box', pagy: pagy do |box| %>
13
13
  <% box.title t(".contexts.#{context.class.name.underscore}.header") %>
14
14
  <% box.description t(".contexts.#{context.class.name.underscore}.description") %>
@@ -1,7 +1,7 @@
1
1
  <%= render 'account/shared/page' do |page| %>
2
2
  <% page.title t('.section') %>
3
3
  <% page.body.render 'account/shared/box', divider: true do |box| %>
4
- <% box.t :description, title: t('.header') %>
4
+ <% box.t :description, title: '.header' %>
5
5
  <% box.body.render 'form', access_token: @access_token %>
6
6
  <% end %>
7
7
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <%= render 'account/shared/page' do |page| %>
2
2
  <% page.title t('.section') %>
3
3
  <% page.body do %>
4
- <%= updates_for @access_token do %>
4
+ <%= cable_ready_updates_for @access_token do %>
5
5
  <%= render 'account/shared/box', divider: true do |box| %>
6
6
  <% box.title t('.header') %>
7
7
  <% box.description do %>
data/config/routes.rb CHANGED
@@ -17,9 +17,7 @@ Rails.application.routes.draw do
17
17
  end
18
18
  end
19
19
 
20
- if ENV["TESTING_PROVISION_KEY"].present?
21
- get "/testing/provision", to: "account/platform/applications#provision"
22
- end
20
+ get "/testing/provision", to: "account/platform/applications#provision"
23
21
 
24
22
  namespace :api do
25
23
  match "*version/openapi.yaml" => "open_api#index", :via => :get
@@ -48,11 +48,6 @@ module FactoryBot
48
48
  private
49
49
 
50
50
  def factory(model)
51
- # TODO Why do we sometimes get a real object here and sometimes just a model name as a symbol?
52
- unless model.is_a?(String)
53
- model = model.name.underscore.tr("/", "_").to_sym
54
- end
55
-
56
51
  factories = FactoryBot.factories.instance_variable_get(:@items).keys
57
52
  factories.include?("#{model}_example") ? "#{model}_example".to_sym : model
58
53
  end
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module Api
3
- VERSION = "1.2.27"
3
+ VERSION = "1.3.0"
4
4
  end
5
5
  end
@@ -16,6 +16,7 @@ require "jbuilder/schema"
16
16
 
17
17
  module BulletTrain
18
18
  module Api
19
+ mattr_accessor :base_class, default: "ApplicationRecord"
19
20
  mattr_accessor :endpoints, default: []
20
21
  mattr_accessor :current_version, default: "v1"
21
22
  mattr_accessor :initial_version, default: "v1"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.27
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-27 00:00:00.000000000 Z
11
+ date: 2023-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -210,12 +210,12 @@ files:
210
210
  - lib/bullet_train/platform/connection_workflow.rb
211
211
  - lib/tasks/bullet_train/api_tasks.rake
212
212
  - lib/tokens_controller.rb
213
- homepage: https://github.com/bullet-train-co/bullet_train-api
213
+ homepage: https://github.com/bullet-train-co/bullet_train-core/tree/main/bullet_train-api
214
214
  licenses:
215
215
  - MIT
216
216
  metadata:
217
- homepage_uri: https://github.com/bullet-train-co/bullet_train-api
218
- source_code_uri: https://github.com/bullet-train-co/bullet_train-api
217
+ homepage_uri: https://github.com/bullet-train-co/bullet_train-core/tree/main/bullet_train-api
218
+ source_code_uri: https://github.com/bullet-train-co/bullet_train-core/tree/main/bullet_train-api
219
219
  post_install_message:
220
220
  rdoc_options: []
221
221
  require_paths:
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
231
  - !ruby/object:Gem::Version
232
232
  version: '0'
233
233
  requirements: []
234
- rubygems_version: 3.4.10
234
+ rubygems_version: 3.3.7
235
235
  signing_key:
236
236
  specification_version: 4
237
237
  summary: Bullet Train API