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

feat: add a function to verify and return Abilities. #1252

Merged
merged 5 commits into from
Jan 11, 2024

Conversation

travis
Copy link
Contributor

@travis travis commented Jan 8, 2024

Given a list of strings representing capability names (W3UpAbilitys), verify that all the strings are valid W3UpAbilitys and return W3UpAbility[].

W3UpAbility[] is still just a list of strings, but this helps us play nice with Typescript.

Inspired by #1250

Given a list of strings representing capability names (Abilities), verify that all the strings are valid Abilities and return Abilities[].

Abilities[] is still just a list of strings, but this helps us play nice with Typescript.

Inspired by #1250
packages/w3up-client/src/client.js Outdated Show resolved Hide resolved
packages/w3up-client/src/client.js Outdated Show resolved Hide resolved
packages/w3up-client/test/client.test.js Outdated Show resolved Hide resolved
packages/w3up-client/src/client.js Outdated Show resolved Hide resolved
@travis
Copy link
Contributor Author

travis commented Jan 8, 2024

Thanks @alanshaw! I've reworked this a bit per your suggestions.

Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

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

I think this is fine to merge but I'd probably call it Ability or ServiceAbility or KnownAbility over W3UpAbility - putting product name in the type makes me feel uneasy. I'm guessing you didn't just use Ability because it conflicts with ucanto type...

@travis
Copy link
Contributor Author

travis commented Jan 11, 2024

Sure! And yea, the overlap with Ucanto is the issue - we export them all from the access client so calling it Ability causes problems.

FWIW I was thinking of it as the repo/package name rather than the product name, but I don't have strong feelings - will call it ServiceAbility

@travis travis merged commit 2f026a2 into main Jan 11, 2024
4 checks passed
@travis travis deleted the feat/abilities-wrapper branch January 11, 2024 22:31
travis pushed a commit that referenced this pull request Jan 17, 2024
🤖 I have created a release *beep* *boop*
---


##
[12.1.0](w3up-client-v12.0.0...w3up-client-v12.1.0)
(2024-01-17)


### Features

* add a function to verify and return Abilities.
([#1252](#1252))
([2f026a2](2f026a2))
* re-export Store implementations from w3up-client
([#1266](#1266))
([b3c6b46](b3c6b46))
* strictly require nodejs version
([#1264](#1264))
([bc9f427](bc9f427))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
travis pushed a commit that referenced this pull request Jan 25, 2024
🤖 I have created a release *beep* *boop*
---


##
[13.1.0](capabilities-v13.0.0...capabilities-v13.1.0)
(2024-01-25)


### Features

* add `initialize` method to `PlansStorage`
([#1278](#1278))
([6792126](6792126))
* add a function to verify and return Abilities.
([#1252](#1252))
([2f026a2](2f026a2))
* change `plan/update` to `plan/set` and use existing `PlansStorage#set`
to implement an invocation handler
([#1258](#1258))
([1ccbfe9](1ccbfe9))
* introduce capability for changing billing plan
([#1253](#1253))
([d33b3a9](d33b3a9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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