Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] [Core] Rewrite saved objects in typescript (#36829) #38249

Merged
merged 2 commits into from
Jun 7, 2019

Commits on Jun 7, 2019

  1. [Core] Rewrite saved objects in typescript (elastic#36829)

    * Convert simple files to TS
    
    * Fix jest tests
    
    * Rename saved_objects_client{.js => .ts}
    
    * WIP saved_objects_client
    
    * saved_objects repository{.js => .ts}
    
    * includedFields support string[] for type paramater
    
    * Repository/saved_objects_client -> TS
    
    * Fix tests and dependencies
    
    * Fix saved objects type errors and simplify
    
    * saved_objects/index saved_objects/service/index -> ts
    
    * Fix saved objects export test after switching to typed mock
    
    * Workaround type error
    
    * Revert "Workaround type error"
    
    This reverts commit de3252267eb2e6bf56a5584d271b55a7afdc1c53.
    
    * Correctly type Server.savedObjects.SaveObjectsClient constructor
    
    * saved_objects/service/lib/index.{js -> ts}
    
    * saved_objects/service/lib/scoped_client_provider{js -> ts}
    
    * Typescriptify scoped_client_provider
    
    * Fix x-pack jest imports
    
    * Add lodash/internal/toPath typings to xpath
    
    * Introduce SavedObjectsClientContract
    
    We need a way to specify that injected dependencies should adhere to the
    SavedObjectsClient "contract". We can't use the SavedObjectsClient class
    itself since it contains the private _repository property which in TS is
    included in the type signature of a class.
    
    * Cleanup and simplify types
    
    * Fix repository#delete should return {}
    
    * Add SavedObjects repository test for uncovered bug
    
    Test for a bug in our previous js implementation that can lead to data
    corruption and data loss.
    
    If a bulkGet request is made where one of the objects to fetch is of a type
    that isn't allowed, the returned result will include documents which have the
    incorrect id and type assigned. E.g. the data of an object with id '1' is
    returned with id '2'. Saving '2' will incorrectly override it's data with that
    of the data of object '1'.
    
    * SavedObject.updated_at: string and unify saved_object / serializer types
    
    * Cleanup
    
    * Address code review feedback
    
    * Don't mock errors helpers in SavedObjectsClient Mock
    
    * Address CR feedback
    
    * CR Feedback #2
    
    * Add kibana-platform as code owners of Saved Objects
    
    * Better typings for SavedObjectsClient.errors
    
    * Use unknown as default for generic type request paramater
    
    * Bump @types/elasticsearch
    
    * Fix types for isForbiddenError
    
    * Bump x-pack @types/elasticsearch
    rudolf committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    734b167 View commit details
    Browse the repository at this point in the history
  2. Update yarn.lock

    rudolf committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    e2e0741 View commit details
    Browse the repository at this point in the history