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

Assets #154

Merged
merged 8 commits into from Mar 17, 2022
Merged

Assets #154

merged 8 commits into from Mar 17, 2022

Conversation

rap1ds
Copy link
Member

@rap1ds rap1ds commented Mar 10, 2022

This PR adds support for Assets. It's based on #155

In this PR:

  • Add support for path params
  • Add support for assets
  • Tests

Interface looks like this:

sdk.assetByAlias({path: "translations.json", alias: "latest"})
sdk.assetByVersion({path: "translations.json", version: "..."})

@rap1ds rap1ds force-pushed the assets branch 2 times, most recently from 231add0 to be92254 Compare March 11, 2022 12:13
@rap1ds rap1ds changed the base branch from master to refactor-before-assets March 11, 2022 12:21
@rap1ds rap1ds changed the title WIP Assets Assets Mar 11, 2022
Copy link
Contributor

@OtterleyW OtterleyW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems quite straightforward and also easy to use from the FTW perspective.

src/endpoints.js Show resolved Hide resolved
src/sdk.js Outdated
@@ -402,7 +456,7 @@ const createMarketplaceApiEndpointInterceptors = httpOpts =>
//
marketplaceApiEndpoints.reduce((acc, { path, method, multipart }) => {
const fnPath = urlPathToFnPath(path);
const url = `api/${path}`;
const urlTemplate = _.template(`api/${path}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found it difficult at first to understand what this change from url to urlTemplate means to why it was made. I think I got it but maybe it would be nice to have a code comment somewhere to explain what's happening.

@rap1ds rap1ds force-pushed the assets branch 3 times, most recently from d0ae704 to ce7cb9f Compare March 16, 2022 19:50
Base automatically changed from refactor-before-assets to master March 16, 2022 20:00
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.

None yet

2 participants