Skip to content

refactor(api)!: rename organization to team - #9

Merged
BlackHole1 merged 1 commit into
mainfrom
refactor/rename-organization-to-team
Jul 15, 2026
Merged

refactor(api)!: rename organization to team#9
BlackHole1 merged 1 commit into
mainfrom
refactor/rename-organization-to-team

Conversation

@BlackHole1

Copy link
Copy Markdown
Member

A requirement change renamed the tenant-scoping concept: what the gateway called an organization is now a team, and it expects the x-oo-team-name header in place of x-oo-organization-name. The client follows — ClientConfig.team, CallOptions.team, and the ScopeOptions pick rename with it.

No deprecated organization alias. The package is pre-1.0 and the old header no longer exists on the gateway, so keeping the field callable would only let callers send a selector the backend never reads — a silent wrong-tenant bug where a type error is far kinder.

While here, pin the team propagation in #sourceConfig() with a test. using() never folds the client-level default into the merged scope, so a scope omitting team depends on that line to reach #resolveCall — yet deleting it left all 181 tests green, and every ClientConfig field being optional puts it out of tsc's reach too. It silently drops the header on scoped sub-clients.

Also drops a stray précise from the French README's code comment, where it was neither English nor French.

BREAKING CHANGE: the organization option is now team on ClientConfig, CallOptions, and using() scopes, and the wire header is x-oo-team-name. Rename the field at every call site; there is no compatibility alias.

A requirement change renamed the tenant-scoping concept: what the
gateway called an organization is now a team, and it expects the
`x-oo-team-name` header in place of `x-oo-organization-name`. The
client follows — `ClientConfig.team`, `CallOptions.team`, and the
`ScopeOptions` pick rename with it.

No deprecated `organization` alias. The package is pre-1.0 and the old
header no longer exists on the gateway, so keeping the field callable
would only let callers send a selector the backend never reads — a
silent wrong-tenant bug where a type error is far kinder.

While here, pin the `team` propagation in `#sourceConfig()` with a
test. `using()` never folds the client-level default into the merged
scope, so a scope omitting `team` depends on that line to reach
`#resolveCall` — yet deleting it left all 181 tests green, and every
`ClientConfig` field being optional puts it out of `tsc`'s reach too.
It silently drops the header on scoped sub-clients.

Also drops a stray `précise` from the French README's code comment,
where it was neither English nor French.

BREAKING CHANGE: the `organization` option is now `team` on
`ClientConfig`, `CallOptions`, and `using()` scopes, and the wire header
is `x-oo-team-name`. Rename the field at every call site; there is no
compatibility alias.

Signed-off-by: Kevin Cui <bh@bugs.cc>
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Summary by CodeRabbit

  • New Features

    • Replaced the organization scope with team across client configuration, per-call options, scoped clients, and request headers.
    • Team values now map to the x-oo-team-name header and follow client, scoped, and per-call precedence.
  • Documentation

    • Updated English, French, Japanese, Russian, Simplified Chinese, and Traditional Chinese documentation and examples to describe team-based scoping.
  • Bug Fixes

    • Preserved request validation and OpenConnector behavior while updating scope handling and header expectations.

Walkthrough

The SDK replaces the organization scope with team across exported configuration and call options, scope inheritance, request header generation, examples, tests, and documentation. Connector resolution now prioritizes per-call, using(), then client-level team values and emits x-oo-team-name. OpenConnector type tests reject unsupported team options, while project and runtime comments and multilingual READMEs reflect the updated terminology.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the breaking rename from organization to team and follows a conventional commit-style format.
Description check ✅ Passed The description is directly related to the rename of tenant scoping from organization to team and mentions the header and API changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch refactor/rename-organization-to-team

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
examples/scoping-and-options.ts (1)

12-12: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Use distinct team values to demonstrate precedence.

All three layers use "acme", so the example cannot show whether per-call team overrides using(), or whether using() overrides the client default.

Proposed example values
-  team: "acme",
+  team: "client-team",

-  const work = oomol.using({ connectionName: "work", team: "acme" });
+  const work = oomol.using({ connectionName: "work", team: "scoped-team" });

