@to11ai/sdk 3.0.0-rc.23 → 3.0.0-rc.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -83,23 +83,17 @@ function windowQuery(window: UsageWindow): Query {
83
83
  }
84
84
 
85
85
  /**
86
- * The lookup's one query param: exactly one of `email` or `query`, decided
87
- * by value (a key present but `undefined` is unset), as the Python SDK's
88
- * `find_principals` does. Neither or both is refused before any request.
86
+ * The lookup's one query param, `query` (a name or part of one). The API
87
+ * dropped the `email` form (TO11-3860); a missing query is refused before
88
+ * any request.
89
89
  */
90
90
  function principalsQuery(input: FindPrincipalsInput): Query {
91
- const { email, query } = input as {
92
- readonly email?: string | null;
93
- readonly query?: string | null;
94
- };
95
- const hasEmail = typeof email === "string";
96
- const hasQuery = typeof query === "string";
97
- if (hasEmail && !hasQuery) return { email };
98
- if (hasQuery && !hasEmail) return { query };
91
+ const { query } = input as { readonly query?: string | null };
92
+ if (typeof query === "string") return { query };
99
93
  throw new To11aiValidationError(
100
- "[to11ai/sdk] findPrincipals() needs exactly one of `query` or `email`",
94
+ "[to11ai/sdk] findPrincipals() needs `query`",
101
95
  "invalid_principal_lookup",
102
- { query: hasQuery, email: hasEmail },
96
+ { query: false },
103
97
  );
104
98
  }
105
99
 
@@ -115,7 +109,7 @@ export class UsageResource {
115
109
  }
116
110
 
117
111
  /**
118
- * Members of the organization by name (`query`) or exact `email`, as
112
+ * Members of the organization by name (`query`), as
119
113
  * `{ principalId, displayName }`. Pass a `principalId` to the other reads.
120
114
  */
121
115
  async findPrincipals(
@@ -70,10 +70,11 @@ export type UsageExcludedProject =
70
70
 
71
71
  // ─── Inputs ────────────────────────────────────────────────────────────────
72
72
 
73
- /** Look a member up by name (`query`, matched in the API) or exact `email`. */
74
- export type FindPrincipalsInput =
75
- | { readonly orgId: string; readonly query: string }
76
- | { readonly orgId: string; readonly email: string };
73
+ /** Look a member up by name (`query`, matched in the API). */
74
+ export type FindPrincipalsInput = {
75
+ readonly orgId: string;
76
+ readonly query: string;
77
+ };
77
78
 
78
79
  export interface ListSessionsInput {
79
80
  readonly orgId: string;