@meetkai/mka1 0.49.8 → 0.49.9
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/README.md +17 -41
- package/bin/mcp-server.js +67 -52
- package/bin/mcp-server.js.map +23 -23
- package/dist/commonjs/funcs/budgetsApiKeyEvents.d.ts +1 -1
- package/dist/commonjs/funcs/budgetsApiKeyEvents.js +1 -1
- package/dist/commonjs/funcs/budgetsDeleteApiKey.d.ts +1 -1
- package/dist/commonjs/funcs/budgetsDeleteApiKey.js +1 -1
- package/dist/commonjs/funcs/budgetsDeleteOrg.d.ts +2 -2
- package/dist/commonjs/funcs/budgetsDeleteOrg.js +4 -9
- package/dist/commonjs/funcs/budgetsDeleteOrg.js.map +1 -1
- package/dist/commonjs/funcs/budgetsGetOrg.d.ts +1 -1
- package/dist/commonjs/funcs/budgetsGetOrg.js +6 -8
- package/dist/commonjs/funcs/budgetsGetOrg.js.map +1 -1
- package/dist/commonjs/funcs/budgetsOrgEvents.d.ts +1 -1
- package/dist/commonjs/funcs/budgetsOrgEvents.js +6 -8
- package/dist/commonjs/funcs/budgetsOrgEvents.js.map +1 -1
- package/dist/commonjs/funcs/budgetsSetApiKey.d.ts +1 -1
- package/dist/commonjs/funcs/budgetsSetApiKey.js +1 -1
- package/dist/commonjs/funcs/budgetsSetOrg.d.ts +2 -2
- package/dist/commonjs/funcs/budgetsSetOrg.js +7 -9
- package/dist/commonjs/funcs/budgetsSetOrg.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/mcp-server/tools/budgetsApiKeyEvents.js +1 -1
- package/dist/commonjs/mcp-server/tools/budgetsApiKeyEvents.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/budgetsDeleteApiKey.js +1 -1
- package/dist/commonjs/mcp-server/tools/budgetsDeleteOrg.js +2 -2
- package/dist/commonjs/mcp-server/tools/budgetsDeleteOrg.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/budgetsGetOrg.js +1 -1
- package/dist/commonjs/mcp-server/tools/budgetsGetOrg.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/budgetsOrgEvents.js +1 -1
- package/dist/commonjs/mcp-server/tools/budgetsOrgEvents.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/budgetsSetApiKey.js +1 -1
- package/dist/commonjs/mcp-server/tools/budgetsSetOrg.js +2 -2
- package/dist/commonjs/mcp-server/tools/budgetsSetOrg.js.map +1 -1
- package/dist/commonjs/models/operations/deleteorgbudget.d.ts +2 -2
- package/dist/commonjs/models/operations/deleteorgbudget.d.ts.map +1 -1
- package/dist/commonjs/models/operations/deleteorgbudget.js +10 -2
- package/dist/commonjs/models/operations/deleteorgbudget.js.map +1 -1
- package/dist/commonjs/models/operations/getorgbudgets.d.ts +2 -2
- package/dist/commonjs/models/operations/getorgbudgets.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getorgbudgets.js +10 -2
- package/dist/commonjs/models/operations/getorgbudgets.js.map +1 -1
- package/dist/commonjs/models/operations/listorgbudgetevents.d.ts +2 -2
- package/dist/commonjs/models/operations/listorgbudgetevents.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listorgbudgetevents.js +10 -2
- package/dist/commonjs/models/operations/listorgbudgetevents.js.map +1 -1
- package/dist/commonjs/models/operations/setorgbudget.d.ts +2 -2
- package/dist/commonjs/models/operations/setorgbudget.d.ts.map +1 -1
- package/dist/commonjs/models/operations/setorgbudget.js +4 -2
- package/dist/commonjs/models/operations/setorgbudget.js.map +1 -1
- package/dist/commonjs/react-query/budgetsApiKeyEvents.d.ts +2 -2
- package/dist/commonjs/react-query/budgetsApiKeyEvents.js +2 -2
- package/dist/commonjs/react-query/budgetsDeleteApiKey.d.ts +1 -1
- package/dist/commonjs/react-query/budgetsDeleteApiKey.js +1 -1
- package/dist/commonjs/react-query/budgetsDeleteOrg.d.ts +2 -2
- package/dist/commonjs/react-query/budgetsDeleteOrg.js +2 -2
- package/dist/commonjs/react-query/budgetsGetOrg.core.d.ts +3 -1
- package/dist/commonjs/react-query/budgetsGetOrg.core.d.ts.map +1 -1
- package/dist/commonjs/react-query/budgetsGetOrg.core.js +3 -3
- package/dist/commonjs/react-query/budgetsGetOrg.core.js.map +1 -1
- package/dist/commonjs/react-query/budgetsGetOrg.d.ts +8 -4
- package/dist/commonjs/react-query/budgetsGetOrg.d.ts.map +1 -1
- package/dist/commonjs/react-query/budgetsGetOrg.js +2 -2
- package/dist/commonjs/react-query/budgetsGetOrg.js.map +1 -1
- package/dist/commonjs/react-query/budgetsOrgEvents.core.d.ts +3 -1
- package/dist/commonjs/react-query/budgetsOrgEvents.core.d.ts.map +1 -1
- package/dist/commonjs/react-query/budgetsOrgEvents.core.js +3 -3
- package/dist/commonjs/react-query/budgetsOrgEvents.core.js.map +1 -1
- package/dist/commonjs/react-query/budgetsOrgEvents.d.ts +8 -4
- package/dist/commonjs/react-query/budgetsOrgEvents.d.ts.map +1 -1
- package/dist/commonjs/react-query/budgetsOrgEvents.js +2 -2
- package/dist/commonjs/react-query/budgetsOrgEvents.js.map +1 -1
- package/dist/commonjs/react-query/budgetsSetApiKey.d.ts +1 -1
- package/dist/commonjs/react-query/budgetsSetApiKey.js +1 -1
- package/dist/commonjs/react-query/budgetsSetOrg.d.ts +2 -2
- package/dist/commonjs/react-query/budgetsSetOrg.js +2 -2
- package/dist/commonjs/sdk/budgets.d.ts +9 -9
- package/dist/commonjs/sdk/budgets.js +9 -9
- package/dist/esm/funcs/budgetsApiKeyEvents.d.ts +1 -1
- package/dist/esm/funcs/budgetsApiKeyEvents.js +1 -1
- package/dist/esm/funcs/budgetsDeleteApiKey.d.ts +1 -1
- package/dist/esm/funcs/budgetsDeleteApiKey.js +1 -1
- package/dist/esm/funcs/budgetsDeleteOrg.d.ts +2 -2
- package/dist/esm/funcs/budgetsDeleteOrg.js +5 -10
- package/dist/esm/funcs/budgetsDeleteOrg.js.map +1 -1
- package/dist/esm/funcs/budgetsGetOrg.d.ts +1 -1
- package/dist/esm/funcs/budgetsGetOrg.js +7 -9
- package/dist/esm/funcs/budgetsGetOrg.js.map +1 -1
- package/dist/esm/funcs/budgetsOrgEvents.d.ts +1 -1
- package/dist/esm/funcs/budgetsOrgEvents.js +7 -9
- package/dist/esm/funcs/budgetsOrgEvents.js.map +1 -1
- package/dist/esm/funcs/budgetsSetApiKey.d.ts +1 -1
- package/dist/esm/funcs/budgetsSetApiKey.js +1 -1
- package/dist/esm/funcs/budgetsSetOrg.d.ts +2 -2
- package/dist/esm/funcs/budgetsSetOrg.js +8 -10
- package/dist/esm/funcs/budgetsSetOrg.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/mcp-server/tools/budgetsApiKeyEvents.js +1 -1
- package/dist/esm/mcp-server/tools/budgetsApiKeyEvents.js.map +1 -1
- package/dist/esm/mcp-server/tools/budgetsDeleteApiKey.js +1 -1
- package/dist/esm/mcp-server/tools/budgetsDeleteOrg.js +2 -2
- package/dist/esm/mcp-server/tools/budgetsDeleteOrg.js.map +1 -1
- package/dist/esm/mcp-server/tools/budgetsGetOrg.js +1 -1
- package/dist/esm/mcp-server/tools/budgetsGetOrg.js.map +1 -1
- package/dist/esm/mcp-server/tools/budgetsOrgEvents.js +1 -1
- package/dist/esm/mcp-server/tools/budgetsOrgEvents.js.map +1 -1
- package/dist/esm/mcp-server/tools/budgetsSetApiKey.js +1 -1
- package/dist/esm/mcp-server/tools/budgetsSetOrg.js +2 -2
- package/dist/esm/mcp-server/tools/budgetsSetOrg.js.map +1 -1
- package/dist/esm/models/operations/deleteorgbudget.d.ts +2 -2
- package/dist/esm/models/operations/deleteorgbudget.d.ts.map +1 -1
- package/dist/esm/models/operations/deleteorgbudget.js +10 -2
- package/dist/esm/models/operations/deleteorgbudget.js.map +1 -1
- package/dist/esm/models/operations/getorgbudgets.d.ts +2 -2
- package/dist/esm/models/operations/getorgbudgets.d.ts.map +1 -1
- package/dist/esm/models/operations/getorgbudgets.js +10 -2
- package/dist/esm/models/operations/getorgbudgets.js.map +1 -1
- package/dist/esm/models/operations/listorgbudgetevents.d.ts +2 -2
- package/dist/esm/models/operations/listorgbudgetevents.d.ts.map +1 -1
- package/dist/esm/models/operations/listorgbudgetevents.js +10 -2
- package/dist/esm/models/operations/listorgbudgetevents.js.map +1 -1
- package/dist/esm/models/operations/setorgbudget.d.ts +2 -2
- package/dist/esm/models/operations/setorgbudget.d.ts.map +1 -1
- package/dist/esm/models/operations/setorgbudget.js +4 -2
- package/dist/esm/models/operations/setorgbudget.js.map +1 -1
- package/dist/esm/react-query/budgetsApiKeyEvents.d.ts +2 -2
- package/dist/esm/react-query/budgetsApiKeyEvents.js +2 -2
- package/dist/esm/react-query/budgetsDeleteApiKey.d.ts +1 -1
- package/dist/esm/react-query/budgetsDeleteApiKey.js +1 -1
- package/dist/esm/react-query/budgetsDeleteOrg.d.ts +2 -2
- package/dist/esm/react-query/budgetsDeleteOrg.js +2 -2
- package/dist/esm/react-query/budgetsGetOrg.core.d.ts +3 -1
- package/dist/esm/react-query/budgetsGetOrg.core.d.ts.map +1 -1
- package/dist/esm/react-query/budgetsGetOrg.core.js +3 -3
- package/dist/esm/react-query/budgetsGetOrg.core.js.map +1 -1
- package/dist/esm/react-query/budgetsGetOrg.d.ts +8 -4
- package/dist/esm/react-query/budgetsGetOrg.d.ts.map +1 -1
- package/dist/esm/react-query/budgetsGetOrg.js +2 -2
- package/dist/esm/react-query/budgetsGetOrg.js.map +1 -1
- package/dist/esm/react-query/budgetsOrgEvents.core.d.ts +3 -1
- package/dist/esm/react-query/budgetsOrgEvents.core.d.ts.map +1 -1
- package/dist/esm/react-query/budgetsOrgEvents.core.js +3 -3
- package/dist/esm/react-query/budgetsOrgEvents.core.js.map +1 -1
- package/dist/esm/react-query/budgetsOrgEvents.d.ts +8 -4
- package/dist/esm/react-query/budgetsOrgEvents.d.ts.map +1 -1
- package/dist/esm/react-query/budgetsOrgEvents.js +2 -2
- package/dist/esm/react-query/budgetsOrgEvents.js.map +1 -1
- package/dist/esm/react-query/budgetsSetApiKey.d.ts +1 -1
- package/dist/esm/react-query/budgetsSetApiKey.js +1 -1
- package/dist/esm/react-query/budgetsSetOrg.d.ts +2 -2
- package/dist/esm/react-query/budgetsSetOrg.js +2 -2
- package/dist/esm/sdk/budgets.d.ts +9 -9
- package/dist/esm/sdk/budgets.js +9 -9
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/budgetsApiKeyEvents.ts +1 -1
- package/src/funcs/budgetsDeleteApiKey.ts +1 -1
- package/src/funcs/budgetsDeleteOrg.ts +5 -10
- package/src/funcs/budgetsGetOrg.ts +8 -9
- package/src/funcs/budgetsOrgEvents.ts +8 -11
- package/src/funcs/budgetsSetApiKey.ts +1 -1
- package/src/funcs/budgetsSetOrg.ts +9 -10
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/budgetsApiKeyEvents.ts +1 -1
- package/src/mcp-server/tools/budgetsDeleteApiKey.ts +1 -1
- package/src/mcp-server/tools/budgetsDeleteOrg.ts +2 -2
- package/src/mcp-server/tools/budgetsGetOrg.ts +1 -1
- package/src/mcp-server/tools/budgetsOrgEvents.ts +1 -1
- package/src/mcp-server/tools/budgetsSetApiKey.ts +1 -1
- package/src/mcp-server/tools/budgetsSetOrg.ts +2 -2
- package/src/models/operations/deleteorgbudget.ts +12 -4
- package/src/models/operations/getorgbudgets.ts +12 -4
- package/src/models/operations/listorgbudgetevents.ts +12 -4
- package/src/models/operations/setorgbudget.ts +6 -4
- package/src/react-query/budgetsApiKeyEvents.ts +2 -2
- package/src/react-query/budgetsDeleteApiKey.ts +1 -1
- package/src/react-query/budgetsDeleteOrg.ts +2 -2
- package/src/react-query/budgetsGetOrg.core.ts +5 -3
- package/src/react-query/budgetsGetOrg.ts +4 -4
- package/src/react-query/budgetsOrgEvents.core.ts +5 -3
- package/src/react-query/budgetsOrgEvents.ts +4 -4
- package/src/react-query/budgetsSetApiKey.ts +1 -1
- package/src/react-query/budgetsSetOrg.ts +2 -2
- package/src/sdk/budgets.ts +9 -9
package/src/mcp-server/server.ts
CHANGED
|
@@ -14,7 +14,7 @@ export const tool$budgetsApiKeyEvents: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "budgets-api-key-events",
|
|
15
15
|
description: `List apikey budget events
|
|
16
16
|
|
|
17
|
-
Returns recent threshold-alert and block events for the
|
|
17
|
+
Returns recent threshold-alert and block events for the apikey's budgets. Callable by cluster admins, or org admins for API keys in their own organization.`,
|
|
18
18
|
args,
|
|
19
19
|
tool: async (client, args, ctx) => {
|
|
20
20
|
const [result, apiCall] = await budgetsApiKeyEvents(
|
|
@@ -12,7 +12,7 @@ const args = {
|
|
|
12
12
|
|
|
13
13
|
export const tool$budgetsDeleteApiKey: ToolDefinition<typeof args> = {
|
|
14
14
|
name: "budgets-delete-api-key",
|
|
15
|
-
description: `Delete
|
|
15
|
+
description: `Delete an apikey budget
|
|
16
16
|
|
|
17
17
|
Removes the apikey's budget for the given owner; enforcement and alerts stop. Callable by cluster admins, or org admins for API keys in their own organization.`,
|
|
18
18
|
args,
|
|
@@ -12,9 +12,9 @@ const args = {
|
|
|
12
12
|
|
|
13
13
|
export const tool$budgetsDeleteOrg: ToolDefinition<typeof args> = {
|
|
14
14
|
name: "budgets-delete-org",
|
|
15
|
-
description: `Delete
|
|
15
|
+
description: `Delete an org budget
|
|
16
16
|
|
|
17
|
-
Removes the org's budget for the given owner; enforcement and alerts stop.`,
|
|
17
|
+
Removes the org's budget for the given owner; enforcement and alerts stop. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.`,
|
|
18
18
|
args,
|
|
19
19
|
tool: async (client, args, ctx) => {
|
|
20
20
|
const [result, apiCall] = await budgetsDeleteOrg(
|
|
@@ -14,7 +14,7 @@ export const tool$budgetsGetOrg: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "budgets-get-org",
|
|
15
15
|
description: `List org budgets
|
|
16
16
|
|
|
17
|
-
Returns the org's budgets (self-budget and/or ceiling) with each one's live spend gauge.`,
|
|
17
|
+
Returns the org's budgets (self-budget and/or ceiling) with each one's live spend gauge. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.`,
|
|
18
18
|
args,
|
|
19
19
|
tool: async (client, args, ctx) => {
|
|
20
20
|
const [result, apiCall] = await budgetsGetOrg(
|
|
@@ -14,7 +14,7 @@ export const tool$budgetsOrgEvents: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "budgets-org-events",
|
|
15
15
|
description: `List org budget events
|
|
16
16
|
|
|
17
|
-
Returns recent threshold-alert and block events for the
|
|
17
|
+
Returns recent threshold-alert and block events for the org's budgets. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.`,
|
|
18
18
|
args,
|
|
19
19
|
tool: async (client, args, ctx) => {
|
|
20
20
|
const [result, apiCall] = await budgetsOrgEvents(
|
|
@@ -12,7 +12,7 @@ const args = {
|
|
|
12
12
|
|
|
13
13
|
export const tool$budgetsSetApiKey: ToolDefinition<typeof args> = {
|
|
14
14
|
name: "budgets-set-api-key",
|
|
15
|
-
description: `Set
|
|
15
|
+
description: `Set an apikey budget
|
|
16
16
|
|
|
17
17
|
Creates or updates a budget for the apikey. One budget per (scope, owner); editing re-evaluates against live spend. Callable by cluster admins, or org admins for API keys in their own organization.`,
|
|
18
18
|
args,
|
|
@@ -12,9 +12,9 @@ const args = {
|
|
|
12
12
|
|
|
13
13
|
export const tool$budgetsSetOrg: ToolDefinition<typeof args> = {
|
|
14
14
|
name: "budgets-set-org",
|
|
15
|
-
description: `Set
|
|
15
|
+
description: `Set an org budget
|
|
16
16
|
|
|
17
|
-
Creates or updates a budget for the org. One budget per (scope, owner); editing re-evaluates against live spend.`,
|
|
17
|
+
Creates or updates a budget for the org. One budget per (scope, owner); editing re-evaluates against live spend. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.`,
|
|
18
18
|
args,
|
|
19
19
|
tool: async (client, args, ctx) => {
|
|
20
20
|
const [result, apiCall] = await budgetsSetOrg(
|
|
@@ -16,8 +16,8 @@ export const QueryParamOwner = {
|
|
|
16
16
|
export type QueryParamOwner = ClosedEnum<typeof QueryParamOwner>;
|
|
17
17
|
|
|
18
18
|
export type DeleteOrgBudgetRequest = {
|
|
19
|
-
orgId: string;
|
|
20
19
|
owner: QueryParamOwner;
|
|
20
|
+
orgId?: string | undefined;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export const DeleteOrgBudgetScope = {
|
|
@@ -57,13 +57,17 @@ export const DeleteOrgBudgetRequest$inboundSchema: z.ZodType<
|
|
|
57
57
|
z.ZodTypeDef,
|
|
58
58
|
unknown
|
|
59
59
|
> = z.object({
|
|
60
|
-
orgId: z.string(),
|
|
61
60
|
owner: QueryParamOwner$inboundSchema,
|
|
61
|
+
org_id: z.string().optional(),
|
|
62
|
+
}).transform((v) => {
|
|
63
|
+
return remap$(v, {
|
|
64
|
+
"org_id": "orgId",
|
|
65
|
+
});
|
|
62
66
|
});
|
|
63
67
|
/** @internal */
|
|
64
68
|
export type DeleteOrgBudgetRequest$Outbound = {
|
|
65
|
-
orgId: string;
|
|
66
69
|
owner: string;
|
|
70
|
+
org_id?: string | undefined;
|
|
67
71
|
};
|
|
68
72
|
|
|
69
73
|
/** @internal */
|
|
@@ -72,8 +76,12 @@ export const DeleteOrgBudgetRequest$outboundSchema: z.ZodType<
|
|
|
72
76
|
z.ZodTypeDef,
|
|
73
77
|
DeleteOrgBudgetRequest
|
|
74
78
|
> = z.object({
|
|
75
|
-
orgId: z.string(),
|
|
76
79
|
owner: QueryParamOwner$outboundSchema,
|
|
80
|
+
orgId: z.string().optional(),
|
|
81
|
+
}).transform((v) => {
|
|
82
|
+
return remap$(v, {
|
|
83
|
+
orgId: "org_id",
|
|
84
|
+
});
|
|
77
85
|
});
|
|
78
86
|
|
|
79
87
|
export function deleteOrgBudgetRequestToJSON(
|
|
@@ -10,7 +10,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
12
|
export type GetOrgBudgetsRequest = {
|
|
13
|
-
orgId
|
|
13
|
+
orgId?: string | undefined;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export const GetOrgBudgetsScope = {
|
|
@@ -90,11 +90,15 @@ export const GetOrgBudgetsRequest$inboundSchema: z.ZodType<
|
|
|
90
90
|
z.ZodTypeDef,
|
|
91
91
|
unknown
|
|
92
92
|
> = z.object({
|
|
93
|
-
|
|
93
|
+
org_id: z.string().optional(),
|
|
94
|
+
}).transform((v) => {
|
|
95
|
+
return remap$(v, {
|
|
96
|
+
"org_id": "orgId",
|
|
97
|
+
});
|
|
94
98
|
});
|
|
95
99
|
/** @internal */
|
|
96
100
|
export type GetOrgBudgetsRequest$Outbound = {
|
|
97
|
-
|
|
101
|
+
org_id?: string | undefined;
|
|
98
102
|
};
|
|
99
103
|
|
|
100
104
|
/** @internal */
|
|
@@ -103,7 +107,11 @@ export const GetOrgBudgetsRequest$outboundSchema: z.ZodType<
|
|
|
103
107
|
z.ZodTypeDef,
|
|
104
108
|
GetOrgBudgetsRequest
|
|
105
109
|
> = z.object({
|
|
106
|
-
orgId: z.string(),
|
|
110
|
+
orgId: z.string().optional(),
|
|
111
|
+
}).transform((v) => {
|
|
112
|
+
return remap$(v, {
|
|
113
|
+
orgId: "org_id",
|
|
114
|
+
});
|
|
107
115
|
});
|
|
108
116
|
|
|
109
117
|
export function getOrgBudgetsRequestToJSON(
|
|
@@ -10,7 +10,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
12
|
export type ListOrgBudgetEventsRequest = {
|
|
13
|
-
orgId
|
|
13
|
+
orgId?: string | undefined;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export const Type = {
|
|
@@ -44,11 +44,15 @@ export const ListOrgBudgetEventsRequest$inboundSchema: z.ZodType<
|
|
|
44
44
|
z.ZodTypeDef,
|
|
45
45
|
unknown
|
|
46
46
|
> = z.object({
|
|
47
|
-
|
|
47
|
+
org_id: z.string().optional(),
|
|
48
|
+
}).transform((v) => {
|
|
49
|
+
return remap$(v, {
|
|
50
|
+
"org_id": "orgId",
|
|
51
|
+
});
|
|
48
52
|
});
|
|
49
53
|
/** @internal */
|
|
50
54
|
export type ListOrgBudgetEventsRequest$Outbound = {
|
|
51
|
-
|
|
55
|
+
org_id?: string | undefined;
|
|
52
56
|
};
|
|
53
57
|
|
|
54
58
|
/** @internal */
|
|
@@ -57,7 +61,11 @@ export const ListOrgBudgetEventsRequest$outboundSchema: z.ZodType<
|
|
|
57
61
|
z.ZodTypeDef,
|
|
58
62
|
ListOrgBudgetEventsRequest
|
|
59
63
|
> = z.object({
|
|
60
|
-
orgId: z.string(),
|
|
64
|
+
orgId: z.string().optional(),
|
|
65
|
+
}).transform((v) => {
|
|
66
|
+
return remap$(v, {
|
|
67
|
+
orgId: "org_id",
|
|
68
|
+
});
|
|
61
69
|
});
|
|
62
70
|
|
|
63
71
|
export function listOrgBudgetEventsRequestToJSON(
|
|
@@ -55,7 +55,7 @@ export type SetOrgBudgetRequestBody = {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
export type SetOrgBudgetRequest = {
|
|
58
|
-
orgId
|
|
58
|
+
orgId?: string | undefined;
|
|
59
59
|
requestBody: SetOrgBudgetRequestBody;
|
|
60
60
|
};
|
|
61
61
|
|
|
@@ -255,16 +255,17 @@ export const SetOrgBudgetRequest$inboundSchema: z.ZodType<
|
|
|
255
255
|
z.ZodTypeDef,
|
|
256
256
|
unknown
|
|
257
257
|
> = z.object({
|
|
258
|
-
|
|
258
|
+
org_id: z.string().optional(),
|
|
259
259
|
RequestBody: z.lazy(() => SetOrgBudgetRequestBody$inboundSchema),
|
|
260
260
|
}).transform((v) => {
|
|
261
261
|
return remap$(v, {
|
|
262
|
+
"org_id": "orgId",
|
|
262
263
|
"RequestBody": "requestBody",
|
|
263
264
|
});
|
|
264
265
|
});
|
|
265
266
|
/** @internal */
|
|
266
267
|
export type SetOrgBudgetRequest$Outbound = {
|
|
267
|
-
|
|
268
|
+
org_id?: string | undefined;
|
|
268
269
|
RequestBody: SetOrgBudgetRequestBody$Outbound;
|
|
269
270
|
};
|
|
270
271
|
|
|
@@ -274,10 +275,11 @@ export const SetOrgBudgetRequest$outboundSchema: z.ZodType<
|
|
|
274
275
|
z.ZodTypeDef,
|
|
275
276
|
SetOrgBudgetRequest
|
|
276
277
|
> = z.object({
|
|
277
|
-
orgId: z.string(),
|
|
278
|
+
orgId: z.string().optional(),
|
|
278
279
|
requestBody: z.lazy(() => SetOrgBudgetRequestBody$outboundSchema),
|
|
279
280
|
}).transform((v) => {
|
|
280
281
|
return remap$(v, {
|
|
282
|
+
orgId: "org_id",
|
|
281
283
|
requestBody: "RequestBody",
|
|
282
284
|
});
|
|
283
285
|
});
|
|
@@ -54,7 +54,7 @@ export type BudgetsApiKeyEventsQueryError =
|
|
|
54
54
|
* List apikey budget events
|
|
55
55
|
*
|
|
56
56
|
* @remarks
|
|
57
|
-
* Returns recent threshold-alert and block events for the
|
|
57
|
+
* Returns recent threshold-alert and block events for the apikey's budgets. Callable by cluster admins, or org admins for API keys in their own organization.
|
|
58
58
|
*/
|
|
59
59
|
export function useBudgetsApiKeyEvents(
|
|
60
60
|
request: operations.ListApiKeyBudgetEventsRequest,
|
|
@@ -78,7 +78,7 @@ export function useBudgetsApiKeyEvents(
|
|
|
78
78
|
* List apikey budget events
|
|
79
79
|
*
|
|
80
80
|
* @remarks
|
|
81
|
-
* Returns recent threshold-alert and block events for the
|
|
81
|
+
* Returns recent threshold-alert and block events for the apikey's budgets. Callable by cluster admins, or org admins for API keys in their own organization.
|
|
82
82
|
*/
|
|
83
83
|
export function useBudgetsApiKeyEventsSuspense(
|
|
84
84
|
request: operations.ListApiKeyBudgetEventsRequest,
|
|
@@ -45,7 +45,7 @@ export type BudgetsDeleteApiKeyMutationError =
|
|
|
45
45
|
| SDKValidationError;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* Delete
|
|
48
|
+
* Delete an apikey budget
|
|
49
49
|
*
|
|
50
50
|
* @remarks
|
|
51
51
|
* Removes the apikey's budget for the given owner; enforcement and alerts stop. Callable by cluster admins, or org admins for API keys in their own organization.
|
|
@@ -45,10 +45,10 @@ export type BudgetsDeleteOrgMutationError =
|
|
|
45
45
|
| SDKValidationError;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* Delete
|
|
48
|
+
* Delete an org budget
|
|
49
49
|
*
|
|
50
50
|
* @remarks
|
|
51
|
-
* Removes the org's budget for the given owner; enforcement and alerts stop.
|
|
51
|
+
* Removes the org's budget for the given owner; enforcement and alerts stop. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.
|
|
52
52
|
*/
|
|
53
53
|
export function useBudgetsDeleteOrgMutation(
|
|
54
54
|
options?: MutationHookOptions<
|
|
@@ -39,7 +39,7 @@ export function buildBudgetsGetOrgQuery(
|
|
|
39
39
|
queryFn: (context: QueryFunctionContext) => Promise<BudgetsGetOrgQueryData>;
|
|
40
40
|
} {
|
|
41
41
|
return {
|
|
42
|
-
queryKey: queryKeyBudgetsGetOrg(request.orgId),
|
|
42
|
+
queryKey: queryKeyBudgetsGetOrg({ orgId: request.orgId }),
|
|
43
43
|
queryFn: async function budgetsGetOrgQueryFn(
|
|
44
44
|
ctx,
|
|
45
45
|
): Promise<BudgetsGetOrgQueryData> {
|
|
@@ -63,6 +63,8 @@ export function buildBudgetsGetOrgQuery(
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export function queryKeyBudgetsGetOrg(
|
|
67
|
-
|
|
66
|
+
export function queryKeyBudgetsGetOrg(
|
|
67
|
+
parameters: { orgId?: string | undefined },
|
|
68
|
+
): QueryKey {
|
|
69
|
+
return ["@meetkai/mka1", "budgets", "getOrg", parameters];
|
|
68
70
|
}
|
|
@@ -54,7 +54,7 @@ export type BudgetsGetOrgQueryError =
|
|
|
54
54
|
* List org budgets
|
|
55
55
|
*
|
|
56
56
|
* @remarks
|
|
57
|
-
* Returns the org's budgets (self-budget and/or ceiling) with each one's live spend gauge.
|
|
57
|
+
* Returns the org's budgets (self-budget and/or ceiling) with each one's live spend gauge. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.
|
|
58
58
|
*/
|
|
59
59
|
export function useBudgetsGetOrg(
|
|
60
60
|
request: operations.GetOrgBudgetsRequest,
|
|
@@ -75,7 +75,7 @@ export function useBudgetsGetOrg(
|
|
|
75
75
|
* List org budgets
|
|
76
76
|
*
|
|
77
77
|
* @remarks
|
|
78
|
-
* Returns the org's budgets (self-budget and/or ceiling) with each one's live spend gauge.
|
|
78
|
+
* Returns the org's budgets (self-budget and/or ceiling) with each one's live spend gauge. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.
|
|
79
79
|
*/
|
|
80
80
|
export function useBudgetsGetOrgSuspense(
|
|
81
81
|
request: operations.GetOrgBudgetsRequest,
|
|
@@ -97,7 +97,7 @@ export function useBudgetsGetOrgSuspense(
|
|
|
97
97
|
|
|
98
98
|
export function setBudgetsGetOrgData(
|
|
99
99
|
client: QueryClient,
|
|
100
|
-
queryKeyBase: [
|
|
100
|
+
queryKeyBase: [parameters: { orgId?: string | undefined }],
|
|
101
101
|
data: BudgetsGetOrgQueryData,
|
|
102
102
|
): BudgetsGetOrgQueryData | undefined {
|
|
103
103
|
const key = queryKeyBudgetsGetOrg(...queryKeyBase);
|
|
@@ -107,7 +107,7 @@ export function setBudgetsGetOrgData(
|
|
|
107
107
|
|
|
108
108
|
export function invalidateBudgetsGetOrg(
|
|
109
109
|
client: QueryClient,
|
|
110
|
-
queryKeyBase: TupleToPrefixes<[
|
|
110
|
+
queryKeyBase: TupleToPrefixes<[parameters: { orgId?: string | undefined }]>,
|
|
111
111
|
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
112
112
|
): Promise<void> {
|
|
113
113
|
return client.invalidateQueries({
|
|
@@ -42,7 +42,7 @@ export function buildBudgetsOrgEventsQuery(
|
|
|
42
42
|
) => Promise<BudgetsOrgEventsQueryData>;
|
|
43
43
|
} {
|
|
44
44
|
return {
|
|
45
|
-
queryKey: queryKeyBudgetsOrgEvents(request.orgId),
|
|
45
|
+
queryKey: queryKeyBudgetsOrgEvents({ orgId: request.orgId }),
|
|
46
46
|
queryFn: async function budgetsOrgEventsQueryFn(
|
|
47
47
|
ctx,
|
|
48
48
|
): Promise<BudgetsOrgEventsQueryData> {
|
|
@@ -66,6 +66,8 @@ export function buildBudgetsOrgEventsQuery(
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
export function queryKeyBudgetsOrgEvents(
|
|
70
|
-
|
|
69
|
+
export function queryKeyBudgetsOrgEvents(
|
|
70
|
+
parameters: { orgId?: string | undefined },
|
|
71
|
+
): QueryKey {
|
|
72
|
+
return ["@meetkai/mka1", "budgets", "orgEvents", parameters];
|
|
71
73
|
}
|
|
@@ -54,7 +54,7 @@ export type BudgetsOrgEventsQueryError =
|
|
|
54
54
|
* List org budget events
|
|
55
55
|
*
|
|
56
56
|
* @remarks
|
|
57
|
-
* Returns recent threshold-alert and block events for the
|
|
57
|
+
* Returns recent threshold-alert and block events for the org's budgets. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.
|
|
58
58
|
*/
|
|
59
59
|
export function useBudgetsOrgEvents(
|
|
60
60
|
request: operations.ListOrgBudgetEventsRequest,
|
|
@@ -78,7 +78,7 @@ export function useBudgetsOrgEvents(
|
|
|
78
78
|
* List org budget events
|
|
79
79
|
*
|
|
80
80
|
* @remarks
|
|
81
|
-
* Returns recent threshold-alert and block events for the
|
|
81
|
+
* Returns recent threshold-alert and block events for the org's budgets. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.
|
|
82
82
|
*/
|
|
83
83
|
export function useBudgetsOrgEventsSuspense(
|
|
84
84
|
request: operations.ListOrgBudgetEventsRequest,
|
|
@@ -103,7 +103,7 @@ export function useBudgetsOrgEventsSuspense(
|
|
|
103
103
|
|
|
104
104
|
export function setBudgetsOrgEventsData(
|
|
105
105
|
client: QueryClient,
|
|
106
|
-
queryKeyBase: [
|
|
106
|
+
queryKeyBase: [parameters: { orgId?: string | undefined }],
|
|
107
107
|
data: BudgetsOrgEventsQueryData,
|
|
108
108
|
): BudgetsOrgEventsQueryData | undefined {
|
|
109
109
|
const key = queryKeyBudgetsOrgEvents(...queryKeyBase);
|
|
@@ -113,7 +113,7 @@ export function setBudgetsOrgEventsData(
|
|
|
113
113
|
|
|
114
114
|
export function invalidateBudgetsOrgEvents(
|
|
115
115
|
client: QueryClient,
|
|
116
|
-
queryKeyBase: TupleToPrefixes<[
|
|
116
|
+
queryKeyBase: TupleToPrefixes<[parameters: { orgId?: string | undefined }]>,
|
|
117
117
|
filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
|
|
118
118
|
): Promise<void> {
|
|
119
119
|
return client.invalidateQueries({
|
|
@@ -45,7 +45,7 @@ export type BudgetsSetApiKeyMutationError =
|
|
|
45
45
|
| SDKValidationError;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* Set
|
|
48
|
+
* Set an apikey budget
|
|
49
49
|
*
|
|
50
50
|
* @remarks
|
|
51
51
|
* Creates or updates a budget for the apikey. One budget per (scope, owner); editing re-evaluates against live spend. Callable by cluster admins, or org admins for API keys in their own organization.
|
|
@@ -44,10 +44,10 @@ export type BudgetsSetOrgMutationError =
|
|
|
44
44
|
| SDKValidationError;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* Set
|
|
47
|
+
* Set an org budget
|
|
48
48
|
*
|
|
49
49
|
* @remarks
|
|
50
|
-
* Creates or updates a budget for the org. One budget per (scope, owner); editing re-evaluates against live spend.
|
|
50
|
+
* Creates or updates a budget for the org. One budget per (scope, owner); editing re-evaluates against live spend. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.
|
|
51
51
|
*/
|
|
52
52
|
export function useBudgetsSetOrgMutation(
|
|
53
53
|
options?: MutationHookOptions<
|
package/src/sdk/budgets.ts
CHANGED
|
@@ -37,7 +37,7 @@ export class Budgets extends ClientSDK {
|
|
|
37
37
|
* List org budgets
|
|
38
38
|
*
|
|
39
39
|
* @remarks
|
|
40
|
-
* Returns the org's budgets (self-budget and/or ceiling) with each one's live spend gauge.
|
|
40
|
+
* Returns the org's budgets (self-budget and/or ceiling) with each one's live spend gauge. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.
|
|
41
41
|
*/
|
|
42
42
|
async getOrg(
|
|
43
43
|
request: operations.GetOrgBudgetsRequest,
|
|
@@ -51,10 +51,10 @@ export class Budgets extends ClientSDK {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
* Set
|
|
54
|
+
* Set an org budget
|
|
55
55
|
*
|
|
56
56
|
* @remarks
|
|
57
|
-
* Creates or updates a budget for the org. One budget per (scope, owner); editing re-evaluates against live spend.
|
|
57
|
+
* Creates or updates a budget for the org. One budget per (scope, owner); editing re-evaluates against live spend. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.
|
|
58
58
|
*/
|
|
59
59
|
async setOrg(
|
|
60
60
|
request: operations.SetOrgBudgetRequest,
|
|
@@ -68,10 +68,10 @@ export class Budgets extends ClientSDK {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
|
-
* Delete
|
|
71
|
+
* Delete an org budget
|
|
72
72
|
*
|
|
73
73
|
* @remarks
|
|
74
|
-
* Removes the org's budget for the given owner; enforcement and alerts stop.
|
|
74
|
+
* Removes the org's budget for the given owner; enforcement and alerts stop. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.
|
|
75
75
|
*/
|
|
76
76
|
async deleteOrg(
|
|
77
77
|
request: operations.DeleteOrgBudgetRequest,
|
|
@@ -88,7 +88,7 @@ export class Budgets extends ClientSDK {
|
|
|
88
88
|
* List org budget events
|
|
89
89
|
*
|
|
90
90
|
* @remarks
|
|
91
|
-
* Returns recent threshold-alert and block events for the
|
|
91
|
+
* Returns recent threshold-alert and block events for the org's budgets. Targets the caller's own organization (inferred from the API key or session) unless the optional org_id query parameter names another org — cluster admins only.
|
|
92
92
|
*/
|
|
93
93
|
async orgEvents(
|
|
94
94
|
request: operations.ListOrgBudgetEventsRequest,
|
|
@@ -119,7 +119,7 @@ export class Budgets extends ClientSDK {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
|
-
* Set
|
|
122
|
+
* Set an apikey budget
|
|
123
123
|
*
|
|
124
124
|
* @remarks
|
|
125
125
|
* Creates or updates a budget for the apikey. One budget per (scope, owner); editing re-evaluates against live spend. Callable by cluster admins, or org admins for API keys in their own organization.
|
|
@@ -136,7 +136,7 @@ export class Budgets extends ClientSDK {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
|
-
* Delete
|
|
139
|
+
* Delete an apikey budget
|
|
140
140
|
*
|
|
141
141
|
* @remarks
|
|
142
142
|
* Removes the apikey's budget for the given owner; enforcement and alerts stop. Callable by cluster admins, or org admins for API keys in their own organization.
|
|
@@ -156,7 +156,7 @@ export class Budgets extends ClientSDK {
|
|
|
156
156
|
* List apikey budget events
|
|
157
157
|
*
|
|
158
158
|
* @remarks
|
|
159
|
-
* Returns recent threshold-alert and block events for the
|
|
159
|
+
* Returns recent threshold-alert and block events for the apikey's budgets. Callable by cluster admins, or org admins for API keys in their own organization.
|
|
160
160
|
*/
|
|
161
161
|
async apiKeyEvents(
|
|
162
162
|
request: operations.ListApiKeyBudgetEventsRequest,
|