@iblai/data-layer 1.38.1 → 1.38.2
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/index.d.ts +1654 -131
- package/dist/index.esm.js +125 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +134 -2
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/features/spend-caps/api-slice.d.ts +1564 -128
- package/dist/src/features/spend-caps/constants.d.ts +31 -0
- package/dist/src/features/spend-caps/types.d.ts +48 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -51,6 +51,34 @@ export declare const SPEND_CAPS_ENDPOINTS: {
|
|
|
51
51
|
service: SERVICES;
|
|
52
52
|
path: (org: string, mentorId: string, username: string) => string;
|
|
53
53
|
};
|
|
54
|
+
LIST_TENANT_USER_SPEND_CAPS: {
|
|
55
|
+
service: SERVICES;
|
|
56
|
+
path: (org: string) => string;
|
|
57
|
+
};
|
|
58
|
+
GET_TENANT_USER_SPEND_CAP: {
|
|
59
|
+
service: SERVICES;
|
|
60
|
+
path: (org: string, username: string) => string;
|
|
61
|
+
};
|
|
62
|
+
UPSERT_TENANT_USER_SPEND_CAP: {
|
|
63
|
+
service: SERVICES;
|
|
64
|
+
path: (org: string, username: string) => string;
|
|
65
|
+
};
|
|
66
|
+
DELETE_TENANT_USER_SPEND_CAP: {
|
|
67
|
+
service: SERVICES;
|
|
68
|
+
path: (org: string, username: string) => string;
|
|
69
|
+
};
|
|
70
|
+
GET_NEW_USER_SPEND_CAP_DEFAULT: {
|
|
71
|
+
service: SERVICES;
|
|
72
|
+
path: (org: string) => string;
|
|
73
|
+
};
|
|
74
|
+
UPSERT_NEW_USER_SPEND_CAP_DEFAULT: {
|
|
75
|
+
service: SERVICES;
|
|
76
|
+
path: (org: string) => string;
|
|
77
|
+
};
|
|
78
|
+
DELETE_NEW_USER_SPEND_CAP_DEFAULT: {
|
|
79
|
+
service: SERVICES;
|
|
80
|
+
path: (org: string) => string;
|
|
81
|
+
};
|
|
54
82
|
GET_SPEND_CAP_STATUS: {
|
|
55
83
|
service: SERVICES;
|
|
56
84
|
path: (org: string, userId: string) => string;
|
|
@@ -62,5 +90,8 @@ export declare const SPEND_CAPS_QUERY_KEYS: {
|
|
|
62
90
|
readonly AGENT_SPEND_CAPS_LIST: "AGENT_SPEND_CAPS_LIST";
|
|
63
91
|
readonly AGENT_USER_SPEND_CAPS: "AGENT_USER_SPEND_CAPS";
|
|
64
92
|
readonly USER_SPEND_CAP: "USER_SPEND_CAP";
|
|
93
|
+
readonly TENANT_USER_SPEND_CAPS: "TENANT_USER_SPEND_CAPS";
|
|
94
|
+
readonly TENANT_USER_SPEND_CAP: "TENANT_USER_SPEND_CAP";
|
|
95
|
+
readonly NEW_USER_SPEND_CAP_DEFAULT: "NEW_USER_SPEND_CAP_DEFAULT";
|
|
65
96
|
readonly SPEND_CAP_STATUS: "SPEND_CAP_STATUS";
|
|
66
97
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SPEND_CAP_EXCEEDED_ERROR_CODE } from './constants';
|
|
2
|
-
export type SpendCapScope = 'tenant' | 'agent' | 'user_agent';
|
|
2
|
+
export type SpendCapScope = 'tenant' | 'agent' | 'user_agent' | 'user';
|
|
3
3
|
export type SpendCapIntervalType = 'day' | 'week' | 'month' | 'year';
|
|
4
4
|
export type SpendCapEnforcement = 'block' | 'alert_only';
|
|
5
5
|
export interface SpendCap {
|
|
@@ -10,8 +10,10 @@ export interface SpendCap {
|
|
|
10
10
|
/** Agent display name — present on agent-scoped caps from the list endpoint. */
|
|
11
11
|
mentor_name?: string | null;
|
|
12
12
|
username: string | null;
|
|
13
|
-
/** User email — present on user-per-agent caps. */
|
|
13
|
+
/** User email — present on user-per-agent and user caps. */
|
|
14
14
|
email?: string | null;
|
|
15
|
+
/** User display name (iblai-platform#2531) — present on user-per-agent and user caps. */
|
|
16
|
+
user_full_name?: string | null;
|
|
15
17
|
interval_type: SpendCapIntervalType;
|
|
16
18
|
max_cost_usd: string;
|
|
17
19
|
enforcement: SpendCapEnforcement;
|
|
@@ -32,6 +34,21 @@ export interface SpendCapUpsertRequest {
|
|
|
32
34
|
alert_thresholds?: number[];
|
|
33
35
|
enabled?: boolean;
|
|
34
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Tenant default applied to each member when they join (iblai-platform#2513).
|
|
39
|
+
* A template stored in platform configuration, not a cap row: GET always
|
|
40
|
+
* returns 200 (`enabled: false` is "off"), PUT is a full replace, and editing
|
|
41
|
+
* it never touches the per-user rows it already created.
|
|
42
|
+
*/
|
|
43
|
+
export interface NewUserSpendCapDefault {
|
|
44
|
+
enabled: boolean;
|
|
45
|
+
interval_type: SpendCapIntervalType;
|
|
46
|
+
/** Decimal string; null while the default is off. Required when enabled. */
|
|
47
|
+
max_cost_usd: string | null;
|
|
48
|
+
enforcement: SpendCapEnforcement;
|
|
49
|
+
alert_thresholds: number[];
|
|
50
|
+
}
|
|
51
|
+
export type NewUserSpendCapDefaultUpsertRequest = NewUserSpendCapDefault;
|
|
35
52
|
export type SpendCapStatusZone = 'ok' | 'warning' | 'exceeded';
|
|
36
53
|
export interface SpendCapStatusItem {
|
|
37
54
|
scope: SpendCapScope;
|
|
@@ -108,6 +125,35 @@ export type DeleteUserSpendCapArgs = {
|
|
|
108
125
|
mentorId: string;
|
|
109
126
|
username: string;
|
|
110
127
|
};
|
|
128
|
+
export type ListTenantUserSpendCapsArgs = {
|
|
129
|
+
org: string;
|
|
130
|
+
/** Optional exact-match filters supported by the endpoint. */
|
|
131
|
+
username?: string;
|
|
132
|
+
email?: string;
|
|
133
|
+
};
|
|
134
|
+
export type GetTenantUserSpendCapArgs = {
|
|
135
|
+
org: string;
|
|
136
|
+
username: string;
|
|
137
|
+
};
|
|
138
|
+
export type UpsertTenantUserSpendCapArgs = {
|
|
139
|
+
org: string;
|
|
140
|
+
username: string;
|
|
141
|
+
formData: SpendCapUpsertRequest;
|
|
142
|
+
};
|
|
143
|
+
export type DeleteTenantUserSpendCapArgs = {
|
|
144
|
+
org: string;
|
|
145
|
+
username: string;
|
|
146
|
+
};
|
|
147
|
+
export type GetNewUserSpendCapDefaultArgs = {
|
|
148
|
+
org: string;
|
|
149
|
+
};
|
|
150
|
+
export type UpsertNewUserSpendCapDefaultArgs = {
|
|
151
|
+
org: string;
|
|
152
|
+
formData: NewUserSpendCapDefaultUpsertRequest;
|
|
153
|
+
};
|
|
154
|
+
export type DeleteNewUserSpendCapDefaultArgs = {
|
|
155
|
+
org: string;
|
|
156
|
+
};
|
|
111
157
|
export type GetSpendCapStatusArgs = {
|
|
112
158
|
org: string;
|
|
113
159
|
userId: string;
|