Skip to content

refactor(editor): Extract users api into rest-api-client package (no-changelog) #18046

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

Merged

Conversation

alexgrozav
Copy link
Member

Summary

Extract users api into rest-api-client package.

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/CAT-929/move-users-api-to-n8nrest-api-client-package

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@alexgrozav alexgrozav requested a review from a team August 6, 2025 11:33
@alexgrozav alexgrozav self-assigned this Aug 6, 2025
@alexgrozav alexgrozav requested a review from r00gm August 6, 2025 11:33
@alexgrozav alexgrozav requested review from cstuncsik and removed request for r00gm August 6, 2025 11:34
Copy link

bundlemon bot commented Aug 6, 2025

BundleMon

Files added (2)
Status Path Size Limits
WASM Dependencies
tree-sitter-bash.wasm
+181.26KB -
WASM Dependencies
tree-sitter.wasm
+74.47KB -

Total files change +255.73KB

Groups added (2)
Status Path Size Limits
**/*.js
+5.37MB -
**/*.css
+190.16KB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history

Copy link
Contributor

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

Choose a reason for hiding this comment

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

cubic analysis

2 issues found across 38 files • Review in cubic

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@@ -1,4 +1,4 @@
import type { IUser } from '@/Interface';
import type { IUser } from '@n8n/rest-api-client/api/users';
Copy link
Contributor

Choose a reason for hiding this comment

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

Imports a type through a deep sub-path instead of the package’s public entry point, creating an unnecessary tight coupling to internal file structure and risking breakage if the module layout changes.

Prompt for AI agents
Address the following comment on packages/frontend/editor-ui/src/api/workflow-webhooks.ts at line 1:

<comment>Imports a type through a deep sub-path instead of the package’s public entry point, creating an unnecessary tight coupling to internal file structure and risking breakage if the module layout changes.</comment>

<file context>
@@ -1,4 +1,4 @@
-import type { IUser } from &#39;@/Interface&#39;;
+import type { IUser } from &#39;@n8n/rest-api-client/api/users&#39;;
 import { post } from &#39;@n8n/rest-api-client&#39;;
 
</file context>
Suggested change
import type { IUser } from '@n8n/rest-api-client/api/users';
import type { IUser } from '@n8n/rest-api-client';

@@ -83,7 +83,8 @@ import {
} from '@/constants';
import { useToast } from '@/composables/useToast';
import Modal from '@/components/Modal.vue';
import type { IFormInputs, IPersonalizationLatestVersion } from '@/Interface';
import type { IFormInputs } from '@/Interface';
import type { IPersonalizationLatestVersion } from '@n8n/rest-api-client/api/users';
Copy link
Contributor

Choose a reason for hiding this comment

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

Rule violated: Prefer Typeguards over Type casting

Type assertion with as IPersonalizationLatestVersion is used for type narrowing, which is not allowed by the rule. Use a type guard function or type annotation instead.

Prompt for AI agents
Address the following comment on packages/frontend/editor-ui/src/components/PersonalizationModal.vue at line 87:

<comment>Type assertion with `as IPersonalizationLatestVersion` is used for type narrowing, which is not allowed by the rule. Use a type guard function or type annotation instead.</comment>

<file context>
@@ -83,7 +83,8 @@ import {
 } from &#39;@/constants&#39;;
 import { useToast } from &#39;@/composables/useToast&#39;;
 import Modal from &#39;@/components/Modal.vue&#39;;
-import type { IFormInputs, IPersonalizationLatestVersion } from &#39;@/Interface&#39;;
+import type { IFormInputs } from &#39;@/Interface&#39;;
+import type { IPersonalizationLatestVersion } from &#39;@n8n/rest-api-client/api/users&#39;;
 import { useRootStore } from &#39;@n8n/stores/useRootStore&#39;;
 import { useUsersStore } from &#39;@/stores/users.store&#39;;
</file context>

@alexgrozav alexgrozav requested review from a team, cstuncsik and autologie and removed request for a team and cstuncsik August 7, 2025 08:19
@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label Aug 7, 2025
Copy link
Contributor

@autologie autologie 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 the bot comment about sub-path import is valid

Imports a type through a deep sub-path instead of the package’s public entry point, creating an unnecessary tight coupling to internal file structure and risking breakage if the module layout changes.

But not the topic for this specific PR

Copy link

currents-bot bot commented Aug 7, 2025

E2E Tests: n8n tests passed after 4m 33.2s

🟢 525 · 🔴 0 · ⚪️ 1

View Run Details

Run Details

  • Project: n8n

  • Groups: 3

  • Framework: Playwright

  • Run Status: Passed

  • Commit: dbedb90

  • Spec files: 112

  • Overall tests: 526

  • Duration: 4m 33.2s

  • Parallelization: 3

Groups

GroupId Results Spec Files Progress
ui 🟢 21 · 🔴 0 · ⚪️ 1 5 / 5
ui:isolated 🟢 6 · 🔴 0 · ⚪️ 0 2 / 2
No name 🟢 498 · 🔴 0 · ⚪️ 0 105 / 105


This message was posted automatically by currents.dev | Integration Settings

@alexgrozav alexgrozav merged commit 500d07d into master Aug 7, 2025
49 checks passed
@alexgrozav alexgrozav deleted the cat-929-move-users-api-to-n8nrest-api-client-package branch August 7, 2025 09:01
@janober
Copy link
Member

janober commented Aug 11, 2025

Got released with [email protected]

idirouhab pushed a commit that referenced this pull request Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensions n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants