@xpert-ai/contracts 3.9.0-beta.1
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 +3 -0
- package/index.cjs.js +4945 -0
- package/index.d.ts +1 -0
- package/index.esm.js +4792 -0
- package/package.json +25 -0
- package/src/agent/ai-model.d.ts +9 -0
- package/src/agent/graph.d.ts +182 -0
- package/src/agent/index.d.ts +6 -0
- package/src/agent/interrupt.d.ts +51 -0
- package/src/agent/token.d.ts +21 -0
- package/src/agent/utils.d.ts +19 -0
- package/src/agent/variables.d.ts +16 -0
- package/src/ai/ai-model.model.d.ts +198 -0
- package/src/ai/ai-provider.model.d.ts +43 -0
- package/src/ai/ai.model.d.ts +82 -0
- package/src/ai/assistant-binding.model.d.ts +81 -0
- package/src/ai/chat-event.model.d.ts +8 -0
- package/src/ai/chat-message-feedback.model.d.ts +24 -0
- package/src/ai/chat-message.model.d.ts +93 -0
- package/src/ai/chat.model.d.ts +191 -0
- package/src/ai/copilot-checkpoint.model.d.ts +23 -0
- package/src/ai/copilot-example.model.d.ts +19 -0
- package/src/ai/copilot-model.model.d.ts +30 -0
- package/src/ai/copilot-organization.model.d.ts +17 -0
- package/src/ai/copilot-provider.model.d.ts +31 -0
- package/src/ai/copilot-role.model.d.ts +43 -0
- package/src/ai/copilot-store.model.d.ts +29 -0
- package/src/ai/copilot-user.model.d.ts +27 -0
- package/src/ai/copilot.model.d.ts +36 -0
- package/src/ai/environment.model.d.ts +16 -0
- package/src/ai/feature.model.d.ts +10 -0
- package/src/ai/index.d.ts +84 -0
- package/src/ai/knowledge-doc-chunk.model.d.ts +61 -0
- package/src/ai/knowledge-doc-page.model.d.ts +15 -0
- package/src/ai/knowledge-doc.model.d.ts +222 -0
- package/src/ai/knowledge-pipeline.d.ts +107 -0
- package/src/ai/knowledge-retrieval-log.model.d.ts +10 -0
- package/src/ai/knowledgebase-task.model.d.ts +39 -0
- package/src/ai/knowledgebase.model.d.ts +174 -0
- package/src/ai/message-content.utils.d.ts +58 -0
- package/src/ai/middleware.model.d.ts +24 -0
- package/src/ai/rag-web.d.ts +26 -0
- package/src/ai/rag.d.ts +24 -0
- package/src/ai/role-permissions.d.ts +13 -0
- package/src/ai/sandbox.d.ts +8 -0
- package/src/ai/skill.model.d.ts +241 -0
- package/src/ai/types.d.ts +77 -0
- package/src/ai/xpert-agent-execution.model.d.ts +105 -0
- package/src/ai/xpert-agent.model.d.ts +194 -0
- package/src/ai/xpert-chat.model.d.ts +66 -0
- package/src/ai/xpert-project.model.d.ts +89 -0
- package/src/ai/xpert-table.model.d.ts +84 -0
- package/src/ai/xpert-task.model.d.ts +26 -0
- package/src/ai/xpert-template.model.d.ts +47 -0
- package/src/ai/xpert-tool-mcp.model.d.ts +91 -0
- package/src/ai/xpert-tool.model.d.ts +154 -0
- package/src/ai/xpert-toolset.model.d.ts +200 -0
- package/src/ai/xpert-workflow-task.prompt.d.ts +2 -0
- package/src/ai/xpert-workflow.model.d.ts +445 -0
- package/src/ai/xpert-workspace.model.d.ts +37 -0
- package/src/ai/xpert.model.d.ts +513 -0
- package/src/ai/xpert.utils.d.ts +87 -0
- package/src/analytics/ai.d.ts +73 -0
- package/src/analytics/approval-policy.model.d.ts +30 -0
- package/src/analytics/business-area-user.model.d.ts +35 -0
- package/src/analytics/business-area.d.ts +17 -0
- package/src/analytics/certification.model.d.ts +11 -0
- package/src/analytics/chatbi-conversation.model.d.ts +15 -0
- package/src/analytics/chatbi-model.model.d.ts +18 -0
- package/src/analytics/collection.model.d.ts +6 -0
- package/src/analytics/comment.model.d.ts +10 -0
- package/src/analytics/data-source-type.d.ts +16 -0
- package/src/analytics/data-source.d.ts +62 -0
- package/src/analytics/favorite.d.ts +14 -0
- package/src/analytics/features.d.ts +19 -0
- package/src/analytics/feed-model.d.ts +13 -0
- package/src/analytics/gateway.d.ts +28 -0
- package/src/analytics/index.d.ts +38 -0
- package/src/analytics/indicator-app.d.ts +44 -0
- package/src/analytics/indicator-market.d.ts +4 -0
- package/src/analytics/indicator.d.ts +105 -0
- package/src/analytics/model-query-log.model.d.ts +41 -0
- package/src/analytics/model-query.d.ts +21 -0
- package/src/analytics/notification-destination.d.ts +10 -0
- package/src/analytics/permission-approval-user.model.d.ts +10 -0
- package/src/analytics/permission-approval.model.d.ts +47 -0
- package/src/analytics/project.model.d.ts +50 -0
- package/src/analytics/role-permissions.d.ts +25 -0
- package/src/analytics/schema.d.ts +262 -0
- package/src/analytics/screenshot.model.d.ts +24 -0
- package/src/analytics/semantic-model-entity.d.ts +38 -0
- package/src/analytics/semantic-model-member.d.ts +27 -0
- package/src/analytics/semantic-model.d.ts +183 -0
- package/src/analytics/story-point.d.ts +11 -0
- package/src/analytics/story-template.model.d.ts +28 -0
- package/src/analytics/story-widget.d.ts +12 -0
- package/src/analytics/story.d.ts +93 -0
- package/src/analytics/subscription.d.ts +38 -0
- package/src/analytics/visit.model.d.ts +34 -0
- package/src/analytics/webSocket.d.ts +48 -0
- package/src/api-key.model.d.ts +68 -0
- package/src/base-entity.model.d.ts +27 -0
- package/src/contact.model.d.ts +41 -0
- package/src/core.model.d.ts +97 -0
- package/src/country.model.d.ts +5 -0
- package/src/currency.model.d.ts +579 -0
- package/src/custom-smtp.model.d.ts +23 -0
- package/src/date-picker.model.d.ts +5 -0
- package/src/email-template.model.d.ts +39 -0
- package/src/email.model.d.ts +36 -0
- package/src/employee.model.d.ts +128 -0
- package/src/entity-with-members.model.d.ts +13 -0
- package/src/feature.model.d.ts +93 -0
- package/src/file-asset.model.d.ts +77 -0
- package/src/file-provider.d.ts +31 -0
- package/src/http-status.enum.d.ts +57 -0
- package/src/import-export.model.d.ts +36 -0
- package/src/index.d.ts +53 -0
- package/src/integration/dingtalk.d.ts +2 -0
- package/src/integration/firecrawl.d.ts +2 -0
- package/src/integration/github.d.ts +69 -0
- package/src/integration/index.d.ts +4 -0
- package/src/integration/lark.d.ts +5 -0
- package/src/integration/wecom.d.ts +2 -0
- package/src/integration.model.d.ts +92 -0
- package/src/invite.model.d.ts +125 -0
- package/src/language.model.d.ts +19 -0
- package/src/organization-contact.model.d.ts +72 -0
- package/src/organization-department.model.d.ts +20 -0
- package/src/organization-language.model.d.ts +18 -0
- package/src/organization-projects.model.d.ts +80 -0
- package/src/organization-team-employee-model.d.ts +12 -0
- package/src/organization-team-model.d.ts +19 -0
- package/src/organization.model.d.ts +238 -0
- package/src/password-reset.model.d.ts +18 -0
- package/src/plain-object.model.d.ts +13 -0
- package/src/plugin.d.ts +116 -0
- package/src/role-permission.model.d.ts +61 -0
- package/src/role.model.d.ts +25 -0
- package/src/schedule.d.ts +27 -0
- package/src/scope.model.d.ts +9 -0
- package/src/secret-token.model.d.ts +11 -0
- package/src/seed.model.d.ts +37 -0
- package/src/storage-file.model.d.ts +39 -0
- package/src/tag-entity.model.d.ts +20 -0
- package/src/tenant.model.d.ts +40 -0
- package/src/tools/index.d.ts +1 -0
- package/src/tools/sandbox.d.ts +5 -0
- package/src/translation.model.d.ts +26 -0
- package/src/types.d.ts +248 -0
- package/src/user-group.model.d.ts +7 -0
- package/src/user-me-context.model.d.ts +9 -0
- package/src/user-organization.model.d.ts +28 -0
- package/src/user.model.d.ts +131 -0
- package/src/view-extension/index.d.ts +1 -0
- package/src/view-extension/model.d.ts +183 -0
- package/src/visibility.model.d.ts +6 -0
package/src/plugin.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
|
|
2
|
+
import { JsonSchemaObjectType } from './ai/types';
|
|
3
|
+
import { IconDefinition } from './types';
|
|
4
|
+
export type PluginName = string;
|
|
5
|
+
export declare const PLUGIN_LEVEL: {
|
|
6
|
+
readonly SYSTEM: "system";
|
|
7
|
+
readonly ORGANIZATION: "organization";
|
|
8
|
+
};
|
|
9
|
+
export declare const PLUGIN_SOURCE: {
|
|
10
|
+
readonly MARKETPLACE: "marketplace";
|
|
11
|
+
readonly LOCAL: "local";
|
|
12
|
+
readonly GIT: "git";
|
|
13
|
+
readonly URL: "url";
|
|
14
|
+
readonly NPM: "npm";
|
|
15
|
+
readonly CODE: "code";
|
|
16
|
+
readonly ENV: "env";
|
|
17
|
+
};
|
|
18
|
+
export declare const PLUGIN_CONFIGURATION_STATUS: {
|
|
19
|
+
readonly VALID: "valid";
|
|
20
|
+
readonly INVALID: "invalid";
|
|
21
|
+
};
|
|
22
|
+
export declare const PLUGIN_LOAD_STATUS: {
|
|
23
|
+
readonly LOADED: "loaded";
|
|
24
|
+
readonly FAILED: "failed";
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Classifies plugin scope and governance.
|
|
28
|
+
* - `system`: built-in/platform-managed plugin that users cannot install/uninstall from org APIs.
|
|
29
|
+
* - `organization`: tenant/org-managed plugin that can be installed and removed per organization.
|
|
30
|
+
*/
|
|
31
|
+
export type PluginLevel = (typeof PLUGIN_LEVEL)[keyof typeof PLUGIN_LEVEL];
|
|
32
|
+
export type PluginSource = (typeof PLUGIN_SOURCE)[keyof typeof PLUGIN_SOURCE];
|
|
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
|
+
}
|
|
42
|
+
export interface PluginMeta {
|
|
43
|
+
name: PluginName;
|
|
44
|
+
version: string;
|
|
45
|
+
/**
|
|
46
|
+
* Declares the plugin's operational level used for visibility and install/uninstall guardrails.
|
|
47
|
+
*/
|
|
48
|
+
level?: PluginLevel;
|
|
49
|
+
icon?: IconDefinition;
|
|
50
|
+
category: 'set' | 'doc-source' | 'agent' | 'tools' | 'model' | 'vlm' | 'vector-store' | 'integration' | 'datasource' | 'database' | 'middleware';
|
|
51
|
+
displayName: string;
|
|
52
|
+
description: string;
|
|
53
|
+
keywords?: string[];
|
|
54
|
+
author: string;
|
|
55
|
+
homepage?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface IPlugin extends IBasePerTenantAndOrganizationEntityModel {
|
|
58
|
+
pluginName: string;
|
|
59
|
+
packageName: string;
|
|
60
|
+
version?: string;
|
|
61
|
+
source?: PluginSource;
|
|
62
|
+
sourceConfig?: PluginSourceConfig | null;
|
|
63
|
+
level?: PluginLevel;
|
|
64
|
+
config: Record<string, any>;
|
|
65
|
+
configurationStatus?: PluginConfigurationStatus | null;
|
|
66
|
+
configurationError?: string | null;
|
|
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
|
+
}
|
|
87
|
+
export interface IPluginDescriptor {
|
|
88
|
+
organizationId?: string;
|
|
89
|
+
name: PluginName;
|
|
90
|
+
meta: PluginMeta;
|
|
91
|
+
packageName?: string;
|
|
92
|
+
source?: PluginSource;
|
|
93
|
+
currentVersion?: string;
|
|
94
|
+
latestVersion?: string;
|
|
95
|
+
isGlobal: boolean;
|
|
96
|
+
level: PluginLevel;
|
|
97
|
+
canConfigure?: boolean;
|
|
98
|
+
canRefresh?: boolean;
|
|
99
|
+
canUninstall?: boolean;
|
|
100
|
+
canUpdate?: boolean;
|
|
101
|
+
hasUpdate?: boolean;
|
|
102
|
+
configSchema?: JsonSchemaObjectType;
|
|
103
|
+
configurationStatus?: PluginConfigurationStatus | null;
|
|
104
|
+
configurationError?: string | null;
|
|
105
|
+
loadStatus?: PluginLoadStatus | null;
|
|
106
|
+
loadError?: string | null;
|
|
107
|
+
effectiveInCurrentScope: boolean;
|
|
108
|
+
scopeRelation?: PluginScopeRelation;
|
|
109
|
+
}
|
|
110
|
+
export interface IPluginConfiguration<TConfig extends Record<string, any> = Record<string, any>> {
|
|
111
|
+
pluginName: PluginName;
|
|
112
|
+
config: TConfig;
|
|
113
|
+
configSchema?: JsonSchemaObjectType;
|
|
114
|
+
configurationStatus?: PluginConfigurationStatus | null;
|
|
115
|
+
configurationError?: string | null;
|
|
116
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { AnalyticsPermissionsEnum } from './analytics/index';
|
|
2
|
+
import { AIPermissionsEnum } from './ai/index';
|
|
3
|
+
import { IBasePerTenantEntityModel } from './base-entity.model';
|
|
4
|
+
import { IRole } from './role.model';
|
|
5
|
+
export interface IRolePermission extends IBasePerTenantEntityModel {
|
|
6
|
+
roleId: string;
|
|
7
|
+
permission: string;
|
|
8
|
+
role: IRole;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface IRolePermissionMigrateInput extends IBasePerTenantEntityModel {
|
|
12
|
+
permission: string;
|
|
13
|
+
role: string;
|
|
14
|
+
isImporting: boolean;
|
|
15
|
+
sourceId: string;
|
|
16
|
+
}
|
|
17
|
+
export interface IRolePermissionCreateInput extends IBasePerTenantEntityModel {
|
|
18
|
+
roleId: string;
|
|
19
|
+
permission: string;
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface IRolePermissionUpdateInput {
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare enum PermissionsEnum {
|
|
26
|
+
PROFILE_EDIT = "PROFILE_EDIT",
|
|
27
|
+
ADMIN_DASHBOARD_VIEW = "ADMIN_DASHBOARD_VIEW",
|
|
28
|
+
ORG_EMPLOYEES_VIEW = "ORG_EMPLOYEES_VIEW",
|
|
29
|
+
ORG_EMPLOYEES_EDIT = "ORG_EMPLOYEES_EDIT",
|
|
30
|
+
ORG_TAGS_EDIT = "ORG_TAGS_EDIT",
|
|
31
|
+
ORG_USERS_VIEW = "ORG_USERS_VIEW",
|
|
32
|
+
ORG_USERS_EDIT = "ORG_USERS_EDIT",
|
|
33
|
+
ORG_INVITE_VIEW = "ORG_INVITE_VIEW",
|
|
34
|
+
ORG_INVITE_EDIT = "ORG_INVITE_EDIT",
|
|
35
|
+
ALL_ORG_VIEW = "ALL_ORG_VIEW",
|
|
36
|
+
ALL_ORG_EDIT = "ALL_ORG_EDIT",
|
|
37
|
+
APPROVAL_POLICY_VIEW = "APPROVALS_POLICY_VIEW",
|
|
38
|
+
APPROVAL_POLICY_EDIT = "APPROVALS_POLICY_EDIT",
|
|
39
|
+
CHANGE_SELECTED_ORGANIZATION = "CHANGE_SELECTED_ORGANIZATION",
|
|
40
|
+
CHANGE_ROLES_PERMISSIONS = "CHANGE_ROLES_PERMISSIONS",
|
|
41
|
+
SUPER_ADMIN_EDIT = "SUPER_ADMIN_EDIT",
|
|
42
|
+
PUBLIC_PAGE_EDIT = "PUBLIC_PAGE_EDIT",
|
|
43
|
+
VIEW_ALL_EMAILS = "VIEW_ALL_EMAILS",
|
|
44
|
+
VIEW_ALL_EMAIL_TEMPLATES = "VIEW_ALL_EMAIL_TEMPLATES",
|
|
45
|
+
ORG_HELP_CENTER_EDIT = "ORG_HELP_CENTER_EDIT",
|
|
46
|
+
ORG_CONTACT_EDIT = "ORG_CONTACT_EDIT",
|
|
47
|
+
ORG_CONTACT_VIEW = "ORG_CONTACT_VIEW",
|
|
48
|
+
ORG_DEMO_EDIT = "ORG_DEMO_EDIT",// Orgnization demo edit permission
|
|
49
|
+
INTEGRATION_EDIT = "INTEGRATION_EDIT",
|
|
50
|
+
INTEGRATION_VIEW = "INTEGRATION_VIEW",
|
|
51
|
+
FILE_STORAGE_VIEW = "FILE_STORAGE_VIEW",
|
|
52
|
+
SMS_GATEWAY_VIEW = "SMS_GATEWAY_VIEW",
|
|
53
|
+
CUSTOM_SMTP_VIEW = "CUSTOM_SMTP_VIEW",
|
|
54
|
+
VIEW_ALL_ACCOUNTING_TEMPLATES = "VIEW_ALL_ACCOUNTING_TEMPLATES",
|
|
55
|
+
ACCESS_DELETE_ACCOUNT = "ACCESS_DELETE_ACCOUNT",
|
|
56
|
+
ACCESS_DELETE_ALL_DATA = "ACCESS_DELETE_ALL_DATA"
|
|
57
|
+
}
|
|
58
|
+
export declare const PermissionGroups: {
|
|
59
|
+
GENERAL: (PermissionsEnum | AIPermissionsEnum | AnalyticsPermissionsEnum)[];
|
|
60
|
+
ADMINISTRATION: PermissionsEnum[];
|
|
61
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IUser } from './user.model';
|
|
2
|
+
import { IBasePerTenantEntityModel } from './base-entity.model';
|
|
3
|
+
import { IRolePermission } from './role-permission.model';
|
|
4
|
+
export interface IRole extends IRoleCreateInput {
|
|
5
|
+
isSystem?: boolean;
|
|
6
|
+
rolePermissions?: IRolePermission[];
|
|
7
|
+
users?: IUser[];
|
|
8
|
+
}
|
|
9
|
+
export interface IRoleCreateInput extends IBasePerTenantEntityModel {
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
export declare enum RolesEnum {
|
|
13
|
+
SUPER_ADMIN = "SUPER_ADMIN",
|
|
14
|
+
ADMIN = "ADMIN",
|
|
15
|
+
AI_BUILDER = "AI_BUILDER",
|
|
16
|
+
ANALYTICS_BUILDER = "ANALYTICS_BUILDER",
|
|
17
|
+
VIEWER = "VIEWER",
|
|
18
|
+
TRIAL = "TRIAL"
|
|
19
|
+
}
|
|
20
|
+
export declare const DEFAULT_SYSTEM_ROLES: RolesEnum[];
|
|
21
|
+
export interface IRoleMigrateInput extends IBasePerTenantEntityModel {
|
|
22
|
+
name: string;
|
|
23
|
+
isImporting: boolean;
|
|
24
|
+
sourceId: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare enum ScheduleTaskStatus {
|
|
2
|
+
PAUSED = "paused",
|
|
3
|
+
ARCHIVED = "archived",
|
|
4
|
+
SCHEDULED = "scheduled"
|
|
5
|
+
}
|
|
6
|
+
export declare enum TaskFrequency {
|
|
7
|
+
Once = "Once",
|
|
8
|
+
Daily = "Daily",
|
|
9
|
+
Weekly = "Weekly",
|
|
10
|
+
Monthly = "Monthly",
|
|
11
|
+
Yearly = "Yearly"
|
|
12
|
+
}
|
|
13
|
+
export type TScheduleOptions = {
|
|
14
|
+
frequency: TaskFrequency;
|
|
15
|
+
time: string;
|
|
16
|
+
dayOfWeek?: number;
|
|
17
|
+
dayOfMonth?: number;
|
|
18
|
+
month?: number;
|
|
19
|
+
date?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Generate cron expression: Minutes Hour Day Month Week
|
|
23
|
+
*
|
|
24
|
+
* @param schedule
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export declare function generateCronExpression(schedule: TScheduleOptions): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IBaseEntityModel } from './base-entity.model';
|
|
2
|
+
export interface ISecretToken extends IBaseEntityModel {
|
|
3
|
+
entityId?: string;
|
|
4
|
+
token: string;
|
|
5
|
+
validUntil?: Date;
|
|
6
|
+
expired?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ISecretTokenFindInput extends IBaseEntityModel {
|
|
9
|
+
entityId?: string;
|
|
10
|
+
token?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CurrenciesEnum } from './currency.model';
|
|
2
|
+
import { DefaultValueDateTypeEnum } from './organization.model';
|
|
3
|
+
import { IUser, LanguagesEnum } from './user.model';
|
|
4
|
+
export interface IDefaultUser {
|
|
5
|
+
email: string;
|
|
6
|
+
password: string;
|
|
7
|
+
imageUrl: string;
|
|
8
|
+
firstName?: string;
|
|
9
|
+
lastName?: string;
|
|
10
|
+
preferredLanguage: LanguagesEnum;
|
|
11
|
+
}
|
|
12
|
+
export interface IDefaultEmployee extends IDefaultUser {
|
|
13
|
+
startedWorkOn?: string;
|
|
14
|
+
endWork?: string;
|
|
15
|
+
employeeLevel?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface IDefaultOrganization {
|
|
18
|
+
name: string;
|
|
19
|
+
currency: CurrenciesEnum;
|
|
20
|
+
defaultValueDateType: DefaultValueDateTypeEnum;
|
|
21
|
+
imageUrl: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ISeedUsers {
|
|
24
|
+
adminUsers: IUser[];
|
|
25
|
+
employeeUsers: IUser[];
|
|
26
|
+
candidateUsers: IUser[];
|
|
27
|
+
}
|
|
28
|
+
export interface IDefaultProductCategory {
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
imageUrl: string;
|
|
32
|
+
}
|
|
33
|
+
export interface IDefaultProductType {
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
icon: string;
|
|
37
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
|
|
2
|
+
import { _TFile } from './types';
|
|
3
|
+
export type TFile = _TFile & {
|
|
4
|
+
fileType?: string;
|
|
5
|
+
contents?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
createdAt?: Date;
|
|
9
|
+
storageFileId?: string;
|
|
10
|
+
};
|
|
11
|
+
export interface IStorageFile extends IBasePerTenantAndOrganizationEntityModel {
|
|
12
|
+
file: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
thumb?: string;
|
|
15
|
+
fileUrl?: string;
|
|
16
|
+
thumbUrl?: string;
|
|
17
|
+
originalName?: string;
|
|
18
|
+
encoding?: string;
|
|
19
|
+
size?: number;
|
|
20
|
+
mimetype?: string;
|
|
21
|
+
recordedAt?: Date;
|
|
22
|
+
storageProvider?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ICreateStorageFileInput extends IBasePerTenantAndOrganizationEntityModel {
|
|
25
|
+
activityTimestamp: string;
|
|
26
|
+
employeeId?: string;
|
|
27
|
+
file: string;
|
|
28
|
+
thumb?: string;
|
|
29
|
+
recordedAt: Date | string;
|
|
30
|
+
}
|
|
31
|
+
export interface IUpdateStorageFileInput extends ICreateStorageFileInput {
|
|
32
|
+
id: string;
|
|
33
|
+
}
|
|
34
|
+
export type TFileDirectory = TFile & {
|
|
35
|
+
fullPath?: string;
|
|
36
|
+
directory?: string;
|
|
37
|
+
hasChildren?: boolean;
|
|
38
|
+
children?: TFileDirectory[];
|
|
39
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
|
|
2
|
+
import { I18nObject } from './types';
|
|
3
|
+
export interface ITag extends IBasePerTenantAndOrganizationEntityModel {
|
|
4
|
+
name?: string;
|
|
5
|
+
label?: I18nObject;
|
|
6
|
+
description?: string;
|
|
7
|
+
category?: TagCategoryEnum;
|
|
8
|
+
color?: string;
|
|
9
|
+
isSelected?: boolean;
|
|
10
|
+
icon?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ITagName {
|
|
13
|
+
name?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare enum TagCategoryEnum {
|
|
16
|
+
INDICATOR = "indicator",
|
|
17
|
+
STORY = "story",
|
|
18
|
+
TOOLSET = "toolset",
|
|
19
|
+
XPERT = "xpert"
|
|
20
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IImportRecord } from './import-export.model';
|
|
2
|
+
import { IFeatureOrganization } from './feature.model';
|
|
3
|
+
import { S3FileStorageProviderConfig } from './file-provider';
|
|
4
|
+
import { IOrganization, IOrganizationCreateInput } from './organization.model';
|
|
5
|
+
import { IRolePermission } from './role-permission.model';
|
|
6
|
+
import { IUserCreateInput } from './user.model';
|
|
7
|
+
export interface ITenant {
|
|
8
|
+
id?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
readonly createdAt?: Date;
|
|
11
|
+
readonly updatedAt?: Date;
|
|
12
|
+
organizations?: IOrganization[];
|
|
13
|
+
rolePermissions?: IRolePermission[];
|
|
14
|
+
featureOrganizations?: IFeatureOrganization[];
|
|
15
|
+
importRecords?: IImportRecord[];
|
|
16
|
+
settings?: ISetting[];
|
|
17
|
+
}
|
|
18
|
+
export interface ITenantCreateInput {
|
|
19
|
+
name: string;
|
|
20
|
+
isImporting?: boolean;
|
|
21
|
+
sourceId?: string;
|
|
22
|
+
userSourceId?: string;
|
|
23
|
+
superAdmin?: IUserCreateInput;
|
|
24
|
+
defaultOrganization?: IOrganizationCreateInput;
|
|
25
|
+
}
|
|
26
|
+
export interface ISetting {
|
|
27
|
+
name: string;
|
|
28
|
+
value: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ITenantSetting extends S3FileStorageProviderConfig {
|
|
31
|
+
fileStorageProvider?: string;
|
|
32
|
+
tenant_title?: string;
|
|
33
|
+
tenant_title_en?: string;
|
|
34
|
+
tenant_enable_feishu?: boolean;
|
|
35
|
+
tenant_enable_dingtalk?: boolean;
|
|
36
|
+
tenant_enable_wechat?: boolean;
|
|
37
|
+
tenant_enable_github?: boolean;
|
|
38
|
+
tenant_enable_google?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export declare const DEFAULT_TENANT = "Default Tenant";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sandbox';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
|
|
2
|
+
import { LanguagesEnum } from './user.model';
|
|
3
|
+
export interface ITranslation<T> extends IBasePerTenantAndOrganizationEntityModel {
|
|
4
|
+
reference?: ITranslatable<T>;
|
|
5
|
+
referenceId?: string;
|
|
6
|
+
languageCode: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ITranslatable<T> extends IBasePerTenantAndOrganizationEntityModel {
|
|
9
|
+
translations?: ITranslation<T>[];
|
|
10
|
+
translate?(languageCode: string): any;
|
|
11
|
+
translateNested?(languageCode: string, translatePropsInput: Array<any>): any;
|
|
12
|
+
}
|
|
13
|
+
export interface TranslateInput {
|
|
14
|
+
key: string;
|
|
15
|
+
alias: string;
|
|
16
|
+
}
|
|
17
|
+
export interface TranslatePropertyInput {
|
|
18
|
+
prop: string;
|
|
19
|
+
propsTranslate: Array<TranslateInput>;
|
|
20
|
+
propAsArr?: Array<string>;
|
|
21
|
+
}
|
|
22
|
+
export declare const TranslationLanguageMap: {
|
|
23
|
+
'zh-CN': string;
|
|
24
|
+
'zh-Hans': string;
|
|
25
|
+
};
|
|
26
|
+
export declare function mapTranslationLanguage(languageCode: LanguagesEnum): any;
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import ShortUniqueId from 'short-unique-id';
|
|
2
|
+
import type * as z3 from "zod/v3";
|
|
3
|
+
import type * as z4 from "zod/v4/core";
|
|
4
|
+
declare const uuidGenerator: ShortUniqueId;
|
|
5
|
+
export declare const uuid: (...args: Parameters<(typeof uuidGenerator)["randomUUID"]>) => string;
|
|
6
|
+
/**
|
|
7
|
+
* @description
|
|
8
|
+
* An entity ID. Represents a unique identifier as a string.
|
|
9
|
+
*
|
|
10
|
+
* @docsCategory Type Definitions
|
|
11
|
+
* @docsSubcategory Identifiers
|
|
12
|
+
*/
|
|
13
|
+
export type ID = string;
|
|
14
|
+
export interface I18nObject {
|
|
15
|
+
en_US: string;
|
|
16
|
+
zh_Hans?: string;
|
|
17
|
+
}
|
|
18
|
+
export type TAvatar = {
|
|
19
|
+
emoji?: {
|
|
20
|
+
id: string;
|
|
21
|
+
set?: '' | 'apple' | 'google' | 'twitter' | 'facebook';
|
|
22
|
+
colons?: string;
|
|
23
|
+
unified?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Use Noto Color Emoji:
|
|
27
|
+
* https://fonts.google.com/noto/specimen/Noto+Color+Emoji/
|
|
28
|
+
*/
|
|
29
|
+
useNotoColor?: boolean;
|
|
30
|
+
background?: string;
|
|
31
|
+
url?: string;
|
|
32
|
+
};
|
|
33
|
+
export type TDeleteResult = {
|
|
34
|
+
/**
|
|
35
|
+
* Raw SQL result returned by executed query.
|
|
36
|
+
*/
|
|
37
|
+
raw: any;
|
|
38
|
+
/**
|
|
39
|
+
* Number of affected rows/documents
|
|
40
|
+
* Not all drivers support this
|
|
41
|
+
*/
|
|
42
|
+
affected?: number | null;
|
|
43
|
+
};
|
|
44
|
+
export type TranslateOptions = {
|
|
45
|
+
lang?: string;
|
|
46
|
+
args?: ({
|
|
47
|
+
[k: string]: any;
|
|
48
|
+
} | string)[] | {
|
|
49
|
+
[k: string]: any;
|
|
50
|
+
};
|
|
51
|
+
debug?: boolean;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Select option type
|
|
55
|
+
*/
|
|
56
|
+
export type TSelectOption<T = string | number | boolean, K = string> = {
|
|
57
|
+
key?: K;
|
|
58
|
+
value: T;
|
|
59
|
+
label?: I18nObject | string;
|
|
60
|
+
description?: I18nObject | string;
|
|
61
|
+
icon?: string;
|
|
62
|
+
};
|
|
63
|
+
export declare enum ParameterTypeEnum {
|
|
64
|
+
STRING = "string",
|
|
65
|
+
NUMBER = "number",
|
|
66
|
+
BOOLEAN = "boolean",
|
|
67
|
+
ARRAY = "array",
|
|
68
|
+
SELECT = "select",
|
|
69
|
+
SECRET_INPUT = "secret-input",
|
|
70
|
+
FILE = "file"
|
|
71
|
+
}
|
|
72
|
+
export type TParameterOption = {
|
|
73
|
+
value: string;
|
|
74
|
+
label: I18nObject;
|
|
75
|
+
};
|
|
76
|
+
export type TParameterHelpInfo = {
|
|
77
|
+
title: I18nObject;
|
|
78
|
+
url: I18nObject;
|
|
79
|
+
};
|
|
80
|
+
export type TParameter = {
|
|
81
|
+
name: string;
|
|
82
|
+
label: I18nObject;
|
|
83
|
+
placeholder?: I18nObject;
|
|
84
|
+
description?: I18nObject;
|
|
85
|
+
type: ParameterTypeEnum;
|
|
86
|
+
required?: boolean;
|
|
87
|
+
default?: number | string;
|
|
88
|
+
min?: number;
|
|
89
|
+
max?: number;
|
|
90
|
+
options?: TParameterOption[];
|
|
91
|
+
items?: {
|
|
92
|
+
type: ParameterTypeEnum;
|
|
93
|
+
};
|
|
94
|
+
when?: Record<string, unknown[]>;
|
|
95
|
+
/**
|
|
96
|
+
* Is visible for parameters
|
|
97
|
+
*/
|
|
98
|
+
visible?: boolean;
|
|
99
|
+
help?: TParameterHelpInfo;
|
|
100
|
+
};
|
|
101
|
+
export type TParameterSchema = {
|
|
102
|
+
type: 'object' | 'array';
|
|
103
|
+
required?: string[];
|
|
104
|
+
secret?: string[];
|
|
105
|
+
/**
|
|
106
|
+
* @deprecated use parameters
|
|
107
|
+
*/
|
|
108
|
+
properties?: any;
|
|
109
|
+
parameters?: TParameter[];
|
|
110
|
+
};
|
|
111
|
+
export interface IPoint {
|
|
112
|
+
x: number;
|
|
113
|
+
y: number;
|
|
114
|
+
}
|
|
115
|
+
export interface ISize {
|
|
116
|
+
width: number;
|
|
117
|
+
height: number;
|
|
118
|
+
}
|
|
119
|
+
export type _TFile = {
|
|
120
|
+
filePath: string;
|
|
121
|
+
fileUrl?: string;
|
|
122
|
+
mimeType?: string;
|
|
123
|
+
/**
|
|
124
|
+
* @deprecated use fileUrl instead
|
|
125
|
+
*/
|
|
126
|
+
url?: string;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* A recursive implementation of the Partial<T> type.
|
|
130
|
+
* Source: https://stackoverflow.com/a/49936686/772859
|
|
131
|
+
*/
|
|
132
|
+
export type DeepPartial<T> = {
|
|
133
|
+
[P in keyof T]?: T[P] extends (infer U)[] ? DeepPartial<U>[] : T[P] extends Readonly<infer U>[] ? Readonly<DeepPartial<U>>[] : DeepPartial<T[P]>;
|
|
134
|
+
};
|
|
135
|
+
export interface ChecklistItem {
|
|
136
|
+
node?: string;
|
|
137
|
+
field?: string;
|
|
138
|
+
value?: string;
|
|
139
|
+
message: I18nObject;
|
|
140
|
+
level: 'error' | 'warning';
|
|
141
|
+
ruleCode?: string;
|
|
142
|
+
}
|
|
143
|
+
export interface RuleValidator {
|
|
144
|
+
validate(input: any, params?: any): Promise<ChecklistItem[]>;
|
|
145
|
+
}
|
|
146
|
+
export declare function letterStartSUID(start: string): string;
|
|
147
|
+
/**
|
|
148
|
+
* The type of icon to render.
|
|
149
|
+
* Determines how the `value` field should be interpreted.
|
|
150
|
+
*/
|
|
151
|
+
export type IconType = 'image' | 'svg' | 'font' | 'emoji' | 'lottie';
|
|
152
|
+
/**
|
|
153
|
+
* Defines a unified structure for representing different kinds of icons
|
|
154
|
+
* in the frontend (image, SVG, font icon, emoji, Lottie animation, etc.).
|
|
155
|
+
*
|
|
156
|
+
* ---
|
|
157
|
+
* 🧩 Supported icon types:
|
|
158
|
+
*
|
|
159
|
+
* | Type | Description | Example `value` |
|
|
160
|
+
* |-----------|----------------------------------|-----------------|
|
|
161
|
+
* | `image` | Raster or Base64-encoded image | `"https://cdn.example.com/logo.png"` or `"data:image/png;base64,..."` |
|
|
162
|
+
* | `svg` | Inline SVG markup | `"<svg xmlns='http://www.w3.org/2000/svg'><path d='M12 2l4 20H8z'/></svg>"` |
|
|
163
|
+
* | `font` | Font icon class name | `"fa-solid fa-user"` or `"ri-home-line"` |
|
|
164
|
+
* | `emoji` | Unicode emoji character | `"🚀"` |
|
|
165
|
+
* | `lottie` | Lottie animation JSON URL | `"https://assets.lottiefiles.com/packages/lf20_abc123.json"` |
|
|
166
|
+
*
|
|
167
|
+
* ---
|
|
168
|
+
* 🧠Example usages:
|
|
169
|
+
*
|
|
170
|
+
* ```json
|
|
171
|
+
* {
|
|
172
|
+
* "icon": {
|
|
173
|
+
* "type": "image",
|
|
174
|
+
* "value": "https://cdn.example.com/logo.png",
|
|
175
|
+
* "alt": "Company logo"
|
|
176
|
+
* }
|
|
177
|
+
* }
|
|
178
|
+
*
|
|
179
|
+
* {
|
|
180
|
+
* "icon": {
|
|
181
|
+
* "type": "svg",
|
|
182
|
+
* "value": "<svg xmlns='http://www.w3.org/2000/svg'><path d='M12 2l4 20H8z'/></svg>"
|
|
183
|
+
* }
|
|
184
|
+
* }
|
|
185
|
+
*
|
|
186
|
+
* {
|
|
187
|
+
* "icon": {
|
|
188
|
+
* "type": "font",
|
|
189
|
+
* "value": "fa-solid fa-user",
|
|
190
|
+
* "color": "#666",
|
|
191
|
+
* "size": 20
|
|
192
|
+
* }
|
|
193
|
+
* }
|
|
194
|
+
*
|
|
195
|
+
* {
|
|
196
|
+
* "icon": {
|
|
197
|
+
* "type": "emoji",
|
|
198
|
+
* "value": "🚀",
|
|
199
|
+
* "size": 32
|
|
200
|
+
* }
|
|
201
|
+
* }
|
|
202
|
+
*
|
|
203
|
+
* {
|
|
204
|
+
* "icon": {
|
|
205
|
+
* "type": "lottie",
|
|
206
|
+
* "value": "https://assets.lottiefiles.com/packages/lf20_abc123.json"
|
|
207
|
+
* }
|
|
208
|
+
* }
|
|
209
|
+
* ```
|
|
210
|
+
* ---
|
|
211
|
+
*/
|
|
212
|
+
export interface IconDefinition {
|
|
213
|
+
/**
|
|
214
|
+
* The type of icon to render.
|
|
215
|
+
* Determines how the `value` field should be interpreted.
|
|
216
|
+
*/
|
|
217
|
+
type: IconType;
|
|
218
|
+
/**
|
|
219
|
+
* The icon content or resource reference.
|
|
220
|
+
* Can be a URL, Base64 data, SVG markup, emoji, or animation file.
|
|
221
|
+
*/
|
|
222
|
+
value: string;
|
|
223
|
+
/**
|
|
224
|
+
* Optional color for the icon.
|
|
225
|
+
* Typically used for font, SVG, or emoji icons.
|
|
226
|
+
*/
|
|
227
|
+
color?: string;
|
|
228
|
+
/**
|
|
229
|
+
* Optional size of the icon, in pixels.
|
|
230
|
+
* Defines the intended rendered size (e.g. 24 → 24px).
|
|
231
|
+
*/
|
|
232
|
+
size?: number;
|
|
233
|
+
/**
|
|
234
|
+
* Alternative text for accessibility.
|
|
235
|
+
* Useful for image or SVG icons.
|
|
236
|
+
*/
|
|
237
|
+
alt?: string;
|
|
238
|
+
/**
|
|
239
|
+
* Optional inline style definitions.
|
|
240
|
+
* Can include any CSS-compatible properties
|
|
241
|
+
* (e.g. `{ "borderRadius": "50%", "backgroundColor": "#f0f0f0" }`).
|
|
242
|
+
*/
|
|
243
|
+
style?: Record<string, string>;
|
|
244
|
+
}
|
|
245
|
+
export type ZodObjectV3 = z3.ZodObject<any, any, any, any>;
|
|
246
|
+
export type ZodObjectV4 = z4.$ZodObject;
|
|
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
|
+
}
|