@xpert-ai/contracts 3.15.18 → 3.17.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.
Files changed (83) hide show
  1. package/index.cjs.js +301 -472
  2. package/index.esm.js +270 -465
  3. package/package.json +1 -1
  4. package/src/agent/ai-model.d.ts +4 -1
  5. package/src/agent/graph.d.ts +2 -0
  6. package/src/ai/ai-model.model.d.ts +2 -1
  7. package/src/ai/assistant-binding.model.d.ts +0 -1
  8. package/src/ai/evolution/candidate.d.ts +67 -0
  9. package/src/ai/evolution/capability-version.d.ts +45 -0
  10. package/src/ai/evolution/evaluation.d.ts +93 -0
  11. package/src/ai/evolution/example.d.ts +42 -0
  12. package/src/ai/evolution/experience.d.ts +21 -0
  13. package/src/ai/evolution/governance.d.ts +87 -0
  14. package/src/ai/evolution/index.d.ts +11 -0
  15. package/src/ai/evolution/learning-event.d.ts +69 -0
  16. package/src/ai/evolution/provider.d.ts +30 -0
  17. package/src/ai/evolution/release.d.ts +144 -0
  18. package/src/ai/evolution/runtime.d.ts +81 -0
  19. package/src/ai/evolution/target.d.ts +83 -0
  20. package/src/ai/feature.model.d.ts +3 -1
  21. package/src/ai/index.d.ts +5 -0
  22. package/src/ai/knowledge-doc-chunk.model.d.ts +143 -0
  23. package/src/ai/knowledge-doc.model.d.ts +53 -4
  24. package/src/ai/knowledge-filter.model.d.ts +92 -0
  25. package/src/ai/knowledge-retrieval-log.model.d.ts +18 -2
  26. package/src/ai/knowledgebase-task.model.d.ts +3 -1
  27. package/src/ai/knowledgebase.model.d.ts +6 -0
  28. package/src/ai/membership.model.d.ts +224 -7
  29. package/src/ai/model-access.model.d.ts +229 -0
  30. package/src/ai/model-gateway.model.d.ts +164 -0
  31. package/src/ai/model-usage.model.d.ts +163 -0
  32. package/src/ai/role-permissions.d.ts +11 -1
  33. package/src/ai/sandbox-terminal.model.d.ts +4 -0
  34. package/src/ai/xpert-agent-execution.model.d.ts +2 -0
  35. package/src/ai/xpert.model.d.ts +31 -11
  36. package/src/{analytics/data-source-type.d.ts → data-source-type.model.d.ts} +1 -1
  37. package/src/{analytics/data-source.d.ts → data-source.model.d.ts} +4 -7
  38. package/src/feature.model.d.ts +3 -1
  39. package/src/index.d.ts +4 -1
  40. package/src/plugin.d.ts +4 -0
  41. package/src/referral.model.d.ts +36 -0
  42. package/src/role-permission.model.d.ts +5 -3
  43. package/src/role.model.d.ts +0 -1
  44. package/src/tenant.model.d.ts +5 -0
  45. package/src/user.model.d.ts +1 -0
  46. package/src/utils.d.ts +5 -0
  47. package/src/view-extension/model.d.ts +12 -1
  48. package/src/analytics/ai.d.ts +0 -73
  49. package/src/analytics/approval-policy.model.d.ts +0 -30
  50. package/src/analytics/business-area-user.model.d.ts +0 -35
  51. package/src/analytics/business-area.d.ts +0 -17
  52. package/src/analytics/certification.model.d.ts +0 -11
  53. package/src/analytics/chatbi-conversation.model.d.ts +0 -15
  54. package/src/analytics/chatbi-model.model.d.ts +0 -18
  55. package/src/analytics/collection.model.d.ts +0 -6
  56. package/src/analytics/comment.model.d.ts +0 -10
  57. package/src/analytics/favorite.d.ts +0 -14
  58. package/src/analytics/features.d.ts +0 -23
  59. package/src/analytics/feed-model.d.ts +0 -13
  60. package/src/analytics/gateway.d.ts +0 -28
  61. package/src/analytics/index.d.ts +0 -38
  62. package/src/analytics/indicator-app.d.ts +0 -44
  63. package/src/analytics/indicator-market.d.ts +0 -4
  64. package/src/analytics/indicator.d.ts +0 -105
  65. package/src/analytics/model-query-log.model.d.ts +0 -41
  66. package/src/analytics/model-query.d.ts +0 -21
  67. package/src/analytics/notification-destination.d.ts +0 -10
  68. package/src/analytics/permission-approval-user.model.d.ts +0 -10
  69. package/src/analytics/permission-approval.model.d.ts +0 -47
  70. package/src/analytics/project.model.d.ts +0 -50
  71. package/src/analytics/role-permissions.d.ts +0 -28
  72. package/src/analytics/schema.d.ts +0 -262
  73. package/src/analytics/screenshot.model.d.ts +0 -24
  74. package/src/analytics/semantic-model-entity.d.ts +0 -38
  75. package/src/analytics/semantic-model-member.d.ts +0 -27
  76. package/src/analytics/semantic-model.d.ts +0 -183
  77. package/src/analytics/story-point.d.ts +0 -11
  78. package/src/analytics/story-template.model.d.ts +0 -28
  79. package/src/analytics/story-widget.d.ts +0 -12
  80. package/src/analytics/story.d.ts +0 -93
  81. package/src/analytics/subscription.d.ts +0 -38
  82. package/src/analytics/visit.model.d.ts +0 -34
  83. package/src/analytics/webSocket.d.ts +0 -48
@@ -1,5 +1,9 @@
1
1
  import { IBasePerTenantAndOrganizationEntityModel, IBasePerTenantEntityModel } from '../base-entity.model';
2
2
  import { IUser } from '../user.model';
3
+ import { AiModelTypeEnum } from '../agent';
4
+ import { ModelAccessSourceEnum } from './model-access.model';
5
+ import { ModelGatewayUsageChannelEnum } from './model-gateway.model';
6
+ import type { ModelUsageMetric, ModelUsageLedgerModality, ModelUsageLedgerOperation, ModelUsageOriginType, ModelUsagePriceRule, ModelUsagePricingStatus } from './model-usage.model';
3
7
  export declare enum MembershipPlanStatusEnum {
4
8
  Active = "active",
5
9
  Archived = "archived"
@@ -12,20 +16,61 @@ export declare enum MembershipStatusEnum {
12
16
  Paused = "paused",
13
17
  Expired = "expired"
14
18
  }
15
- export declare const MEMBERSHIP_TOKENS_PER_POINT_OPTIONS: readonly [1000, 10000, 100000, 1000000];
19
+ export declare enum MembershipSourceEnum {
20
+ TenantDefault = "tenant_default",
21
+ Organization = "organization",
22
+ Admin = "admin",
23
+ External = "external"
24
+ }
25
+ export declare enum MembershipRenewalModeEnum {
26
+ Auto = "auto",
27
+ Manual = "manual"
28
+ }
29
+ export declare enum MembershipPeriodStatusEnum {
30
+ Scheduled = "scheduled",
31
+ RefundPending = "refund_pending",
32
+ Active = "active",
33
+ Completed = "completed",
34
+ Cancelled = "cancelled"
35
+ }
36
+ export declare const DEFAULT_MEMBERSHIP_CNY_PER_POINT = 0.1;
37
+ export declare const MEMBERSHIP_CNY_PER_POINT_SETTING = "membershipCnyPerPoint";
16
38
  export declare enum MembershipLedgerSourceEnum {
17
39
  Assignment = "assignment",
18
40
  Grant = "grant",
19
41
  Renew = "renew",
42
+ Upgrade = "upgrade",
20
43
  Usage = "usage",
21
- Adjustment = "adjustment"
44
+ Adjustment = "adjustment",
45
+ StatusChange = "status_change",
46
+ PersonalAdjustment = "personal_adjustment",
47
+ PersonalUsage = "personal_usage",
48
+ ModelUsage = "model_usage"
49
+ }
50
+ export declare enum MembershipAdminUserStatusEnum {
51
+ Active = "active",
52
+ Paused = "paused",
53
+ Expired = "expired",
54
+ Unassigned = "unassigned"
55
+ }
56
+ export declare enum MembershipBulkActionEnum {
57
+ Assign = "assign",
58
+ Renew = "renew",
59
+ Pause = "pause",
60
+ Resume = "resume",
61
+ Revoke = "revoke"
22
62
  }
23
63
  export type TMembershipRateLimitPeriod = 'hour' | 'day' | 'week' | 'cycle';
24
64
  export interface IMembershipModelMultiplier {
25
65
  provider?: string | null;
26
66
  model?: string | null;
67
+ /** Applied to the CNY settlement amount before it is converted to membership points. */
27
68
  multiplier: number;
28
69
  }
70
+ export interface IMembershipAllowedModel {
71
+ provider: string;
72
+ model: string;
73
+ }
29
74
  export interface IMembershipRateLimit {
30
75
  provider?: string | null;
31
76
  model?: string | null;
@@ -36,35 +81,75 @@ export interface IMembershipPlan extends IBasePerTenantAndOrganizationEntityMode
36
81
  code: string;
37
82
  name: string;
38
83
  description?: string | null;
84
+ level: number;
85
+ catalogSourcePlanId?: string | null;
39
86
  status: MembershipPlanStatusEnum;
40
87
  isDefault?: boolean;
41
88
  period: MembershipPeriodEnum;
42
89
  includedPoints: number | null;
43
- tokensPerPoint: number;
90
+ /** @deprecated Sale pricing is owned by the Pro billing product. Retained temporarily for migration only. */
44
91
  priceAmount?: number | null;
92
+ /** @deprecated Sale pricing is owned by the Pro billing product. Retained temporarily for migration only. */
45
93
  priceCurrency?: string | null;
94
+ allowedModels?: IMembershipAllowedModel[];
95
+ modelMultipliers?: IMembershipModelMultiplier[];
96
+ rateLimits?: IMembershipRateLimit[];
97
+ }
98
+ export interface IMembershipPlanSnapshot {
99
+ planId?: string | null;
100
+ code: string;
101
+ name: string;
102
+ description?: string | null;
103
+ level: number;
104
+ catalogSourcePlanId?: string | null;
105
+ period: MembershipPeriodEnum;
106
+ includedPoints: number | null;
107
+ allowedModels?: IMembershipAllowedModel[];
46
108
  modelMultipliers?: IMembershipModelMultiplier[];
47
109
  rateLimits?: IMembershipRateLimit[];
48
110
  }
49
111
  export interface IUserMembership extends IBasePerTenantAndOrganizationEntityModel {
50
112
  userId: string;
51
113
  user?: IUser;
52
- planId: string;
114
+ planId?: string | null;
53
115
  plan?: IMembershipPlan;
54
116
  status: MembershipStatusEnum;
117
+ source: MembershipSourceEnum;
118
+ renewalMode: MembershipRenewalModeEnum;
55
119
  currentPeriodStart: Date;
56
120
  currentPeriodEnd: Date;
57
121
  pointsGranted: number | null;
58
122
  pointsUsed: number;
59
123
  pointsTotalUsed: number;
124
+ planSnapshot?: IMembershipPlanSnapshot | null;
60
125
  assignedById?: string | null;
61
126
  assignedBy?: IUser;
62
127
  note?: string | null;
63
128
  }
64
- export interface IMembershipPointLedger extends IBasePerTenantEntityModel {
129
+ export interface IUserMembershipPeriod extends IBasePerTenantAndOrganizationEntityModel {
130
+ membershipId: string;
131
+ membership?: IUserMembership;
65
132
  userId: string;
66
133
  user?: IUser;
67
- membershipId: string;
134
+ planId?: string | null;
135
+ plan?: IMembershipPlan;
136
+ status: MembershipPeriodStatusEnum;
137
+ periodStart: Date;
138
+ periodEnd: Date;
139
+ pointsGranted: number | null;
140
+ pointsUsed: number;
141
+ source: MembershipSourceEnum;
142
+ renewalMode: MembershipRenewalModeEnum;
143
+ sourceReference?: string | null;
144
+ sourceSequence: number;
145
+ planSnapshot: IMembershipPlanSnapshot;
146
+ }
147
+ export interface IMembershipPointLedger extends IBasePerTenantEntityModel {
148
+ userId?: string | null;
149
+ user?: IUser;
150
+ actorId?: string | null;
151
+ actor?: IUser;
152
+ membershipId?: string | null;
68
153
  membership?: IUserMembership;
69
154
  planId?: string | null;
70
155
  plan?: IMembershipPlan;
@@ -79,17 +164,89 @@ export interface IMembershipPointLedger extends IBasePerTenantEntityModel {
79
164
  threadId?: string | null;
80
165
  copilotId?: string | null;
81
166
  usageHour?: string | null;
167
+ sourceReference?: string | null;
82
168
  reason?: string | null;
169
+ accessSource?: ModelAccessSourceEnum | null;
170
+ modelGrantId?: string | null;
171
+ usageChannel?: ModelGatewayUsageChannelEnum | null;
172
+ gatewayRequestId?: string | null;
173
+ gatewayApiKeyId?: string | null;
174
+ chargedPoints?: number | null;
175
+ excessPoints?: number | null;
176
+ requestId?: string | null;
177
+ revision?: number | null;
178
+ originType?: ModelUsageOriginType | null;
179
+ originId?: string | null;
180
+ originExecutionId?: string | null;
181
+ providerScopeId?: string | null;
182
+ modelType?: AiModelTypeEnum | null;
183
+ toolName?: string | null;
184
+ modality?: ModelUsageLedgerModality | null;
185
+ operation?: ModelUsageLedgerOperation | null;
186
+ unit?: ModelUsageMetric['unit'] | null;
187
+ authority?: ModelUsageMetric['authority'] | null;
188
+ quantity?: number | null;
189
+ promptTokens?: number | null;
190
+ completionTokens?: number | null;
191
+ totalTokens?: number | null;
192
+ recordedAt?: Date | string | null;
193
+ pricingStatus?: ModelUsagePricingStatus | null;
194
+ pricingRuleId?: string | null;
195
+ pricingRuleVersion?: string | null;
196
+ priceQuantity?: number | null;
197
+ unitSize?: number | null;
198
+ unitPrice?: number | null;
199
+ priceCurrency?: string | null;
200
+ priceAmount?: number | null;
201
+ pricingRule?: ModelUsagePriceRule | null;
202
+ chargedAt?: Date | string | null;
203
+ settlementCurrency?: string | null;
204
+ settlementAmount?: number | null;
205
+ exchangeRate?: number | null;
83
206
  }
84
207
  export interface IMembershipMe {
85
208
  membership: IUserMembership;
86
209
  plan: IMembershipPlan;
210
+ personalPointsOnly: boolean;
87
211
  pointsGranted: number | null;
88
212
  pointsUsed: number;
89
213
  pointsRemaining: number | null;
90
214
  pointsTotalUsed: number;
91
215
  currentPeriodStart: Date;
92
216
  currentPeriodEnd: Date;
217
+ personalPointsBalance: number;
218
+ }
219
+ export interface IUserPersonalPoints {
220
+ userId: string;
221
+ balance: number;
222
+ }
223
+ export interface IMembershipAdminUser {
224
+ user: IUser;
225
+ membership?: IUserMembership | null;
226
+ scheduledPeriodCount: number;
227
+ }
228
+ export interface IMembershipAdminUsersQuery {
229
+ search?: string;
230
+ status?: MembershipAdminUserStatusEnum;
231
+ planId?: string;
232
+ expiringBefore?: string;
233
+ take?: number;
234
+ skip?: number;
235
+ }
236
+ export type TMembershipBulkActionInput = {
237
+ userIds: string[];
238
+ action: MembershipBulkActionEnum;
239
+ planId?: string;
240
+ renewalMode?: MembershipRenewalModeEnum;
241
+ note?: string | null;
242
+ };
243
+ export interface IMembershipBulkActionFailure {
244
+ userId: string;
245
+ message: string;
246
+ }
247
+ export interface IMembershipBulkActionResult {
248
+ succeeded: number;
249
+ failed: IMembershipBulkActionFailure[];
93
250
  }
94
251
  export interface IMembershipScopeStatus {
95
252
  tenantId: string;
@@ -117,6 +274,7 @@ export interface IMembershipUsageRank {
117
274
  }
118
275
  export interface IMembershipUsageGroupKey {
119
276
  usageHour?: string | null;
277
+ usageChannel?: ModelGatewayUsageChannelEnum | null;
120
278
  provider?: string | null;
121
279
  model?: string | null;
122
280
  organizationId?: string | null;
@@ -136,7 +294,7 @@ export interface IMembershipUsageSummary extends IMembershipUsageGroupKey {
136
294
  firstUsedAt?: Date | string | null;
137
295
  lastUsedAt?: Date | string | null;
138
296
  }
139
- export interface IMembershipUsageOverview extends IMembershipMe {
297
+ export interface IMembershipUsageOverview extends Partial<IMembershipMe> {
140
298
  totalTokens: number;
141
299
  peakDailyTokens: number;
142
300
  activeDays: number;
@@ -149,15 +307,74 @@ export type TMembershipAssignInput = {
149
307
  planId: string;
150
308
  currentPeriodStart?: string | Date;
151
309
  currentPeriodEnd?: string | Date;
310
+ source?: MembershipSourceEnum;
311
+ renewalMode?: MembershipRenewalModeEnum;
152
312
  note?: string | null;
153
313
  };
154
314
  export type TMembershipPointAdjustInput = {
155
315
  pointDelta: number;
156
316
  reason?: string | null;
157
317
  };
318
+ export type TMembershipPersonalPointsAdjustmentInput = {
319
+ tenantId: string;
320
+ userId: string;
321
+ actorId?: string | null;
322
+ pointDelta: number;
323
+ sourceReference: string;
324
+ reason?: string | null;
325
+ };
326
+ export type TMembershipPlanReassignInput = {
327
+ targetPlanId: string;
328
+ };
329
+ export type TMembershipPeriodsAppendInput = {
330
+ tenantId: string;
331
+ organizationId?: string | null;
332
+ userId: string;
333
+ actorId?: string | null;
334
+ planId: string;
335
+ count: number;
336
+ source?: MembershipSourceEnum;
337
+ renewalMode?: MembershipRenewalModeEnum;
338
+ sourceReference?: string | null;
339
+ startAt?: string | Date;
340
+ planSnapshot?: IMembershipPlanSnapshot;
341
+ };
342
+ export type TMembershipPeriodCancelInput = {
343
+ tenantId: string;
344
+ organizationId?: string | null;
345
+ userId: string;
346
+ periodId: string;
347
+ sourceReference?: string | null;
348
+ };
349
+ export type TMembershipPeriodsRefundReservationInput = {
350
+ tenantId: string;
351
+ organizationId?: string | null;
352
+ userId: string;
353
+ sourceReference: string;
354
+ };
355
+ export type TMembershipOrganizationPurchasePlanInput = {
356
+ tenantId: string;
357
+ organizationId: string;
358
+ userId: string;
359
+ catalogSourcePlanId: string;
360
+ planSnapshot: IMembershipPlanSnapshot;
361
+ };
362
+ export type TMembershipCurrentPeriodUpgradeInput = {
363
+ tenantId: string;
364
+ organizationId?: string | null;
365
+ userId: string;
366
+ actorId?: string | null;
367
+ planId: string;
368
+ pointsDelta: number;
369
+ sourceReference: string;
370
+ source?: MembershipSourceEnum;
371
+ renewalMode?: MembershipRenewalModeEnum;
372
+ planSnapshot?: IMembershipPlanSnapshot;
373
+ };
158
374
  export interface IMembershipUsageQuery {
159
375
  start?: string;
160
376
  end?: string;
377
+ usageChannel?: ModelGatewayUsageChannelEnum;
161
378
  provider?: string;
162
379
  model?: string;
163
380
  organizationId?: string;
@@ -0,0 +1,229 @@
1
+ import { AiModelTypeEnum } from '../agent';
2
+ import { IBasePerTenantAndOrganizationEntityModel, IBasePerTenantEntityModel } from '../base-entity.model';
3
+ import { I18nObject } from '../types';
4
+ export declare enum ModelAccessRequestStatusEnum {
5
+ Requested = "requested",
6
+ Approved = "approved",
7
+ Rejected = "rejected",
8
+ Withdrawn = "withdrawn",
9
+ Closed = "closed"
10
+ }
11
+ export declare enum UserModelGrantStatusEnum {
12
+ Active = "active",
13
+ Expired = "expired",
14
+ Revoked = "revoked"
15
+ }
16
+ export declare enum ModelAccessOwnershipScopeEnum {
17
+ Tenant = "tenant",
18
+ Organization = "organization"
19
+ }
20
+ export declare enum ModelAccessChannelEnum {
21
+ Xpert = "xpert",
22
+ ExternalApi = "external_api"
23
+ }
24
+ export declare enum ModelAccessSourceEnum {
25
+ Direct = "direct",
26
+ Plan = "plan",
27
+ Grant = "grant"
28
+ }
29
+ export declare enum ModelAccessUnavailableReasonEnum {
30
+ FeatureDisabled = "feature_disabled",
31
+ ModelDisabled = "model_disabled",
32
+ ModelDeleted = "model_deleted",
33
+ GrantExpired = "grant_expired",
34
+ GrantRevoked = "grant_revoked",
35
+ QuotaExhausted = "quota_exhausted",
36
+ MembershipRequired = "membership_required",
37
+ TechnicalUser = "technical_user",
38
+ ExternalApiIneligible = "external_api_ineligible"
39
+ }
40
+ export declare enum ModelAccessClosedReasonCodeEnum {
41
+ PlanIncluded = "plan_included",
42
+ ModelDeleted = "model_deleted",
43
+ UserLeftOrganization = "user_left_organization",
44
+ Other = "other"
45
+ }
46
+ export declare enum ModelAccessEventTypeEnum {
47
+ Requested = "requested",
48
+ Withdrawn = "withdrawn",
49
+ Approved = "approved",
50
+ Rejected = "rejected",
51
+ Extended = "extended",
52
+ Revoked = "revoked",
53
+ GrantActivated = "grant_activated",
54
+ GrantExpired = "grant_expired",
55
+ SystemClosed = "system_closed",
56
+ ModelSuspended = "model_suspended",
57
+ ModelRestored = "model_restored",
58
+ ModelDeleted = "model_deleted",
59
+ UserLeftOrganization = "user_left_organization"
60
+ }
61
+ export declare enum ModelAccessActorTypeEnum {
62
+ User = "user",
63
+ System = "system"
64
+ }
65
+ export interface IModelAccessModelSnapshot {
66
+ copilotId: string;
67
+ copilotName?: string | null;
68
+ copilotOrganizationId?: string | null;
69
+ provider: string;
70
+ providerLabel?: I18nObject | null;
71
+ modelType: AiModelTypeEnum;
72
+ model: string;
73
+ modelLabel?: I18nObject | null;
74
+ externalModelId?: string | null;
75
+ capturedAt: Date | string;
76
+ }
77
+ export interface IModelAccessRequest extends IBasePerTenantAndOrganizationEntityModel {
78
+ channel: ModelAccessChannelEnum;
79
+ requesterId: string;
80
+ requesterName?: string | null;
81
+ requestedFromOrganizationId?: string | null;
82
+ copilotId: string;
83
+ copilotModelId: string;
84
+ provider: string;
85
+ modelType: AiModelTypeEnum;
86
+ model: string;
87
+ ownershipScope: ModelAccessOwnershipScopeEnum;
88
+ reason: string;
89
+ status: ModelAccessRequestStatusEnum;
90
+ decidedById?: string | null;
91
+ decidedByName?: string | null;
92
+ decisionReason?: string | null;
93
+ decidedAt?: Date | string | null;
94
+ requestedValidUntil?: Date | string | null;
95
+ closedReasonCode?: ModelAccessClosedReasonCodeEnum | null;
96
+ gatewayPublicationId?: string | null;
97
+ externalModelId?: string | null;
98
+ modelSnapshot: IModelAccessModelSnapshot;
99
+ events?: IModelAccessEvent[];
100
+ }
101
+ export interface IUserModelGrant extends IBasePerTenantAndOrganizationEntityModel {
102
+ channel: ModelAccessChannelEnum;
103
+ userId: string;
104
+ userName?: string | null;
105
+ requestId: string;
106
+ copilotId: string;
107
+ copilotModelId: string;
108
+ provider: string;
109
+ modelType: AiModelTypeEnum;
110
+ model: string;
111
+ ownershipScope: ModelAccessOwnershipScopeEnum;
112
+ status: UserModelGrantStatusEnum;
113
+ validUntil?: Date | string | null;
114
+ approvedAt: Date | string;
115
+ approvedById?: string | null;
116
+ approvedByName?: string | null;
117
+ revokedAt?: Date | string | null;
118
+ revokedById?: string | null;
119
+ revokedByName?: string | null;
120
+ revokeReason?: string | null;
121
+ lastUnavailableReason?: ModelAccessUnavailableReasonEnum | null;
122
+ gatewayPublicationId?: string | null;
123
+ externalModelId?: string | null;
124
+ modelSnapshot: IModelAccessModelSnapshot;
125
+ events?: IModelAccessEvent[];
126
+ }
127
+ export interface IModelAccessEvent extends IBasePerTenantEntityModel {
128
+ channel: ModelAccessChannelEnum;
129
+ organizationId?: string | null;
130
+ requestedFromOrganizationId?: string | null;
131
+ requestId?: string | null;
132
+ grantId?: string | null;
133
+ eventType: ModelAccessEventTypeEnum;
134
+ actorId?: string | null;
135
+ actorName?: string | null;
136
+ actorType: ModelAccessActorTypeEnum;
137
+ actorScope: ModelAccessOwnershipScopeEnum;
138
+ fromStatus?: string | null;
139
+ toStatus?: string | null;
140
+ reason?: string | null;
141
+ systemReasonCode?: ModelAccessClosedReasonCodeEnum | null;
142
+ metadata?: Record<string, unknown> | null;
143
+ idempotencyKey: string;
144
+ modelSnapshot: IModelAccessModelSnapshot;
145
+ }
146
+ export interface IModelAccessCatalogItem {
147
+ key: string;
148
+ channel: ModelAccessChannelEnum;
149
+ copilotId: string;
150
+ copilotModelId: string;
151
+ copilotName?: string | null;
152
+ provider: string;
153
+ providerLabel?: I18nObject | null;
154
+ modelType: AiModelTypeEnum;
155
+ model: string;
156
+ modelLabel?: I18nObject | null;
157
+ ownershipScope: ModelAccessOwnershipScopeEnum;
158
+ organizationId?: string | null;
159
+ gatewayPublicationId?: string | null;
160
+ externalModelId?: string | null;
161
+ accessSource?: ModelAccessSourceEnum | null;
162
+ grantId?: string | null;
163
+ planIncluded: boolean;
164
+ allowed: boolean;
165
+ requestable: boolean;
166
+ unavailableReason?: ModelAccessUnavailableReasonEnum | null;
167
+ pendingRequest?: IModelAccessRequest | null;
168
+ grant?: IUserModelGrant | null;
169
+ }
170
+ export interface IModelAccessCatalog {
171
+ items: IModelAccessCatalogItem[];
172
+ canRequest: boolean;
173
+ requestBlockedReason?: ModelAccessUnavailableReasonEnum | 'manager' | null;
174
+ tenantFeatureEnabled: boolean;
175
+ organizationFeatureEnabled: boolean;
176
+ }
177
+ export interface IModelAccessResolution {
178
+ allowed: boolean;
179
+ channel: ModelAccessChannelEnum;
180
+ billableUserId: string;
181
+ copilotId: string;
182
+ copilotModelId: string;
183
+ provider?: string | null;
184
+ modelType: AiModelTypeEnum;
185
+ model?: string | null;
186
+ accessSource?: ModelAccessSourceEnum | null;
187
+ planId?: string | null;
188
+ grantId?: string | null;
189
+ multiplier: number;
190
+ scope: ModelAccessOwnershipScopeEnum;
191
+ organizationId?: string | null;
192
+ gatewayPublicationId?: string | null;
193
+ externalModelId?: string | null;
194
+ unavailableReason?: ModelAccessUnavailableReasonEnum | null;
195
+ }
196
+ export type TModelAccessRequestCreateInput = {
197
+ copilotId: string;
198
+ copilotModelId: string;
199
+ modelType: AiModelTypeEnum;
200
+ reason: string;
201
+ channel?: ModelAccessChannelEnum;
202
+ gatewayPublicationId?: string;
203
+ };
204
+ export type TModelAccessRequestWithdrawInput = {
205
+ reason?: string | null;
206
+ };
207
+ export type TModelAccessRequestApproveInput = {
208
+ validUntil?: string | null;
209
+ note?: string | null;
210
+ };
211
+ export type TModelAccessRequestRejectInput = {
212
+ reason: string;
213
+ };
214
+ export type TUserModelGrantExtendInput = {
215
+ validUntil: string | null;
216
+ note?: string | null;
217
+ };
218
+ export type TUserModelGrantRevokeInput = {
219
+ reason: string;
220
+ };
221
+ export interface IModelAccessAdminQuery {
222
+ channel?: ModelAccessChannelEnum;
223
+ search?: string;
224
+ modelType?: AiModelTypeEnum;
225
+ status?: ModelAccessRequestStatusEnum | UserModelGrantStatusEnum;
226
+ expiresBefore?: string;
227
+ take?: number;
228
+ skip?: number;
229
+ }