gentiq 0.7.32 → 0.8.0

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.
@@ -11,6 +11,17 @@ export interface Admin {
11
11
  name: string;
12
12
  permissions: string[];
13
13
  }
14
+ export type RechargeIntervalUnit = 'minute' | 'hour' | 'day' | 'week' | 'month';
15
+ export interface RechargePolicyInput {
16
+ enabled: boolean;
17
+ interval_value?: number;
18
+ interval_unit?: RechargeIntervalUnit;
19
+ anchor_at?: string;
20
+ }
21
+ export interface RechargePolicy extends RechargePolicyInput {
22
+ next_recharge_at?: string | null;
23
+ last_recharged_at?: string | null;
24
+ }
14
25
  export interface User {
15
26
  id: string;
16
27
  phone: string;
@@ -24,6 +35,17 @@ export interface User {
24
35
  token_limit: number;
25
36
  request_limit: number;
26
37
  };
38
+ recharge_policy?: RechargePolicy | null;
39
+ }
40
+ export interface UserUsageSummary {
41
+ input_tokens: number;
42
+ output_tokens: number;
43
+ total_tokens: number;
44
+ requests: number;
45
+ total_cost_microunits: number;
46
+ unpriced_requests: number;
47
+ renewal_count: number;
48
+ currency: string;
27
49
  }
28
50
  export interface AdminRegisterResponse {
29
51
  admin_id: string;
@@ -107,20 +129,25 @@ export declare class AdminAPI {
107
129
  share_id: string;
108
130
  url: string;
109
131
  }>;
110
- listUsers(skip?: number, limit?: number, query?: string): Promise<{
132
+ listUsers(skip?: number, limit?: number, query?: string, sortBy?: 'phone' | 'name' | 'surname', sortOrder?: 'asc' | 'desc'): Promise<{
111
133
  users: User[];
112
134
  count: number;
113
135
  }>;
114
- createUser(phone: string, name: string, surname: string, tokens?: number, requests?: number, token_limit?: number, request_limit?: number, metadata?: Record<string, any>): Promise<any>;
136
+ createUser(phone: string, name: string, surname: string, tokens?: number, requests?: number, token_limit?: number, request_limit?: number, metadata?: Record<string, any>, recharge_policy?: RechargePolicyInput): Promise<any>;
115
137
  updateUser(userId: string, data: {
116
138
  phone?: string;
117
139
  name?: string;
118
140
  surname?: string;
119
141
  metadata?: Record<string, any>;
120
- }): Promise<any>;
142
+ recharge_policy?: RechargePolicyInput;
143
+ }): Promise<{
144
+ status: string;
145
+ user: User;
146
+ }>;
121
147
  deleteUser(userId: string): Promise<any>;
122
148
  updateUserBalance(userId: string, tokens: number, requests: number, token_limit?: number, request_limit?: number): Promise<any>;
123
149
  refreshUserToken(userId: string): Promise<any>;
150
+ getUserUsageSummary(userId: string): Promise<UserUsageSummary>;
124
151
  getAnalytics(days?: number): Promise<any>;
