Skip to content

feat: support JSONata query language #636

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

Merged
merged 6 commits into from
Dec 26, 2024

Conversation

zirkelc
Copy link
Collaborator

@zirkelc zirkelc commented Dec 5, 2024

AWS recently introduced support for JSONata expressions as an alternative to JSONPath:

https://aws.amazon.com/blogs/compute/simplifying-developer-experience-with-variables-and-jsonata-in-aws-step-functions/
https://docs.aws.amazon.com/step-functions/latest/dg/transforming-data.html

This PR adds support for new fields to use JSONata expressions.

@zirkelc
Copy link
Collaborator Author

zirkelc commented Dec 5, 2024

I also updated the typescripts types: DefinitelyTyped/DefinitelyTyped#71344

@zirkelc zirkelc changed the title test: add test for jsonata feat: support JSONata query language Dec 24, 2024
@zirkelc
Copy link
Collaborator Author

zirkelc commented Dec 24, 2024

@horike37 I tested this PR in my own project and it works. Please let me know what else is to do to get this merged :-)

@horike37 horike37 merged commit 2472cc0 into serverless-operations:master Dec 26, 2024
1 check passed
@olivierto
Copy link

Woah thanks ! when will this new version will be live in npm ?

@zirkelc
Copy link
Collaborator Author

zirkelc commented Jan 13, 2025

Hey @olivierto

not sure when @horike37 will release a new version. In the meantime, if you want to try it out you can install a preview version from this PR:

zirkelc#1

That's how I tested it and use it currently.

@ebisbe
Copy link

ebisbe commented Jan 24, 2025

@zirkelc This is just partially working, right? I've just migrated a simple step function that does a ddb call and it's failing because for the permissions [getDynamoDBPermissions] it's not checking for Arguments and only for Parameters.

@olivierto
Copy link

olivierto commented Jan 24, 2025

@ebisbe yes it's not working for all resources except the nested stepFunctions.

@zirkelc
Copy link
Collaborator Author

zirkelc commented Jan 24, 2025

Hey,

yes that might be true. I will into this!

@zirkelc
Copy link
Collaborator Author

zirkelc commented Jan 24, 2025

Hey @ebisbe and @olivierto

I updated the compileIamRoles function to use Paramaters or Arguments for DynamoDB, depending on the QueryLanguage field (the field on the State not the top-level field). See zirkelc@1900d04

A new preview release was created, see this comment: zirkelc#1 (comment)

Since it's the same identifier, you might need to delete the dependency to force a re-install. Please give it a try and let me know if it works.

Regarding the remaining AWS service: there are quite a lot of changes required to support Arguments over Parameters for all services. I won't have time to make all these changes in the foreseeable future, but I can surely help out if I see there's an actual demand for it.

If the latest changes for DDB work, I will submit a new PR to this repo so that other people can help support more services (if needed).

@ebisbe
Copy link

ebisbe commented Jan 29, 2025

Sorry @zirkelc but I'm using a fork where I added multiple other services that I needed credentials. I think I had a PR but eventually I close it because I saw it went nowhere. I think the main issue is still the maintainer which is not doing much and does not want to step down...

@olivier-Attestis
Copy link

Hello @zirkelc and @ebisbe i've made a fork and did the required changes, but I had no time to make update tests...

@zirkelc
Copy link
Collaborator Author

zirkelc commented Jan 30, 2025

@olivierto you can copy the updated tests from this commit: zirkelc@1900d04#diff-ac572495ab49814342a6cce41eb2e330796c89f16e3dcbcc1d0c7b6cfbaa7122

They only update DDB tests, but I think it's a good template on adding more tests for future services

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants