@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.
- package/dist/generated/index.d.ts +1 -1
- package/dist/generated/types.gen.d.ts +5609 -4235
- package/dist/generated/zod.gen.d.ts +849 -3
- package/dist/usage/resource.cjs +3 -7
- package/dist/usage/resource.d.ts +1 -1
- package/dist/usage/resource.js +3 -7
- package/dist/usage/types.d.ts +1 -4
- package/package.json +1 -1
- package/src/generated/index.ts +1 -1
- package/src/generated/types.gen.ts +5841 -4413
- package/src/generated/zod.gen.ts +847 -5
- package/src/usage/resource.ts +8 -14
- package/src/usage/types.ts +5 -4
package/src/usage/resource.ts
CHANGED
|
@@ -83,23 +83,17 @@ function windowQuery(window: UsageWindow): Query {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* The lookup's one query param
|
|
87
|
-
*
|
|
88
|
-
*
|
|
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 {
|
|
92
|
-
|
|
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
|
|
94
|
+
"[to11ai/sdk] findPrincipals() needs `query`",
|
|
101
95
|
"invalid_principal_lookup",
|
|
102
|
-
{ query:
|
|
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`)
|
|
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(
|
package/src/usage/types.ts
CHANGED
|
@@ -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)
|
|
74
|
-
export type FindPrincipalsInput =
|
|
75
|
-
|
|
76
|
-
|
|
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;
|