125
152
  listJobs(limit?: number, type?: string): Promise<{
126
153
  jobs: Job[];
@@ -0,0 +1,2 @@
1
+ export declare function formatMicrounits(microunits: number, currency: string, locale: string): string;
2
+ export declare function formatMicrounitsCompact(microunits: number, currency: string, locale: string): string;
@@ -10,7 +10,10 @@ export declare function useAdminUsersMutations(): {
10
10
  tokens?: number;
11
11
  requests?: number;
12
12
  }, unknown>;
13
- updateUser: import('@tanstack/react-query').UseMutationResult<any, Error, {
13
+ updateUser: import('@tanstack/react-query').UseMutationResult<{
14
+ status: string;
15
+ user: import('../admin/lib/api').User;
16
+ }, Error, {
14
17
  userId: string;
15
18
  data: {
16
19
  phone?: string;
@@ -197,6 +197,10 @@ declare const _default: {
197
197
  "total_threads": "Total Threads",
198
198
  "total_messages": "Total Messages",
199
199
  "total_token_usage": "Total Token Usage",
200
+ "usage_cost": "Usage & Cost",
201
+ "input": "Input",
202
+ "output": "Output",
203
+ "cost": "Cost",
200
204
  "threads_chart": "Threads",
201
205
  "messages_chart": "Messages",
202
206
  "token_usage_chart": "Token Usage",
@@ -229,6 +233,8 @@ declare const _default: {
229
233
  "input_tokens": "Input: {{value}}",
230
234
  "output_tokens": "Output: {{value}}",
231
235
  "total_tokens": "Total: {{value}}",
236
+ "cost": "Cost: {{value}}",
237
+ "unpriced": "Unpriced",
232
238
  "all_feedbacks": "All Conversations",
233
239
  "liked_feedbacks": "Liked 👍",
234
240
  "disliked_feedbacks": "Disliked 👎",
@@ -268,6 +274,8 @@ declare const _default: {
268
274
  "request_count": "Request Count",
269
275
  "updating": "Updating...",
270
276
  "no_users": "No users found.",
277
+ "sort_ascending": "Sort ascending",
278
+ "sort_descending": "Sort descending",
271
279
  "confirm_delete_user": "Are you sure you want to delete this user?",
272
280
  "tokens_exceed_limit": "Tokens cannot exceed the specified limit",
273
281
  "requests_exceed_limit": "Requests cannot exceed the specified limit",
@@ -277,6 +285,30 @@ declare const _default: {
277
285
  "metadata_raw": "Metadata (Raw JSON)",
278
286
  "advanced_usage": "Advanced usage",
279
287
  "invalid_json": "Invalid JSON format"
288
+ ,"auto_recharge": "Automatic Balance Renewal"
289
+ ,"auto_recharge_help": "Restore this user's balance to its limits on a recurring schedule."
290
+ ,"enabled": "Enabled"
291
+ ,"recharge_interval": "Every"
292
+ ,"recharge_unit": "Interval Unit"
293
+ ,"recharge_unit_minute": "Minute(s)"
294
+ ,"recharge_unit_hour": "Hour(s)"
295
+ ,"recharge_unit_day": "Day(s)"
296
+ ,"recharge_unit_week": "Week(s)"
297
+ ,"recharge_unit_month": "Month(s)"
298
+ ,"recharge_schedule_help": "New schedules begin when saved. Existing schedules keep their current cycle anchor."
299
+ ,"next_recharge": "Next renewal"
300
+ ,"last_recharge": "Last automatic renewal"
301
+ ,"not_available": "Not available"
302
+ ,"recharge_interval_invalid": "The renewal interval must be a positive whole number"
303
+ ,"recharge_policy_not_saved": "The backend did not save the renewal policy. Restart or update the backend to the version that supports automatic renewal."
304
+ ,"usage_summary": "Usage Summary"
305
+ ,"input_tokens": "Input Tokens"
306
+ ,"output_tokens": "Output Tokens"
307
+ ,"total_tokens": "Total Tokens"
308
+ ,"requests_made": "Requests Made"
309
+ ,"total_cost": "Total Cost"
310
+ ,"renewals": "Balance Renewals"
311
+ ,"unpriced_requests": "Unpriced Requests"
280
312
  },
281
313
  "admins": {
282
314
  "title": "Admin Management",
@@ -196,6 +196,10 @@ declare const _default: {
196
196
  "total_threads": "تعداد گفتگوها",
197
197
  "total_messages": "تعداد پیام‌ها",
198
198
  "total_token_usage": "مصرف کل توکن",
199
+ "usage_cost": "مصرف و هزینه",
200
+ "input": "ورودی",
201
+ "output": "خروجی",
202
+ "cost": "هزینه",
199
203
  "threads_chart": "گفتگوها",
200
204
  "messages_chart": "پیام‌ها",
201
205
  "token_usage_chart": "مصرف توکن",
@@ -228,6 +232,8 @@ declare const _default: {
228
232
  "input_tokens": "ورودی: {{value}}",
229
233
  "output_tokens": "خروجی: {{value}}",
230
234
  "total_tokens": "کل: {{value}}",
235
+ "cost": "هزینه: {{value}}",
236
+ "unpriced": "بدون هزینه",
231
237
  "all_feedbacks": "همه گفتگوها",
232
238
  "liked_feedbacks": "پسندیده شده 👍",
233
239
  "disliked_feedbacks": "نپسندیده شده 👎",
@@ -267,6 +273,8 @@ declare const _default: {
267
273
  "request_count": "تعداد درخواست",
268
274
  "updating": "در حال بروزرسانی...",
269
275
  "no_users": "هیچ کاربری یافت نشد.",
276
+ "sort_ascending": "مرتب‌سازی صعودی",
277
+ "sort_descending": "مرتب‌سازی نزولی",
270
278
  "confirm_delete_user": "آیا از حذف این کاربر اطمینان دارید؟",
271
279
  "tokens_exceed_limit": "تعداد توکن نمی‌تواند بیشتر از سقف مجاز باشد",
272
280
  "requests_exceed_limit": "تعداد درخواست نمی‌تواند بیشتر از سقف مجاز باشد",
@@ -276,6 +284,30 @@ declare const _default: {
276
284
  "metadata_raw": "متادیتا (JSON خام)",
277
285
  "advanced_usage": "استفاده پیشرفته",
278
286
  "invalid_json": "فرمت JSON نامعتبر است"
287
+ ,"auto_recharge": "تمدید خودکار موجودی"
288
+ ,"auto_recharge_help": "موجودی این کاربر را طبق یک برنامه تکرارشونده تا سقف تعیین‌شده بازنشانی می‌کند."
289
+ ,"enabled": "فعال"
290
+ ,"recharge_interval": "هر"
291
+ ,"recharge_unit": "واحد بازه"
292
+ ,"recharge_unit_minute": "دقیقه"
293
+ ,"recharge_unit_hour": "ساعت"
294
+ ,"recharge_unit_day": "روز"
295
+ ,"recharge_unit_week": "هفته"
296
+ ,"recharge_unit_month": "ماه"
297
+ ,"recharge_schedule_help": "برنامه جدید از زمان ذخیره آغاز می‌شود. برنامه موجود مبدأ دوره فعلی خود را حفظ می‌کند."
298
+ ,"next_recharge": "تمدید بعدی"
299
+ ,"last_recharge": "آخرین تمدید خودکار"
300
+ ,"not_available": "در دسترس نیست"
301
+ ,"recharge_interval_invalid": "بازه تمدید باید یک عدد صحیح مثبت باشد"
302
+ ,"recharge_policy_not_saved": "سرور تنظیمات تمدید خودکار را ذخیره نکرد. سرور را راه‌اندازی مجدد یا به نسخه پشتیبان‌کننده از تمدید خودکار بروزرسانی کنید."
303
+ ,"usage_summary": "خلاصه مصرف"
304
+ ,"input_tokens": "توکن‌های ورودی"
305
+ ,"output_tokens": "توکن‌های خروجی"
306
+ ,"total_tokens": "کل توکن‌ها"
307
+ ,"requests_made": "تعداد درخواست‌ها"
308
+ ,"total_cost": "هزینه کل"
309
+ ,"renewals": "دفعات شارژ موجودی"
310
+ ,"unpriced_requests": "درخواست‌های بدون هزینه‌ی ثبت شده"
279
311
  },
280
312
  "admins": {
281
313
  "title": "مدیریت ادمین‌ها",
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "provenance": true
11
11
  },
12
12
  "description": "React UI library for the Gentiq AI framework.",
13
- "version": "0.7.32",
13
+ "version": "0.8.0",
14
14
  "type": "module",
15
15
  "files": [
16
16
  "dist"