-      team: "acme",
+      team: "call-team",

Also applies to: 21-23, 25-30

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/scoping-and-options.ts` at line 12, Update the team values in the
scoping example so the client default, using() scope, and per-call options each
use distinct values, allowing precedence to be observed. Apply the change to the
related team declarations and calls in the example while preserving the existing
scoping structure.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Line 107: Align the precedence statement in README.md:107-107,
docs/README/README.fr.md:107-107, docs/README/README.ja.md:107-107,
docs/README/README.ru.md:107-107, docs/README/README.zh-CN.md:107-107, and
docs/README/README.zh-TW.md:107-107 so each translation identifies team and
connectionName as the only using() scope fields, while signal, timeoutMs, and
retries are per-call-only options that override client defaults.

---

Nitpick comments:
In `@examples/scoping-and-options.ts`:
- Line 12: Update the team values in the scoping example so the client default,
using() scope, and per-call options each use distinct values, allowing
precedence to be observed. Apply the change to the related team declarations and
calls in the example while preserving the existing scoping structure.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 719cd366-cc0e-4b19-89d4-8c3cca5f6ec1

📥 Commits

Reviewing files that changed from the base of the PR and between d8232cb and 5d0077d.

📒 Files selected for processing (20)
  • README.md
  • docs/README/README.fr.md
  • docs/README/README.ja.md
  • docs/README/README.ru.md
  • docs/README/README.zh-CN.md
  • docs/README/README.zh-TW.md
  • examples/scoping-and-options.ts
  • fixtures/consumer/no-b/index.test-d.ts
  • fixtures/consumer/partial-b/index.test-d.ts
  • fixtures/consumer/with-b/index.test-d.ts
  • fixtures/resolution/consumer.ts
  • src/connector.ts
  • src/open.ts
  • src/project.ts
  • src/registry.ts
  • src/types.ts
  • test/apps.test.ts
  • test/project.test.ts
  • test/selectors.test.ts
  • test/transport.test.ts

Comment thread README.md
- **`connectionName`** — *which* stored credential to use when you have more than one connection for a provider.

Per-call options (`organization`, `connectionName`, `signal`, `timeoutMs`, `retries`) override a `using()` scope, which overrides client defaults:
Per-call options (`team`, `connectionName`, `signal`, `timeoutMs`, `retries`) override a `using()` scope, which overrides client defaults:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align the precedence text across all README translations.

using() scopes contain only team and connectionName; signal, timeoutMs, and retries are per-call-only options. Update each translation to distinguish scopeable fields from options that override only client defaults.

  • README.md#L107-L107: Document team/connectionName as the using() fields and the remaining options as per-call-only.
  • docs/README/README.fr.md#L107-L107: Apply the same distinction in French.
  • docs/README/README.ja.md#L107-L107: Apply the same distinction in Japanese.
  • docs/README/README.ru.md#L107-L107: Apply the same distinction in Russian.
  • docs/README/README.zh-CN.md#L107-L107: Apply the same distinction in Simplified Chinese.
  • docs/README/README.zh-TW.md#L107-L107: Apply the same distinction in Traditional Chinese.
📍 Affects 6 files
  • README.md#L107-L107 (this comment)
  • docs/README/README.fr.md#L107-L107
  • docs/README/README.ja.md#L107-L107
  • docs/README/README.ru.md#L107-L107
  • docs/README/README.zh-CN.md#L107-L107
  • docs/README/README.zh-TW.md#L107-L107
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 107, Align the precedence statement in README.md:107-107,
docs/README/README.fr.md:107-107, docs/README/README.ja.md:107-107,
docs/README/README.ru.md:107-107, docs/README/README.zh-CN.md:107-107, and
docs/README/README.zh-TW.md:107-107 so each translation identifies team and
connectionName as the only using() scope fields, while signal, timeoutMs, and
retries are per-call-only options that override client defaults.

@BlackHole1
BlackHole1 merged commit 2c737ef into main Jul 15, 2026
2 checks passed
@BlackHole1
BlackHole1 deleted the refactor/rename-organization-to-team branch July 15, 2026 08:27
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.

1 participant