Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Sergii Stotskyi
    @stalniy
    Thanks for testing @J3m5! I'll look into this tomorrow and think what I can do with this
    maybe instead of Array.map we can use Array.reduce + concat
    Jems
    @J3m5
    That's what I'm trying but typescript is complaining about types and I don't know it well enough to make the types right
    I got it working!
    Sergii Stotskyi
    @stalniy
    Cool!
    Jems
    @J3m5
    All current and new tests have passed!
    This change make it unnecessary to check if the value is an array or a projected field in the interpreters, and that's a good news because there were other interpreters like all, in or elemMatch that didn't works with nested arrays.
    I'll submit a PR
    Sergii Stotskyi
    @stalniy
    Awesome news! Waiting for this PR!
    Jems
    @J3m5
    Do you prefer one big commit ot mutlples detailed ones ?
    Jems
    @J3m5
    PR submited, I'll squash those commits if you want.
    Sergii Stotskyi
    @stalniy
    That’s fine. PR is not so big. Thanks for asking :) I'll squash commits during merge, so no worries
    Simon Brunel
    @simonbrunel
    Hi! Thanks again @stalniy for your work on CASL and UCAST :) I'm going to give a try to UCAST in a NestJS project, in an attempt to not use nestjs-query. I'm wondering what is the current status of this project, are you still interested in maintaining it? How do you feel it will evolve?
    Simon Brunel
    @simonbrunel

    For context, my use case is abstracting HTTP queries (at the controller level) and later interpret these queries (at the service level) either as a mongodb query or an Azure Search query, which means:

    • a custom parser to translate HTTP queries to condition AST (I can reuse part of the @ucast/mongodb parser instructions + custom)
    • and a mongodb interpreter (I was hoping this to be built-in, but just found stalniy/ucast#2)
    • an Azure Search interpreter (obviously, I need to write it from scratch, though I could contribute it back if it makes sense)

    So it looks like I would need to write quite a lot of logic, thus the initial question :)

    Sergii Stotskyi
    @stalniy

    Hi @simonbrunel

    Thanks :)

    the project is alive and I do maintain it, it is used by casl and one commercial DAL.
    However I don't have much time to push it forward for now. just busy on my current job
    Simon Brunel
    @simonbrunel
    Thanks @stalniy! I will give it a try and, if conclusive, will contribute the mongodb interpreter. Though, I'm not sure I will have time to make it "clean" enough for a good PR. Will see :)
    Simon Brunel
    @simonbrunel
    Currently the mongo parser accepts any non empty arrays for $and/$or/$nor. Does it make sense to also check that these arrays only contain objects (expressions)?
    Sergii Stotskyi
    @stalniy
    I did quite littke checks just to ensure that query is semy-valid because the rest of validation ts does at build time and other checks are done by nested operators. However Im not sure whether parse validates its input as an object
    but if not it should be easy to add this
    Simon Brunel
    @simonbrunel
    Indeed, parse() doesn't validate its input (i.e. parse("foo") -> {"$and":[{"0":{"$eq":"f"}},{"1":{"$eq":"o"}},{"2":{"$eq":"o"}}]})
    which probably won't happen when the user calls parse() directly because he must validate the input beforehand (TS), however if the input contains $and/$or/$nor with none object array, it's not handled by type checking.
    Sergii Stotskyi
    @stalniy
    right, it needs a bit more validation if we want to use it to parse query from user (http). If you can collect all of such cases, I will add them to ObjectParser
    Simon Brunel
    @simonbrunel
    stalniy/ucast#20 for the logical operators
    carlba
    @carlba
    @stalniy: Any plans to update this to a later version of TypeORM this currently uses 0.2.0 while 0.3.0 is available for a long time.
    @stalniy: I tried to make a fork and upgrade but I don't know how to get a proper build that I can test :)
    Sergii Stotskyi
    @stalniy

    hey guys,

    Currently it's not a priority for me. as you may know we have a war in Ukraine. So, from time to time I look into casl issues but for anything extra (or new) doesn't have time.