typed_params 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +9 -0
  3. data/CONTRIBUTING.md +33 -0
  4. data/LICENSE +20 -0
  5. data/README.md +736 -0
  6. data/SECURITY.md +8 -0
  7. data/lib/typed_params/bouncer.rb +34 -0
  8. data/lib/typed_params/coercer.rb +21 -0
  9. data/lib/typed_params/configuration.rb +40 -0
  10. data/lib/typed_params/controller.rb +192 -0
  11. data/lib/typed_params/formatters/formatter.rb +20 -0
  12. data/lib/typed_params/formatters/jsonapi.rb +142 -0
  13. data/lib/typed_params/formatters/rails.rb +31 -0
  14. data/lib/typed_params/formatters.rb +20 -0
  15. data/lib/typed_params/handler.rb +24 -0
  16. data/lib/typed_params/handler_set.rb +19 -0
  17. data/lib/typed_params/mapper.rb +74 -0
  18. data/lib/typed_params/namespaced_set.rb +59 -0
  19. data/lib/typed_params/parameter.rb +100 -0
  20. data/lib/typed_params/parameterizer.rb +87 -0
  21. data/lib/typed_params/path.rb +57 -0
  22. data/lib/typed_params/pipeline.rb +13 -0
  23. data/lib/typed_params/processor.rb +27 -0
  24. data/lib/typed_params/schema.rb +290 -0
  25. data/lib/typed_params/schema_set.rb +7 -0
  26. data/lib/typed_params/transformer.rb +49 -0
  27. data/lib/typed_params/transforms/key_alias.rb +16 -0
  28. data/lib/typed_params/transforms/key_casing.rb +59 -0
  29. data/lib/typed_params/transforms/nilify_blanks.rb +16 -0
  30. data/lib/typed_params/transforms/noop.rb +11 -0
  31. data/lib/typed_params/transforms/transform.rb +11 -0
  32. data/lib/typed_params/types/array.rb +12 -0
  33. data/lib/typed_params/types/boolean.rb +33 -0
  34. data/lib/typed_params/types/date.rb +10 -0
  35. data/lib/typed_params/types/decimal.rb +10 -0
  36. data/lib/typed_params/types/float.rb +10 -0
  37. data/lib/typed_params/types/hash.rb +13 -0
  38. data/lib/typed_params/types/integer.rb +10 -0
  39. data/lib/typed_params/types/nil.rb +11 -0
  40. data/lib/typed_params/types/number.rb +10 -0
  41. data/lib/typed_params/types/string.rb +10 -0
  42. data/lib/typed_params/types/symbol.rb +10 -0
  43. data/lib/typed_params/types/time.rb +20 -0
  44. data/lib/typed_params/types/type.rb +78 -0
  45. data/lib/typed_params/types.rb +69 -0
  46. data/lib/typed_params/validations/exclusion.rb +17 -0
  47. data/lib/typed_params/validations/format.rb +19 -0
  48. data/lib/typed_params/validations/inclusion.rb +17 -0
  49. data/lib/typed_params/validations/length.rb +29 -0
  50. data/lib/typed_params/validations/validation.rb +18 -0
  51. data/lib/typed_params/validator.rb +75 -0
  52. data/lib/typed_params/version.rb +5 -0
  53. data/lib/typed_params.rb +89 -0
  54. metadata +124 -0
metadata ADDED
@@ -0,0 +1,124 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: typed_params
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Zeke Gabrielse
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-06-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '6.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '6.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec-rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Typed parameters is an alternative to strong parameters, offering an
42
+ intuitive DSL for defining structured and strongly-typed controller parameter schemas.
43
+ email:
44
+ - oss@keygen.sh
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - CHANGELOG.md
50
+ - CONTRIBUTING.md
51
+ - LICENSE
52
+ - README.md
53
+ - SECURITY.md
54
+ - lib/typed_params.rb
55
+ - lib/typed_params/bouncer.rb
56
+ - lib/typed_params/coercer.rb
57
+ - lib/typed_params/configuration.rb
58
+ - lib/typed_params/controller.rb
59
+ - lib/typed_params/formatters.rb
60
+ - lib/typed_params/formatters/formatter.rb
61
+ - lib/typed_params/formatters/jsonapi.rb
62
+ - lib/typed_params/formatters/rails.rb
63
+ - lib/typed_params/handler.rb
64
+ - lib/typed_params/handler_set.rb
65
+ - lib/typed_params/mapper.rb
66
+ - lib/typed_params/namespaced_set.rb
67
+ - lib/typed_params/parameter.rb
68
+ - lib/typed_params/parameterizer.rb
69
+ - lib/typed_params/path.rb
70
+ - lib/typed_params/pipeline.rb
71
+ - lib/typed_params/processor.rb
72
+ - lib/typed_params/schema.rb
73
+ - lib/typed_params/schema_set.rb
74
+ - lib/typed_params/transformer.rb
75
+ - lib/typed_params/transforms/key_alias.rb
76
+ - lib/typed_params/transforms/key_casing.rb
77
+ - lib/typed_params/transforms/nilify_blanks.rb
78
+ - lib/typed_params/transforms/noop.rb
79
+ - lib/typed_params/transforms/transform.rb
80
+ - lib/typed_params/types.rb
81
+ - lib/typed_params/types/array.rb
82
+ - lib/typed_params/types/boolean.rb
83
+ - lib/typed_params/types/date.rb
84
+ - lib/typed_params/types/decimal.rb
85
+ - lib/typed_params/types/float.rb
86
+ - lib/typed_params/types/hash.rb
87
+ - lib/typed_params/types/integer.rb
88
+ - lib/typed_params/types/nil.rb
89
+ - lib/typed_params/types/number.rb
90
+ - lib/typed_params/types/string.rb
91
+ - lib/typed_params/types/symbol.rb
92
+ - lib/typed_params/types/time.rb
93
+ - lib/typed_params/types/type.rb
94
+ - lib/typed_params/validations/exclusion.rb
95
+ - lib/typed_params/validations/format.rb
96
+ - lib/typed_params/validations/inclusion.rb
97
+ - lib/typed_params/validations/length.rb
98
+ - lib/typed_params/validations/validation.rb
99
+ - lib/typed_params/validator.rb
100
+ - lib/typed_params/version.rb
101
+ homepage: https://github.com/keygen-sh/typed_params
102
+ licenses:
103
+ - MIT
104
+ metadata: {}
105
+ post_install_message:
106
+ rdoc_options: []
107
+ require_paths:
108
+ - lib
109
+ required_ruby_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '3.1'
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ requirements: []
120
+ rubygems_version: 3.4.13
121
+ signing_key:
122
+ specification_version: 4
123
+ summary: Define structured and strongly-typed parameter schemas for your Rails controllers.
124
+ test_files: []