admin_core 0.0.1

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.
Files changed (173) hide show
  1. checksums.yaml +7 -0
  2. data/.gitattributes +2 -0
  3. data/.gitignore +53 -0
  4. data/.rspec +2 -0
  5. data/.rubocop.yml +27 -0
  6. data/CHANGELOG.md +15 -0
  7. data/Gemfile +3 -0
  8. data/README.md +48 -0
  9. data/Rakefile +31 -0
  10. data/admin_core.gemspec +32 -0
  11. data/client/.babelrc +19 -0
  12. data/client/.eslintignore +3 -0
  13. data/client/.eslintrc.yml +20 -0
  14. data/client/.flowconfig +7 -0
  15. data/client/.gitignore +64 -0
  16. data/client/README.md +3 -0
  17. data/client/admin-core.scss +8 -0
  18. data/client/flow-typed/npm/axios_v0.16.x.js +120 -0
  19. data/client/flow-typed/npm/classnames_v2.x.x.js +16 -0
  20. data/client/flow-typed/npm/lodash_v4.x.x.js +514 -0
  21. data/client/flow-typed/npm/react-router-dom_v4.x.x.js +166 -0
  22. data/client/flow-typed/npm/reactstrap_vx.x.x.js +536 -0
  23. data/client/package.json +60 -0
  24. data/client/src/.eslintrc.yml +23 -0
  25. data/client/src/AdminCore.jsx +44 -0
  26. data/client/src/components/Breadcrumb.jsx +18 -0
  27. data/client/src/components/Header.jsx +45 -0
  28. data/client/src/components/Pagination.jsx +72 -0
  29. data/client/src/components/ResourceFilters.jsx +87 -0
  30. data/client/src/components/ResourceForm.jsx +103 -0
  31. data/client/src/components/ResourcesCollection.jsx +41 -0
  32. data/client/src/components/Sidebar.jsx +90 -0
  33. data/client/src/decls.js +119 -0
  34. data/client/src/http-client.js +18 -0
  35. data/client/src/main.js +9 -0
  36. data/client/src/resource-field/BelongsTo.jsx +26 -0
  37. data/client/src/resource-field/Boolean.jsx +43 -0
  38. data/client/src/resource-field/Date.jsx +29 -0
  39. data/client/src/resource-field/DateTime.jsx +29 -0
  40. data/client/src/resource-field/Enum.jsx +34 -0
  41. data/client/src/resource-field/Number.jsx +28 -0
  42. data/client/src/resource-field/String.jsx +28 -0
  43. data/client/src/resource-field/Text.jsx +27 -0
  44. data/client/src/resource-field-renderer.js +45 -0
  45. data/client/src/resource-filter/Boolean.jsx +22 -0
  46. data/client/src/resource-filter/Number.jsx +45 -0
  47. data/client/src/resource-filter/String.jsx +46 -0
  48. data/client/src/resource-filter-renderer.js +17 -0
  49. data/client/src/resource-page/Base.js +36 -0
  50. data/client/src/resource-page/Edit.jsx +48 -0
  51. data/client/src/resource-page/Index.jsx +141 -0
  52. data/client/src/resource-page/New.jsx +48 -0
  53. data/client/src/resource-page/Show.jsx +116 -0
  54. data/client/webpack.config.js +26 -0
  55. data/client/yarn.lock +3816 -0
  56. data/lib/admin_core/base_controller.rb +114 -0
  57. data/lib/admin_core/base_resource_manager.rb +24 -0
  58. data/lib/admin_core/configuration.rb +20 -0
  59. data/lib/admin_core/engine.rb +6 -0
  60. data/lib/admin_core/errors.rb +17 -0
  61. data/lib/admin_core/resource_field/base.rb +69 -0
  62. data/lib/admin_core/resource_field/belongs_to.rb +38 -0
  63. data/lib/admin_core/resource_field/boolean.rb +18 -0
  64. data/lib/admin_core/resource_field/date.rb +18 -0
  65. data/lib/admin_core/resource_field/date_time.rb +18 -0
  66. data/lib/admin_core/resource_field/enum.rb +26 -0
  67. data/lib/admin_core/resource_field/number.rb +18 -0
  68. data/lib/admin_core/resource_field/string.rb +18 -0
  69. data/lib/admin_core/resource_field/text.rb +23 -0
  70. data/lib/admin_core/resource_field_builder.rb +48 -0
  71. data/lib/admin_core/resource_filter/base.rb +63 -0
  72. data/lib/admin_core/resource_filter/boolean.rb +17 -0
  73. data/lib/admin_core/resource_filter/number.rb +25 -0
  74. data/lib/admin_core/resource_filter/string.rb +27 -0
  75. data/lib/admin_core/resource_filter_builder.rb +37 -0
  76. data/lib/admin_core/resource_manager/buildable.rb +42 -0
  77. data/lib/admin_core/resource_manager/convert.rb +95 -0
  78. data/lib/admin_core/resource_manager/has_many_fields.rb +71 -0
  79. data/lib/admin_core/resource_manager/permission.rb +35 -0
  80. data/lib/admin_core/resource_manager/searchable.rb +57 -0
  81. data/lib/admin_core/resource_page/base.rb +17 -0
  82. data/lib/admin_core/resource_page/edit.rb +22 -0
  83. data/lib/admin_core/resource_page/index.rb +52 -0
  84. data/lib/admin_core/resource_page/new.rb +26 -0
  85. data/lib/admin_core/resource_page/show.rb +22 -0
  86. data/lib/admin_core/resource_router.rb +58 -0
  87. data/lib/admin_core/resource_search.rb +22 -0
  88. data/lib/admin_core/rspec/matchers.rb +18 -0
  89. data/lib/admin_core/rspec/resource_field_spec_helper.rb +54 -0
  90. data/lib/admin_core/version.rb +11 -0
  91. data/lib/admin_core/view_object/sidebar_dropdown.rb +21 -0
  92. data/lib/admin_core/view_object/sidebar_link.rb +24 -0
  93. data/lib/admin_core/view_object/sidebar_resource_link.rb +23 -0
  94. data/lib/admin_core/view_object/sidebar_title.rb +18 -0
  95. data/lib/admin_core.rb +69 -0
  96. data/lib/generators/admin_core/install_generator.rb +39 -0
  97. data/lib/generators/admin_core/resource_manager_generator.rb +166 -0
  98. data/lib/generators/admin_core/templates/admin-core.css +1 -0
  99. data/lib/generators/admin_core/templates/admin-core.js +38196 -0
  100. data/lib/generators/admin_core/templates/controller.rb.erb +4 -0
  101. data/lib/generators/admin_core/templates/initializer.rb.erb +3 -0
  102. data/lib/generators/admin_core/templates/resource_manager.rb.erb +33 -0
  103. data/lib/generators/admin_core/templates/view.html.erb +58 -0
  104. data/sample/.gitignore +21 -0
  105. data/sample/Gemfile +35 -0
  106. data/sample/Gemfile.lock +147 -0
  107. data/sample/README.md +24 -0
  108. data/sample/Rakefile +6 -0
  109. data/sample/app/assets/config/manifest.js +2 -0
  110. data/sample/app/assets/images/.keep +0 -0
  111. data/sample/app/assets/stylesheets/application.css +15 -0
  112. data/sample/app/controllers/admin/application_controller.rb +4 -0
  113. data/sample/app/controllers/admin/tweets_controller.rb +4 -0
  114. data/sample/app/controllers/admin/users_controller.rb +4 -0
  115. data/sample/app/controllers/application_controller.rb +3 -0
  116. data/sample/app/controllers/concerns/.keep +0 -0
  117. data/sample/app/helpers/application_helper.rb +2 -0
  118. data/sample/app/jobs/application_job.rb +2 -0
  119. data/sample/app/models/admin/tweet.rb +35 -0
  120. data/sample/app/models/admin/user.rb +41 -0
  121. data/sample/app/models/application_record.rb +3 -0
  122. data/sample/app/models/concerns/.keep +0 -0
  123. data/sample/app/models/tweet.rb +3 -0
  124. data/sample/app/models/user.rb +3 -0
  125. data/sample/app/views/admin/application.html.erb +64 -0
  126. data/sample/app/views/layouts/application.html.erb +13 -0
  127. data/sample/bin/bundle +3 -0
  128. data/sample/bin/rails +4 -0
  129. data/sample/bin/rake +4 -0
  130. data/sample/bin/setup +34 -0
  131. data/sample/bin/update +29 -0
  132. data/sample/config/application.rb +25 -0
  133. data/sample/config/boot.rb +3 -0
  134. data/sample/config/database.yml +25 -0
  135. data/sample/config/environment.rb +5 -0
  136. data/sample/config/environments/development.rb +42 -0
  137. data/sample/config/environments/production.rb +69 -0
  138. data/sample/config/environments/test.rb +36 -0
  139. data/sample/config/initializers/admin_core.rb +8 -0
  140. data/sample/config/initializers/application_controller_renderer.rb +6 -0
  141. data/sample/config/initializers/backtrace_silencers.rb +7 -0
  142. data/sample/config/initializers/cookies_serializer.rb +5 -0
  143. data/sample/config/initializers/filter_parameter_logging.rb +4 -0
  144. data/sample/config/initializers/inflections.rb +16 -0
  145. data/sample/config/initializers/mime_types.rb +4 -0
  146. data/sample/config/initializers/new_framework_defaults.rb +24 -0
  147. data/sample/config/initializers/session_store.rb +3 -0
  148. data/sample/config/initializers/wrap_parameters.rb +14 -0
  149. data/sample/config/locales/en.yml +23 -0
  150. data/sample/config/routes.rb +6 -0
  151. data/sample/config/secrets.yml +22 -0
  152. data/sample/config.ru +5 -0
  153. data/sample/db/migrate/20170417055257_create_users.rb +10 -0
  154. data/sample/db/migrate/20170417055412_create_tweets.rb +9 -0
  155. data/sample/db/schema.rb +31 -0
  156. data/sample/db/seeds.rb +7 -0
  157. data/sample/lib/assets/.keep +0 -0
  158. data/sample/lib/tasks/.keep +0 -0
  159. data/sample/log/.keep +0 -0
  160. data/sample/public/404.html +67 -0
  161. data/sample/public/422.html +67 -0
  162. data/sample/public/500.html +66 -0
  163. data/sample/public/apple-touch-icon-precomposed.png +0 -0
  164. data/sample/public/apple-touch-icon.png +0 -0
  165. data/sample/public/bundle.min.js +27 -0
  166. data/sample/public/bundle.min.js.map +1 -0
  167. data/sample/public/favicon.ico +0 -0
  168. data/sample/public/javascripts/admin-core.js +38196 -0
  169. data/sample/public/robots.txt +5 -0
  170. data/sample/public/stylesheets/admin-core.css +1 -0
  171. data/sample/tmp/.keep +0 -0
  172. data/sample/vendor/assets/stylesheets/.keep +0 -0
  173. metadata +368 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cf2f4b9fcd604f92ec5a88fa91e25d3e75a6e523
