feat(twenty-partners): expose partnerScope on list + by-slug endpoints#21126
Conversation
LogDetails |
🔍 Automated Pre-Review✅ No issues detected - This PR is ready for human review. Automated pre-review. Human approval still required. |
There was a problem hiding this comment.
2 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/twenty-apps/internal/twenty-partners/src/logic-functions/get-partner-by-slug.logic-function.ts">
<violation number="1" location="packages/twenty-apps/internal/twenty-partners/src/logic-functions/get-partner-by-slug.logic-function.ts:10">
P2: Big duplicate partner shape/query added. This will drift and break consistency when fields evolve. Extract shared type/query fragment.</violation>
<violation number="2" location="packages/twenty-apps/internal/twenty-partners/src/logic-functions/get-partner-by-slug.logic-function.ts:90">
P2: Public route returns raw error message. This leaks internal backend details to anyone calling endpoint. Return a generic error string.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| type CurrencyValue = { amountMicros: number; currencyCode: string } | null; | ||
| type LinkValue = { primaryLinkUrl: string | null } | null; | ||
|
|
||
| type Partner = { |
There was a problem hiding this comment.
P2: Big duplicate partner shape/query added. This will drift and break consistency when fields evolve. Extract shared type/query fragment.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-apps/internal/twenty-partners/src/logic-functions/get-partner-by-slug.logic-function.ts, line 10:
<comment>Big duplicate partner shape/query added. This will drift and break consistency when fields evolve. Extract shared type/query fragment.</comment>
<file context>
@@ -0,0 +1,107 @@
+type CurrencyValue = { amountMicros: number; currencyCode: string } | null;
+type LinkValue = { primaryLinkUrl: string | null } | null;
+
+type Partner = {
+ id: string;
+ name: string | null;
</file context>
| } catch (err) { | ||
| return { | ||
| ok: false, | ||
| reason: err instanceof Error ? err.message : String(err), |
There was a problem hiding this comment.
P2: Public route returns raw error message. This leaks internal backend details to anyone calling endpoint. Return a generic error string.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/twenty-apps/internal/twenty-partners/src/logic-functions/get-partner-by-slug.logic-function.ts, line 90:
<comment>Public route returns raw error message. This leaks internal backend details to anyone calling endpoint. Return a generic error string.</comment>
<file context>
@@ -0,0 +1,107 @@
+ } catch (err) {
+ return {
+ ok: false,
+ reason: err instanceof Error ? err.message : String(err),
+ };
+ }
</file context>
…y in list endpoint
…r input shape Read slug from queryStringParameters (LogicFunctionEvent shape) instead of top-level input; bump patch version to 0.3.2 for eventual deploy.
…p `as any`
The CoreApiClient is codegenerated from the synced workspace schema, so the
`/partners` query is fully typed. Remove the type-lossy `as any` on the query
and the `as Array<{ node: Partner }>` result cast, and derive the response type
from the selection itself (dropping the hand-written Partner DTO that claimed
`amountMicros: number` for a BigFloat and required fields for optional ones).
This also fixes the latent "Property 'edges' does not exist on type '{}'" error
the cast was masking.
b52bf76 to
89239d2
Compare
| httpRouteTriggerSettings: { | ||
| path: '/partner-by-slug', | ||
| httpMethod: 'GET', | ||
| isAuthRequired: false, |
There was a problem hiding this comment.
@rashad @FelixMalfait are we happy about this one? we are exposing PII on a public endpoint here
We should add authentication here
There was a problem hiding this comment.
I think I get it, this is supposed to be served on a public website?
There was a problem hiding this comment.
even for the list? we have an authentication mecanism for the POST applications #21040
…ce, drop deploymentExpertise facet (twentyhq#21127) ## What Rebinds the marketplace's expertise facet from `deploymentExpertise` (Cloud / Self-host) to **`partnerScope`** — the five partner Categories: Advisory & Discovery · Solutioning · Custom Development · Hosting & Infrastructure · Training & Adoption. Moves the card chip, the profile facts row, the dropdown filter, the `?categories=` URL param, and the API-boundary normalization onto `partnerScope`. The standalone Cloud/Self-host facet is **dropped** (hosting is now the `HOSTING` category), per the harmonization decision. ## Depends on - The app exposing `partnerScope` — companion app PR twentyhq#21126. - The new `partnerScope` options + data migration — signup app PR twentyhq#21040. ## Tests TDD red→green on: `filter-partners`, both API normalizers, `filter-url-helpers`, `PartnerCard`, `use-filter-state`. 53/53 pass; typecheck + lint + format clean. ## Merge order (we'll decide) Independent diff. Suggested last of the four, after the signup PRs (twentyhq#21039 / twentyhq#21040) and the app PR (twentyhq#21126). Run `lingui:extract` once after twentyhq#21039 merges so the `.po` files don't conflict twice. Deploy the app + migrate before the website ships.
Bumps the `twenty-partners` SDK app version 0.3.2 → 0.3.3 so `main` tracks what's deployed to prod. This is the deploy version for the partner-app changes that just landed: marketplace `partnerScope` exposure (twentyhq#21126), the `submit-partner-application` endpoint + new Partner categories + migration (twentyhq#21040), the marketplace card rebind (twentyhq#21127), and the signup wizard (twentyhq#21039). No code changes — version bump only.
What
Adds
partnerScope(the partner Categories multi-select) to the output of the two public partner endpoints:list-available-partners(/s/partners)get-partner-by-slug(/s/partner-by-slug)Additive only —
deploymentExpertiseis kept, so existing consumers (the current live marketplace) are unaffected.Why
Part of the partner marketplace rework. The website marketplace (companion branch
rk-rework-marketplace-cards) consumespartnerScopeto show/filter partner Categories. The new options + migration live in the signup app PR #21040.Merge order (we'll decide)
Independent diff — can merge in any order. Couplings to keep in mind:
package.jsonversion; whoever merges second re-bumps.yarn migrate:partner-scope:prodbefore the website is deployed.