@metad/contracts 3.8.4 → 3.9.0-beta.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.
package/src/index.d.ts CHANGED
@@ -28,6 +28,7 @@ export type { IBasePerTenantAndOrganizationEntityModel, IBasePerTenantEntityMode
28
28
  export type { IBaseEntityModel as BaseEntityModel } from './base-entity.model';
29
29
  export * from './role.model';
30
30
  export * from './user-organization.model';
31
+ export * from './user-group.model';
31
32
  export * from './user.model';
32
33
  export * from './analytics/index';
33
34
  export * from './custom-smtp.model';
@@ -39,6 +40,7 @@ export * from './password-reset.model';
39
40
  export * from './secret-token.model';
40
41
  export * from './storage-file.model';
41
42
  export * from './visibility.model';
43
+ export * from './scope.model';
42
44
  export * from './integration/index';
43
45
  export * from './ai/index';
44
46
  export * from './agent/index';
@@ -47,3 +49,4 @@ export * from './schedule';
47
49
  export * from './tools/index';
48
50
  export * from './plain-object.model';
49
51
  export * from './plugin';
52
+ export * from './view-extension';
@@ -3,6 +3,7 @@ import { IOrganizationProjectsUpdateInput } from './organization-projects.model'
3
3
  import { IOrganizationUpdateInput } from './organization.model';
4
4
  import { ITag } from './tag-entity.model';
5
5
  import { I18nObject, IconDefinition, TAvatar, TParameterSchema } from './types';
6
+ import { IUser } from './user.model';
6
7
  export interface IIntegration<T = any> extends IBasePerTenantAndOrganizationEntityModel {
7
8
  name: string;
8
9
  description?: string;
@@ -21,6 +22,12 @@ export interface IIntegration<T = any> extends IBasePerTenantAndOrganizationEnti
21
22
  */
22
23
  options?: T;
23
24
  tags?: ITag[];
25
+ /**
26
+ * Stable technical principal for this integration.
27
+ * One integration should map to one long-lived communication user.
28
+ */
29
+ userId?: string;
30
+ user?: IUser;
24
31
  }
25
32
  export interface IIntegrationFilter {
26
33
  integrationTypeId: string;
@@ -60,6 +60,8 @@ export interface ICreateEmailInvitesOutput {
60
60
  }
61
61
  export interface IInviteFindInput extends IBasePerTenantAndOrganizationEntityModel {
62
62
  invitationType?: InvitationTypeEnum;
63
+ email?: string;
64
+ status?: InviteStatusEnum;
63
65
  }
64
66
  export interface IPublicInviteFindInput {
65
67
  email: string;
package/src/plugin.d.ts CHANGED
@@ -19,6 +19,10 @@ export declare const PLUGIN_CONFIGURATION_STATUS: {
19
19
  readonly VALID: "valid";
20
20
  readonly INVALID: "invalid";
21
21
  };
22
+ export declare const PLUGIN_LOAD_STATUS: {
23
+ readonly LOADED: "loaded";
24
+ readonly FAILED: "failed";
25
+ };
22
26
  /**
23
27
  * Classifies plugin scope and governance.
24
28
  * - `system`: built-in/platform-managed plugin that users cannot install/uninstall from org APIs.
@@ -27,6 +31,14 @@ export declare const PLUGIN_CONFIGURATION_STATUS: {
27
31
  export type PluginLevel = (typeof PLUGIN_LEVEL)[keyof typeof PLUGIN_LEVEL];
28
32
  export type PluginSource = (typeof PLUGIN_SOURCE)[keyof typeof PLUGIN_SOURCE];
29
33
  export type PluginConfigurationStatus = (typeof PLUGIN_CONFIGURATION_STATUS)[keyof typeof PLUGIN_CONFIGURATION_STATUS];
34
+ export type PluginLoadStatus = (typeof PLUGIN_LOAD_STATUS)[keyof typeof PLUGIN_LOAD_STATUS];
35
+ export type PluginScopeRelation = 'none' | 'overrides-global' | 'shadowed-by-organization';
36
+ export interface PluginCodeSourceConfig {
37
+ workspacePath?: string;
38
+ }
39
+ export interface PluginSourceConfig extends PluginCodeSourceConfig {
40
+ [key: string]: unknown;
41
+ }
30
42
  export interface PluginMeta {
31
43
  name: PluginName;
32
44
  version: string;
@@ -47,11 +59,31 @@ export interface IPlugin extends IBasePerTenantAndOrganizationEntityModel {
47
59
  packageName: string;
48
60
  version?: string;
49
61
  source?: PluginSource;
62
+ sourceConfig?: PluginSourceConfig | null;
50
63
  level?: PluginLevel;
51
64
  config: Record<string, any>;
52
65
  configurationStatus?: PluginConfigurationStatus | null;
53
66
  configurationError?: string | null;
54
67
  }
68
+ export interface IPluginInstallInput {
69
+ pluginName: PluginName;
70
+ version?: string;
71
+ source?: PluginSource;
72
+ config?: Record<string, any>;
73
+ sourceConfig?: PluginSourceConfig;
74
+ }
75
+ export interface IPluginInstallResult {
76
+ success: boolean;
77
+ name: PluginName;
78
+ packageName: string;
79
+ organizationId: string;
80
+ currentVersion?: string;
81
+ }
82
+ export interface IPluginUpdateResult extends IPluginInstallResult {
83
+ latestVersion?: string;
84
+ updated: boolean;
85
+ previousVersion?: string;
86
+ }
55
87
  export interface IPluginDescriptor {
56
88
  organizationId?: string;
57
89
  name: PluginName;
@@ -63,11 +95,17 @@ export interface IPluginDescriptor {
63
95
  isGlobal: boolean;
64
96
  level: PluginLevel;
65
97
  canConfigure?: boolean;
98
+ canRefresh?: boolean;
99
+ canUninstall?: boolean;
66
100
  canUpdate?: boolean;
67
101
  hasUpdate?: boolean;
68
102
  configSchema?: JsonSchemaObjectType;
69
103
  configurationStatus?: PluginConfigurationStatus | null;
70
104
  configurationError?: string | null;
105
+ loadStatus?: PluginLoadStatus | null;
106
+ loadError?: string | null;
107
+ effectiveInCurrentScope: boolean;
108
+ scopeRelation?: PluginScopeRelation;
71
109
  }
72
110
  export interface IPluginConfiguration<TConfig extends Record<string, any> = Record<string, any>> {
73
111
  pluginName: PluginName;
@@ -12,13 +12,12 @@ export interface IRoleCreateInput extends IBasePerTenantEntityModel {
12
12
  export declare enum RolesEnum {
13
13
  SUPER_ADMIN = "SUPER_ADMIN",
14
14
  ADMIN = "ADMIN",
15
- DATA_ENTRY = "DATA_ENTRY",
16
- EMPLOYEE = "EMPLOYEE",
17
- CANDIDATE = "CANDIDATE",
18
- MANAGER = "MANAGER",
15
+ AI_BUILDER = "AI_BUILDER",
16
+ ANALYTICS_BUILDER = "ANALYTICS_BUILDER",
19
17
  VIEWER = "VIEWER",
20
18
  TRIAL = "TRIAL"
21
19
  }
20
+ export declare const DEFAULT_SYSTEM_ROLES: RolesEnum[];
22
21
  export interface IRoleMigrateInput extends IBasePerTenantEntityModel {
23
22
  name: string;
24
23
  isImporting: boolean;
@@ -0,0 +1,9 @@
1
+ export declare enum RequestScopeLevel {
2
+ TENANT = "tenant",
3
+ ORGANIZATION = "organization"
4
+ }
5
+ export interface IRequestScopeContext {
6
+ tenantId: string | null;
7
+ level: RequestScopeLevel;
8
+ organizationId: string | null;
9
+ }
package/src/types.d.ts CHANGED
@@ -1,6 +1,8 @@
1
+ import ShortUniqueId from 'short-unique-id';
1
2
  import type * as z3 from "zod/v3";
2
3
  import type * as z4 from "zod/v4/core";
3
- export declare const uuid: (uuidLength?: number) => string;
4
+ declare const uuidGenerator: ShortUniqueId;
5
+ export declare const uuid: (...args: Parameters<(typeof uuidGenerator)["randomUUID"]>) => string;
4
6
  /**
5
7
  * @description
6
8
  * An entity ID. Represents a unique identifier as a string.
@@ -158,7 +160,7 @@ export type IconType = 'image' | 'svg' | 'font' | 'emoji' | 'lottie';
158
160
  * |-----------|----------------------------------|-----------------|
159
161
  * | `image` | Raster or Base64-encoded image | `"https://cdn.example.com/logo.png"` or `"data:image/png;base64,..."` |
160
162
  * | `svg` | Inline SVG markup | `"<svg xmlns='http://www.w3.org/2000/svg'><path d='M12 2l4 20H8z'/></svg>"` |
161
- * | `font` | Font icon class name | `"fa-solid fa-user"` or `"material-icons:home"` |
163
+ * | `font` | Font icon class name | `"fa-solid fa-user"` or `"ri-home-line"` |
162
164
  * | `emoji` | Unicode emoji character | `"🚀"` |
163
165
  * | `lottie` | Lottie animation JSON URL | `"https://assets.lottiefiles.com/packages/lf20_abc123.json"` |
164
166
  *
@@ -243,3 +245,4 @@ export interface IconDefinition {
243
245
  export type ZodObjectV3 = z3.ZodObject<any, any, any, any>;
244
246
  export type ZodObjectV4 = z4.$ZodObject;
245
247
  export type InteropZodObject = ZodObjectV3 | ZodObjectV4;
248
+ export {};
@@ -0,0 +1,7 @@
1
+ import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
2
+ import { IUser } from './user.model';
3
+ export interface IUserGroup extends IBasePerTenantAndOrganizationEntityModel {
4
+ name: string;
5
+ description?: string | null;
6
+ members?: IUser[];
7
+ }
@@ -0,0 +1 @@
1
+ export * from './model';
@@ -0,0 +1,183 @@
1
+ import type { I18nObject } from '../types';
2
+ export type XpertViewHostType = 'integration' | 'knowledgebase' | 'agent' | 'project' | 'sandbox' | string;
3
+ export type XpertViewSlotMode = 'tabs' | 'sections' | 'widgets' | 'sidebar';
4
+ export type XpertViewSchemaType = 'stats' | 'table' | 'list' | 'detail' | 'raw_json';
5
+ export type XpertViewValueType = 'text' | 'number' | 'status' | 'datetime' | 'json';
6
+ export type XpertViewColumnDataType = 'text' | 'number' | 'date' | 'datetime' | 'status' | 'tag' | 'avatar' | 'link';
7
+ export type XpertViewActionPlacement = 'toolbar' | 'row';
8
+ export type XpertViewActionType = 'invoke' | 'navigate' | 'open_detail' | 'refresh';
9
+ export type XpertViewSortDirection = 'asc' | 'desc';
10
+ export type XpertViewFilterOperator = 'eq' | 'neq' | 'contains' | 'starts_with' | 'ends_with' | 'in' | 'gt' | 'gte' | 'lt' | 'lte';
11
+ export type XpertViewScalar = string | number | boolean | null;
12
+ export interface XpertViewHostContext {
13
+ tenantId: string;
14
+ organizationId?: string | null;
15
+ workspaceId?: string | null;
16
+ userId: string;
17
+ hostType: XpertViewHostType;
18
+ hostId: string;
19
+ module?: string;
20
+ route?: string;
21
+ permissions?: string[];
22
+ locale?: string;
23
+ }
24
+ export interface XpertResolvedViewHostContext extends XpertViewHostContext {
25
+ slots: XpertViewSlot[];
26
+ hostSnapshot?: unknown;
27
+ }
28
+ export interface XpertViewSlot {
29
+ key: string;
30
+ title?: I18nObject;
31
+ mode: XpertViewSlotMode;
32
+ order?: number;
33
+ }
34
+ export interface XpertViewSource {
35
+ provider: string;
36
+ plugin?: string;
37
+ version?: string;
38
+ }
39
+ export interface XpertViewBadge {
40
+ type: 'count' | 'status' | 'text';
41
+ value?: string | number;
42
+ }
43
+ export interface XpertViewPolling {
44
+ enabled: boolean;
45
+ intervalMs?: number;
46
+ }
47
+ export interface XpertViewCachePolicy {
48
+ enabled?: boolean;
49
+ ttlMs?: number;
50
+ }
51
+ export interface XpertViewQuerySchema {
52
+ supportsPagination?: boolean;
53
+ supportsSearch?: boolean;
54
+ supportsSort?: boolean;
55
+ supportsFilter?: boolean;
56
+ supportsCursor?: boolean;
57
+ supportsSelection?: boolean;
58
+ defaultPageSize?: number;
59
+ }
60
+ export interface XpertViewDataSource {
61
+ mode: 'platform';
62
+ querySchema?: XpertViewQuerySchema;
63
+ cache?: XpertViewCachePolicy;
64
+ polling?: XpertViewPolling;
65
+ }
66
+ export interface XpertViewFilter {
67
+ key: string;
68
+ operator?: XpertViewFilterOperator;
69
+ value: XpertViewScalar | XpertViewScalar[];
70
+ }
71
+ export interface XpertViewQuery {
72
+ page?: number;
73
+ pageSize?: number;
74
+ cursor?: string;
75
+ search?: string;
76
+ sortBy?: string;
77
+ sortDirection?: XpertViewSortDirection;
78
+ filters?: XpertViewFilter[];
79
+ selectionId?: string;
80
+ }
81
+ export interface XpertStatsViewSchema {
82
+ type: 'stats';
83
+ items: Array<{
84
+ key: string;
85
+ label: I18nObject;
86
+ valueType?: XpertViewValueType;
87
+ }>;
88
+ }
89
+ export interface XpertTableViewSchema {
90
+ type: 'table';
91
+ columns: Array<{
92
+ key: string;
93
+ label: I18nObject;
94
+ dataType?: XpertViewColumnDataType;
95
+ width?: string;
96
+ sortable?: boolean;
97
+ searchable?: boolean;
98
+ }>;
99
+ pagination?: {
100
+ enabled: boolean;
101
+ pageSize?: number;
102
+ };
103
+ search?: {
104
+ enabled: boolean;
105
+ placeholder?: I18nObject;
106
+ };
107
+ }
108
+ export interface XpertListViewSchema {
109
+ type: 'list';
110
+ item: {
111
+ titleKey: string;
112
+ subtitleKey?: string;
113
+ descriptionKey?: string;
114
+ metaKeys?: string[];
115
+ };
116
+ pagination?: {
117
+ enabled: boolean;
118
+ pageSize?: number;
119
+ };
120
+ search?: {
121
+ enabled: boolean;
122
+ placeholder?: I18nObject;
123
+ };
124
+ }
125
+ export interface XpertDetailViewSchema {
126
+ type: 'detail';
127
+ fields: Array<{
128
+ key: string;
129
+ label: I18nObject;
130
+ dataType?: XpertViewValueType;
131
+ }>;
132
+ }
133
+ export interface XpertRawJsonViewSchema {
134
+ type: 'raw_json';
135
+ }
136
+ export type XpertViewSchema = XpertStatsViewSchema | XpertTableViewSchema | XpertListViewSchema | XpertDetailViewSchema | XpertRawJsonViewSchema;
137
+ export interface XpertViewActionDefinition {
138
+ key: string;
139
+ label: I18nObject;
140
+ icon?: string;
141
+ placement?: XpertViewActionPlacement;
142
+ actionType: XpertViewActionType;
143
+ confirm?: {
144
+ title?: I18nObject;
145
+ message?: I18nObject;
146
+ };
147
+ permissions?: string[];
148
+ }
149
+ export interface XpertExtensionViewManifest {
150
+ key: string;
151
+ title: I18nObject;
152
+ description?: I18nObject;
153
+ icon?: string;
154
+ hostType: XpertViewHostType;
155
+ slot: string;
156
+ order?: number;
157
+ visible?: boolean;
158
+ source: XpertViewSource;
159
+ permissions?: string[];
160
+ badge?: XpertViewBadge;
161
+ refreshable?: boolean;
162
+ polling?: XpertViewPolling;
163
+ view: XpertViewSchema;
164
+ dataSource: XpertViewDataSource;
165
+ actions?: XpertViewActionDefinition[];
166
+ }
167
+ export interface XpertViewActionRequest {
168
+ targetId?: string;
169
+ }
170
+ export interface XpertViewDataResult<TItem = unknown, TSummary = unknown> {
171
+ items?: TItem[];
172
+ item?: TItem;
173
+ total?: number;
174
+ nextCursor?: string;
175
+ summary?: TSummary;
176
+ meta?: unknown;
177
+ }
178
+ export interface XpertViewActionResult<TData = unknown> {
179
+ success: boolean;
180
+ message?: I18nObject;
181
+ data?: TData;
182
+ refresh?: boolean;
183
+ }
package/index.esm.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./src/index";
File without changes
File without changes
File without changes
File without changes
File without changes