4
+ data.tar.gz: 10804c7d05083d94bb510f80d885eac2e444cef6
5
+ SHA512:
6
+ metadata.gz: e3acff17862875be56459648b362617c2d1bceb2043f9fdf338b0f9ff9e332d4e5baefb6557e40d126f926a4aabb7878fe9ec5c5119c228313383083f1ed6c1a
7
+ data.tar.gz: aa8bb12760bb8d1fa0d5499f25ef236c092b2c197176b2afbb88c2d493cda071d6630fce701cd64500ef2bee037ad71e0d70c13030b2a785282b278211e8c180
data/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ flow-typed/* linguist-documentation
2
+ sample/* linguist-documentation
data/.gitignore ADDED
@@ -0,0 +1,53 @@
1
+ # Created by https://www.gitignore.io/api/ruby
2
+
3
+ ### Ruby ###
4
+ *.gem
5
+ /.config
6
+ /InstalledFiles
7
+ /pkg/
8
+ /spec/reports/
9
+ /spec/examples.txt
10
+ /test/tmp/
11
+ /test/version_tmp/
12
+ /tmp/
13
+
14
+ # Used by dotenv library to load environment variables.
15
+ # .env
16
+
17
+ ## Specific to RubyMotion:
18
+ .dat*
19
+ .repl_history
20
+ build/
21
+ *.bridgesupport
22
+ build-iPhoneOS/
23
+ build-iPhoneSimulator/
24
+
25
+ ## Specific to RubyMotion (use of CocoaPods):
26
+ #
27
+ # We recommend against adding the Pods directory to your .gitignore. However
28
+ # you should judge for yourself, the pros and cons are mentioned at:
29
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
30
+ #
31
+ # vendor/Pods/
32
+
33
+ ## Documentation cache and generated files:
34
+ /.yardoc/
35
+ /_yardoc/
36
+ /doc/
37
+ /rdoc/
38
+
39
+ ## Environment normalization:
40
+ /.bundle/
41
+ /lib/bundler/man/
42
+
43
+ # for a library or gem, you might want to ignore these files since the code is
44
+ # intended to run in multiple environments; otherwise, check them in:
45
+ /Gemfile.lock
46
+ .ruby-version
47
+ .ruby-gemset
48
+
49
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
+
51
+ /coverage
52
+
53
+ # End of https://www.gitignore.io/api/ruby
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,27 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.4
3
+ Exclude:
4
+ - client/**/*
5
+ - node_modules/**/*
6
+ - sample/**/*
7
+
8
+ Metrics/BlockLength:
9
+ Exclude:
10
+ - lib/admin_core/rspec/**/*
11
+ - spec/**/*
12
+
13
+ Metrics/LineLength:
14
+ Max: 125
15
+
16
+ Style/ClassAndModuleChildren:
17
+ Exclude:
18
+ - spec/**/*
19
+
20
+ Style/Documentation:
21
+ Enabled: false
22
+
23
+ Style/FrozenStringLiteralComment:
24
+ Enabled: false
25
+
26
+ Style/TrailingCommaInLiteral:
27
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.0.1]
10
+ ### Added
11
+ - Initial release
12
+ - Sample app with User and Tweet models
13
+
14
+ [Unreleased]: https://github.com/increments/circleci-coverage_reporter/compare/v0.0.1...HEAD
15
+ [0.0.1]: https://github.com/increments/circleci-coverage_reporter/compare/a3205a7...v0.0.1
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # AdminCore
2
+
3
+ A flexible admin framework for Rails
4
+
5
+ :warning: AdminCore is not production ready.
6
+
7
+ ## Getting Started
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```rb
12
+ gem 'admin_core'
13
+ ```
14
+
15
+ Re-bundle, then run the installer:
16
+
17
+ ```bash
18
+ $ rails g admin_core:install
19
+ ```
20
+
21
+ This generates:
22
+
23
+ - app/controllers/admin/application_controller.rb
24
+ - app/views/admin/application.html.erb
25
+ - config/initializers/admin_core.rb
26
+
27
+ There is another generator to generate resource manager class:
28
+
29
+ ```bash
30
+ $ rails g admin_core:resource_manager user
31
+ ```
32
+
33
+ This generates:
34
+
35
+ - app/models/admin/user.rb
36
+
37
+ Add route to AdminCore:
38
+
39
+ ```rb
40
+ # config/routes.rb
41
+ Rails.application.routes.draw do
42
+ namespace :admin do
43
+ resources :users
44
+ end
45
+ end
46
+ ```
47
+
48
+ Restart server and access http://localhost:3000/admin/users
data/Rakefile ADDED
@@ -0,0 +1,31 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+ require 'rubocop/rake_task'
4
+ require 'yard'
5
+
6
+ RSpec::Core::RakeTask.new do |task|
7
+ task.verbose = false
8
+ end
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ YARD::Rake::YardocTask.new
13
+
14
+ task default: %i[spec rubocop]
15
+
16
+ task ci: %i[spec rubocop]
17
+
18
+ namespace :client do
19
+ desc 'Update assets of generator templates'
20
+ task bundle: :build do
21
+ %w[admin-core.js admin-core.css].each do |name|
22
+ cp "client/dist/#{name}", 'lib/generators/admin_core/templates/'
23
+ end
24
+ end
25
+
26
+ task :build do
27
+ Dir.chdir 'client' do
28
+ sh 'yarn run build'
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,32 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'admin_core/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'admin_core'
7
+ spec.version = AdminCore::Version.to_s
8
+ spec.authors = ['Yuku Takahashi']
9
+ spec.email = ['yuku@qiita.com']
10
+
11
+ spec.summary = 'Flexible admin framework for Rails'
12
+ spec.description = spec.summary
13
+ spec.homepage = 'https://github.com/increments/admin_core'
14
+
15
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
16
+ spec.bindir = 'exe'
17
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_dependency 'rails', '>= 3.2'
21
+ spec.add_dependency 'kaminari', '~> 1.0'
22
+
23
+ spec.add_development_dependency 'bundler', '~> 1.12'
24
+ spec.add_development_dependency 'database_cleaner', '~> 1.5'
25
+ spec.add_development_dependency 'factory_girl', '~> 4.8'
26
+ spec.add_development_dependency 'rake', '~> 12.0'
27
+ spec.add_development_dependency 'rspec', '~> 3.5'
28
+ spec.add_development_dependency 'rubocop', '~> 0.48'
29
+ spec.add_development_dependency 'simplecov', '~> 0.14'
30
+ spec.add_development_dependency 'sqlite3', '~> 1.3'
31
+ spec.add_development_dependency 'yard', '~> 0.9'
32
+ end
data/client/.babelrc ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "plugins": [
3
+ "transform-flow-strip-types"
4
+ ],
5
+ "presets": [
6
+ "react",
7
+ [
8
+ "env",
9
+ {
10
+ "targets": {
11
+ "browsers": [
12
+ "last 2 versions",
13
+ "IE >= 11"
14
+ ]
15
+ }
16
+ }
17
+ ]
18
+ ]
19
+ }
@@ -0,0 +1,3 @@
1
+ /dist/**/*.js
2
+ /flow-typed/**/*.js
3
+ /lib/**/*.js
@@ -0,0 +1,20 @@
1
+ ---
2
+ root: true
3
+
4
+ env:
5
+ commonjs: true
6
+ es6: true
7
+
8
+ extends: eslint:recommended
9
+
10
+ ecmaFeatures:
11
+ module: true
12
+ modules: true
13
+
14
+ parser: babel-eslint
15
+
16
+ parserOptions:
17
+ sourceType: module
18
+
19
+ rules:
20
+ no-unused-vars: [error, { vars: local, args: after-used, argsIgnorePattern: ^_ }]
@@ -0,0 +1,7 @@
1
+ [ignore]
2
+
3
+ [include]
4
+
5
+ [libs]
6
+
7
+ [options]
data/client/.gitignore ADDED
@@ -0,0 +1,64 @@
1
+ # Created by https://www.gitignore.io/api/node
2
+
3
+ ### Node ###
4
+ # Logs
5
+ logs
6
+ *.log
7
+ npm-debug.log*
8
+ yarn-debug.log*
9
+ yarn-error.log*
10
+
11
+ # Runtime data
12
+ pids
13
+ *.pid
14
+ *.seed
15
+ *.pid.lock
16
+
17
+ # Directory for instrumented libs generated by jscoverage/JSCover
18
+ lib-cov
19
+
20
+ # Coverage directory used by tools like istanbul
21
+ coverage
22
+
23
+ # nyc test coverage
24
+ .nyc_output
25
+
26
+ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
27
+ .grunt
28
+
29
+ # Bower dependency directory (https://bower.io/)
30
+ bower_components
31
+
32
+ # node-waf configuration
33
+ .lock-wscript
34
+
35
+ # Compiled binary addons (http://nodejs.org/api/addons.html)
36
+ build/Release
37
+
38
+ # Dependency directories
39
+ node_modules/
40
+ jspm_packages/
41
+
42
+ # Typescript v1 declaration files
43
+ typings/
44
+
45
+ # Optional npm cache directory
46
+ .npm
47
+
48
+ # Optional eslint cache
49
+ .eslintcache
50
+
51
+ # Optional REPL history
52
+ .node_repl_history
53
+
54
+ # Output of 'npm pack'
55
+ *.tgz
56
+
57
+ # Yarn Integrity file
58
+ .yarn-integrity
59
+
60
+ # dotenv environment variables file
61
+ .env
62
+
63
+ /dist
64
+ /lib
data/client/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # AdminCore
2
+
3
+ Client library of [increments/admin_core](https://github.com/increments/admin_core).
@@ -0,0 +1,8 @@
1
+ @charset 'utf-8';
2
+ @import './node_modules/coreui.io/React_Starter/scss/style';
3
+
4
+ .app-header.navbar .navbar-brand {
5
+ background-image: none;
6
+ line-height: 2em;
7
+ text-align: center;
8
+ }
@@ -0,0 +1,120 @@
1
+ // flow-typed signature: b371e1002f7439f9f053dc08186c5375
2
+ // flow-typed version: dbaff82b4f/axios_v0.16.x/flow_>=v0.28.x
3
+
4
+ declare module 'axios' {
5
+ declare interface ProxyConfig {
6
+ host: string;
7
+ port: number;
8
+ }
9
+ declare interface Cancel {
10
+ constructor(message?: string): Cancel;
11
+ message: string;
12
+ }
13
+ declare interface Canceler {
14
+ (message?: string): void;
15
+ }
16
+ declare interface CancelTokenSource {
17
+ token: CancelToken;
18
+ cancel: Canceler;
19
+ }
20
+ declare interface CancelToken {
21
+ constructor(executor: (cancel: Canceler) => void): CancelToken;
22
+ static source(): CancelTokenSource;
23
+ promise: Promise<Cancel>;
24
+ reason?: Cancel;
25
+ throwIfRequested(): void;
26
+ }
27
+ declare interface AxiosXHRConfigBase<T> {
28
+ adapter?: <T>(config: AxiosXHRConfig<T>) => Promise<AxiosXHR<T>>;
29
+ auth?: {
30
+ username: string,
31
+ password: string
32
+ };
33
+ baseURL?: string,
34
+ cancelToken?: CancelToken;
35
+ headers?: Object;
36
+ httpAgent?: mixed; // Missing the type in the core flow node libdef
37
+ httpsAgent?: mixed; // Missing the type in the core flow node libdef
38
+ maxContentLength?: number;
39
+ maxRedirects?: 5,
40
+ params?: Object;
41
+ paramsSerializer?: (params: Object) => string;
42
+ progress?: (progressEvent: Event) => void | mixed;
43
+ proxy?: ProxyConfig;
44
+ responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
45
+ timeout?: number;
46
+ transformRequest?: Array<<U>(data: T) => U|Array<<U>(data: T) => U>>;
47
+ transformResponse?: Array<<U>(data: T) => U>;
48
+ validateStatus?: (status: number) => boolean,
49
+ withCredentials?: boolean;
50
+ xsrfCookieName?: string;
51
+ xsrfHeaderName?: string;
52
+ }
53
+ declare type $AxiosXHRConfigBase<T> = AxiosXHRConfigBase<T>;
54
+ declare interface AxiosXHRConfig<T> extends AxiosXHRConfigBase<T> {
55
+ data?: T;
56
+ method?: string;
57
+ url: string;
58
+ }
59
+ declare type $AxiosXHRConfig<T> = AxiosXHRConfig<T>;
60
+ declare class AxiosXHR<T> {
61
+ config: AxiosXHRConfig<T>;
62
+ data: T;
63
+ headers: Object;
64
+ status: number;
65
+ statusText: string,
66
+ request: http$ClientRequest | XMLHttpRequest
67
+ }
68
+ declare type $AxiosXHR<T> = $AxiosXHR<T>;
69
+ declare class AxiosInterceptorIdent extends String {}
70
+ declare class AxiosRequestInterceptor<T> {
71
+ use(
72
+ successHandler: ?(response: AxiosXHRConfig<T>) => Promise<AxiosXHRConfig<*>> | AxiosXHRConfig<*>,
73
+ errorHandler: ?(error: mixed) => mixed,
74
+ ): AxiosInterceptorIdent;
75
+ eject(ident: AxiosInterceptorIdent): void;
76
+ }
77
+ declare class AxiosResponseInterceptor<T> {
78
+ use(
79
+ successHandler: ?(response: AxiosXHR<T>) => mixed,
80
+ errorHandler: ?(error: mixed) => mixed,
81
+ ): AxiosInterceptorIdent;
82
+ eject(ident: AxiosInterceptorIdent): void;
83
+ }
84
+ declare type AxiosPromise<T> = Promise<AxiosXHR<T>>;
85
+ declare class Axios {
86
+ constructor<T>(config?: AxiosXHRConfigBase<T>): void;
87
+ $call: <T>(config: AxiosXHRConfig<T> | string, config?: AxiosXHRConfig<T>) => AxiosPromise<T>;
88
+ request<T>(config: AxiosXHRConfig<T>): AxiosPromise<T>;
89
+ delete<T>(url: string, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
90
+ get<T>(url: string, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
91
+ head<T>(url: string, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
92
+ post<T>(url: string, data?: mixed, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
93
+ put<T>(url: string, data?: mixed, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
94
+ patch<T>(url: string, data?: mixed, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
95
+ interceptors: {
96
+ request: AxiosRequestInterceptor<mixed>,
97
+ response: AxiosResponseInterceptor<mixed>,
98
+ };
99
+ defaults: AxiosXHRConfig<*> & { headers: Object };
100
+ }
101
+
102
+ declare class AxiosError<T> extends Error {
103
+ config: AxiosXHRConfig<T>;
104
+ response: AxiosXHR<T>;
105
+ code?: string;
106
+ }
107
+
108
+ declare type $AxiosError<T> = AxiosError<T>;
109
+
110
+ declare interface AxiosExport extends Axios {
111
+ Axios: typeof Axios;
112
+ Cancel: Class<Cancel>;
113
+ CancelToken: Class<CancelToken>;
114
+ isCancel(value: any): boolean;
115
+ create(config?: AxiosXHRConfigBase<any>): Axios;
116
+ all: typeof Promise.all;
117
+ spread(callback: Function): (arr: Array<any>) => Function
118
+ }
119
+ declare module.exports: AxiosExport;
120
+ }
@@ -0,0 +1,16 @@
1
+ // flow-typed signature: f18a1d7eaf96fce01718f217f06c838e
2
+ // flow-typed version: 3c3f096590/classnames_v2.x.x/flow_>=v0.23.x
3
+
4
+ type $npm$classnames$Classes =
5
+ string |
6
+ {[className: string]: * } |
7
+ Array<string> |
8
+ false |
9
+ void |
10
+ null
11
+
12
+ declare module 'classnames' {
13
+ declare function exports(
14
+ ...classes: Array<$npm$classnames$Classes>
15
+ ): string;
16
+ }