Skip to content

feat(twenty-partners): expose partnerScope on list + by-slug endpoints#21126

Merged
rashad merged 6 commits into
mainfrom
rk-expose-rates-linkedin
Jun 2, 2026
Merged

feat(twenty-partners): expose partnerScope on list + by-slug endpoints#21126
rashad merged 6 commits into
mainfrom
rk-expose-rates-linkedin

Conversation

@rashad

@rashad rashad commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

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 — deploymentExpertise is 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) consumes partnerScope to 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:

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor
Fails
🚫

node failed.

Log

Details
�[31mError: �[39m SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    at JSON.parse (<anonymous>)
�[90m    at parseJSONFromBytes (node:internal/deps/undici/undici:4337:19)�[39m
�[90m    at successSteps (node:internal/deps/undici/undici:6985:27)�[39m
�[90m    at readAllBytes (node:internal/deps/undici/undici:5908:13)�[39m
�[90m    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)�[39m
danger-results://tmp/danger-results-bb87280b.json

Generated by 🚫 dangerJS against 89239d2

@rashad rashad self-assigned this Jun 2, 2026
@rashad rashad marked this pull request as ready for review June 2, 2026 06:26
@twenty-ci-bot-public

twenty-ci-bot-public Bot commented Jun 2, 2026

Copy link
Copy Markdown

🔍 Automated Pre-Review

No issues detected - This PR is ready for human review.


View details

Automated pre-review. Human approval still required.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>

rashad added 6 commits June 2, 2026 12:25
…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.
@rashad rashad force-pushed the rk-expose-rates-linkedin branch from b52bf76 to 89239d2 Compare June 2, 2026 08:25
httpRouteTriggerSettings: {
path: '/partner-by-slug',
httpMethod: 'GET',
isAuthRequired: false,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rashad @FelixMalfait are we happy about this one? we are exposing PII on a public endpoint here

We should add authentication here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think I get it, this is supposed to be served on a public website?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

even for the list? we have an authentication mecanism for the POST applications #21040

@charlesBochet charlesBochet added this pull request to the merge queue Jun 2, 2026
@rashad rashad removed this pull request from the merge queue due to a manual request Jun 2, 2026
@rashad rashad added this pull request to the merge queue Jun 2, 2026
Merged via the queue into main with commit a355737 Jun 2, 2026
98 checks passed
@rashad rashad deleted the rk-expose-rates-linkedin branch June 2, 2026 10:34
timothybrush pushed a commit to timothybrush/twenty that referenced this pull request Jun 2, 2026
…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.
dilanmelvin pushed a commit to dilanmelvin/twenty that referenced this pull request Jun 2, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants