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

Implement processing v2 #32

Merged
merged 11 commits into from
Nov 27, 2023
Merged

Implement processing v2 #32

merged 11 commits into from
Nov 27, 2023

Conversation

Siegrift
Copy link
Collaborator

@Siegrift Siegrift commented Nov 18, 2023

Relates to #27

Rationale

The change starts with introducing new processing option in OIS, called preProcessingSpecificationV2 and postProcessingSpecificationV2 respectively. Note, that original issue only talks about post processing, but since we are changing the format is makes sense to also do pre processing.

The new processing code requires user to write a function which accepts the input as first argument and the output is a return value. This function can be both async or sync. See many examples in the tests. There are also tests which take the v1 snippets and convert them to v2.

The old implementation functions are suffixed with V1 version and postProcessApiCallResponse and preProcessApiCallParameters abstract away which processing is used (under the hood they choose either v1 or v2 implementation) and they return a standard response. This is especially nice for end use, such as Airnode or Pusher.

@Siegrift Siegrift requested a review from andreogle November 18, 2023 16:16
@Siegrift Siegrift self-assigned this Nov 18, 2023
@Siegrift Siegrift requested a review from aquarat November 18, 2023 16:16
@Siegrift Siegrift changed the title Processing v2 Implement processing v2 Nov 18, 2023
package.json Outdated Show resolved Hide resolved
src/processing/processing.ts Outdated Show resolved Hide resolved
src/processing/processing.ts Outdated Show resolved Hide resolved
src/processing/schema.ts Outdated Show resolved Hide resolved
src/processing/processing.ts Show resolved Hide resolved
@Siegrift Siegrift merged commit a170578 into main Nov 27, 2023
3 checks passed
@Siegrift Siegrift deleted the processing-v2 branch November 27, 2023 09:19
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.

2 participants