forest_admin_agent 1.12.9 → 1.12.11
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:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 8c483941707c8c57b9ae658ef3790d4b9292fe090d5fc15619970483b5c58f89
         | 
| 4 | 
            +
              data.tar.gz: 4f8c9bc23a9a86f8d7850bad610f72d8dc31d4b485365a3e8d292e32f176a226
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 24a0f155ef3afc2350c3a27ee03e9ee6c02538d8685bcbe6cf90d77aeef2b192a139bc84b374679c5d4cdea0d9268a485492c4f6735eb965eda5fae9b4b768bb
         | 
| 7 | 
            +
              data.tar.gz: b7ce5b4f9a40c6cbd79a48b60d8e1dda0bc9a21e907741837e4d2feca019eb115dfbea8f9b6f3d671bd839e819badb635a840766f969de8d1080d0cef12486b2
         | 
| @@ -86,7 +86,7 @@ module ForestAdminAgent | |
| 86 86 | 
             
                        collections: generated
         | 
| 87 87 | 
             
                      }
         | 
| 88 88 |  | 
| 89 | 
            -
                      File.write(schema_path,  | 
| 89 | 
            +
                      File.write(schema_path, format_schema_json(schema))
         | 
| 90 90 | 
             
                    end
         | 
| 91 91 |  | 
| 92 92 | 
             
                    if (append_schema_path = Facades::Container.cache(:append_schema_path))
         | 
| @@ -103,6 +103,20 @@ module ForestAdminAgent | |
| 103 103 |  | 
| 104 104 | 
             
                  private
         | 
| 105 105 |  | 
| 106 | 
            +
                  def format_schema_json(schema)
         | 
| 107 | 
            +
                    # Custom JSON formatting that keeps single-element arrays on one line
         | 
| 108 | 
            +
                    json = JSON.pretty_generate(schema)
         | 
| 109 | 
            +
             | 
| 110 | 
            +
                    # Replace multiline arrays containing only ONE string with single-line format
         | 
| 111 | 
            +
                    # This matches patterns like:
         | 
| 112 | 
            +
                    # type: [
         | 
| 113 | 
            +
                    #   "String"
         | 
| 114 | 
            +
                    # ]
         | 
| 115 | 
            +
                    # and replaces them with: type: ["String"]
         | 
| 116 | 
            +
                    # Multi-element arrays (like enums) remain on multiple lines for readability
         | 
| 117 | 
            +
                    json.gsub(/:\s*\[\n\s*("(?:[^"\\]|\\.)*")\n\s*\]/, ': [\1]')
         | 
| 118 | 
            +
                  end
         | 
| 119 | 
            +
             | 
| 106 120 | 
             
                  def post_schema(schema, force)
         | 
| 107 121 | 
             
                    api_map = SchemaEmitter.serialize(schema)
         | 
| 108 122 | 
             
                    should_send = do_server_want_schema(api_map[:meta][:schemaFileHash])
         | 
| @@ -77,7 +77,7 @@ module ForestAdminAgent | |
| 77 77 |  | 
| 78 78 | 
             
                    def validate_array_field!(field_schema, field_name)
         | 
| 79 79 | 
             
                      FieldValidator.validate(@collection, field_name)
         | 
| 80 | 
            -
                      return if field_schema.column_type. | 
| 80 | 
            +
                      return if field_schema.column_type.is_a?(Array)
         | 
| 81 81 |  | 
| 82 82 | 
             
                      raise Http::Exceptions::ValidationError,
         | 
| 83 83 | 
             
                            "Field '#{field_name}' is not an array (type: #{field_schema.column_type})"
         | 
| @@ -120,9 +120,9 @@ module ForestAdminAgent | |
| 120 120 | 
             
                    end
         | 
| 121 121 |  | 
| 122 122 | 
             
                    def coerce_value(value, column_type)
         | 
| 123 | 
            -
                      return value unless column_type. | 
| 123 | 
            +
                      return value unless column_type.is_a?(Array)
         | 
| 124 124 |  | 
| 125 | 
            -
                      element_type = column_type. | 
| 125 | 
            +
                      element_type = column_type.first
         | 
| 126 126 |  | 
| 127 127 | 
             
                      if element_type == 'Number' && value.is_a?(String)
         | 
| 128 128 | 
             
                        begin
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: forest_admin_agent
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.12. | 
| 4 | 
            +
              version: 1.12.11
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Matthieu
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire:
         | 
| 10 10 | 
             
            bindir: exe
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2025-10- | 
| 12 | 
            +
            date: 2025-10-29 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: activesupport
         |